DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default freebsd 7 installation partition size for 250gb harddrive

what would be ideal partition size for freebsd7 runing on a 250gb hardrive.
The server would be runing apache php and mysql and runing some busy sites with 100000 plus members.
Particularly what should be the size of /var
also of particularly interest would be what would be good sizes to use for /tmp /root etc as disc space I donot this is going to be a problem
will be leaving most of the remaining space for /usr
thanks
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5
Reply With Quote
  #2   (View Single Post)  
Old 21st July 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

There is no ideal.
I have 250GBas well
Code:
Swap 4GB (i got 2GB ram)
/ 256MB
/home, everything left
/usr 10GB, can be smaller (perhaps 7GB), i'll probably resize it later, and make /bak slice :)
/var 512MB
I could live with smaller /usr, but i don't mind if it has some extra space....

My last setup used some 5-6GB /usr
Note that you may need to make workarounds for some packages to compile, if you use small /usr, but that's very easy to do..
http://daemonforums.org/showthread.php?t=1241#post8963


Edit: Forgot to mention, that i use FreeBSD 7 as my desktop OS, if you will use it as Server os, then you will need way bigger /var.... and something different probably

Last edited by graudeejs; 21st July 2008 at 02:52 PM.
Reply With Quote
  #3   (View Single Post)  
Old 22nd July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default /usr

i have my home directory in /usr
i have it as something like /usr/local/home
so after allocating 50 gb to /var the
Swap 4GB / 256Mb
THe rest I allocate to /usr.
I hope having the home directory in /usr is not going to cause any performance hits.
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5
Reply With Quote
  #4   (View Single Post)  
Old 22nd July 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

It, wont'.
But i won't do it, in case you mess system completely and want to reinstall from scratch, you can't newfs -U /usr, or you will lose your files

Do you have server?
Why do you need 50GB for /var ?



EDIT:
Ah, stupid me... it's a server

Last edited by graudeejs; 22nd July 2008 at 03:22 PM.
Reply With Quote
  #5   (View Single Post)  
Old 22nd July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default 50gb for var

infact I have 100 gb for /var :-)
have 750gb disc space and big databases
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5
Reply With Quote
  #6   (View Single Post)  
Old 22nd July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Quote:
Originally Posted by ijk View Post
what would be ideal partition size for freebsd7 runing on a 250gb hardrive.
The server would be runing apache php and mysql and runing some busy sites with 100000 plus members.
Particularly what should be the size of /var
also of particularly interest would be what would be good sizes to use for /tmp /root etc as disc space I donot this is going to be a problem
will be leaving most of the remaining space for /usr
thanks
This all depends on what you need to store.


By default 8% of allocated space is 'reserved' and you really do not wan to cut FreeBSD file systems down to the wire: not enough free space == reduced performance.


Since you've got a lot of room, planning to have 15% margin for performance reasons, plus 40~50% of the remaining disk space free on your partitions in case of surges in required space probably wouldn't be a bad idea.


The size of / needs to be large enough for your needs, remember every thing not moved onto another 'mount' is stored on /; my laptop runs 512mb / without problems but I *have* filled it to the brim on occasion. The size of /tmp should be able to hold the largest files you intend to place there, for example I often extract backups in /tmp/SomePrivateDir or /root -- which ever offers more space.


I would suggest a /usr partition of at least 2GB in order to handle the load of /usr and associated files. Remember /usr/ports, /usr/obj, /usr/src and /usr/local are stored on it. The standard contents of /usr alone should consume around 500~600MB not counting the aforementioned directories.


Assuming your storing the websites files in /var, you need it to be _at least_ big enough to hold all of your sites files and their databases. Loving margin for error, something like:

(disk quota + database quota) * 1.7.


would probably be suitable. The greater margins are always helpful and can cause less trouble later when todays constants (e..g sites * quota) change to tomorrows over time spent fixing it ;-).



You can off load most parts of the file system at will, for example you could mount /usr/ read only, then mount another partition on it read write as /usr/ports. (I've never tried this but I see no reason why it should not work!). If you have disk space, you can always create a small partition for a /home and make /usr/home a symlink to it. My file server has like a 400MB partition for /home, just enough free space that I can store larger files their in a 'pinch' without (as much of) the freedom for an attacker to bloat free space on /usr should the account be compromised ;-)





DISCLAIMER: I am not a professional user of FreeBSD, just my families computer geek.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #7   (View Single Post)  
Old 22nd July 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Remember that dump and restore work on partitions. So separate the system software, the server applications software and the user data by giving each a separate partition.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #8   (View Single Post)  
Old 23rd July 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

Quote:
Originally Posted by J65nko View Post
Remember that dump and restore work on partitions. So separate the system software, the server applications software and the user data by giving each a separate partition.
Or you will need to mess with chflags nodump, and make 2 backups of same slice, 1 for system data, 1 for user data,. if you want to separate it [i'm improvising, but it should be possible]
Reply With Quote
  #9   (View Single Post)  
Old 23rd July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default my partition sizes

thanks for all the help. This is what I went for in the end
Code:
Size    Used     Avail   Capacity  Mounted on
19G     197M     18G       1%         /
1.0K    1.0K     0B        100%     /dev
7.7G    14K      7.1G       0%     /tmp
545G    998M     500G       0%      /usr
97G     102M     89G        0%      /var
/dev donot know what that is for !
hope you all agree
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5
Reply With Quote
Old 23rd July 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Your root partition is way too big. The remaining18 GB will never be used
Code:
Size    Used     Avail   Capacity  Mounted on
19G     197M     18G       1%         /
Actually 500 MB is more than enough for this partition.

For a server it is also recommended to have a separate partitions for //var/log and /var/tmp.
If you offer mail facilities to your users you also need a separate /var/mail.

And you are ignoring my advice to separate the base system, application and user generated data.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 24th July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default thanks for the replies

hi J65nko thanks for the help.
I would be grateful if you could put down your optimal partitions for a 750 gb harddrive.

Also could you elaborate on
Code:
So separate the system software, the server applications software and the user data by giving each a separate partition.
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5
Reply With Quote
Old 24th July 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Without more detailed information which applications you use and exactly how the data for your users is being stored me. nor anybody else will be able to to give you an optimal suggestion Actually you should be able to get that info from your current server.

According to the FreeBSD hier(7) man page, programs installed from the ports system are installed in /usr/local. So by creating a separate filesystem for /usr/local you will separate your applications from the remainder of the system.

Rationale: a problematic port upgrade from one of your applications can now be easily fixed by restoring the previous version from backup.

If your data for your 10000 users is being stored in MySQL tables/databases somewhere under /var, then create a separate partition for those tables. Same for the mail.

Rationale: you don't want a massive spam attack (delivered to /var/mail) completely fill up your /var partition and thus denying your users to store their data in your MySQL databases located in the same /var partition. Or the other way around
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 27th July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default

Quote:
Without more detailed information which applications you use and exactly how the data for your users is being stored me
hosting community sites using apache /virtual hosts, mysql database and php scripts. plan to have a mailserver. There will be only one user.

Quote:
Actually you should be able to get that info from your current server.
i have already posted the partition sizes what other commands should I run to get the additional info.

For disc geometry I thought the below links were the best to get a quick overview.
http://library.thinkquest.org/C00620...arddrives3.php
http://www.pcguide.com/ref/hdd/geom/tracks.htm
when I run swapinfo I get the below.
Code:
Device          1K-blocks     Used    Avail Capacity
/dev/ad2s1b       8388608        0  8388608     0%
the only bsd partition with 8GB is the tmp drive. does this mean no swap drive was created ?

here is output of df -h
Code:
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad2s1a     19G    197M     18G     1%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ad2s1e    7.7G     14K    7.1G     0%    /tmp
/dev/ad2s1f    545G    998M    500G     0%    /usr
/dev/ad2s1d     97G    103M     89G     0%    /var
I have only one harddisc of 750 GB so should not it be ad0 instead of ad2.

dmesg | grep -e "ad[0-9]:"
Code:
ad2: 715403MB <Seagate ST3750640AS 3.AAE> at ata1-master SATA150


thanks for the help.

answered one question myself after a lot of googling.

Code:
devfs          1.0K    1.0K      0B   100%    /dev
was worried it was 100% full but this is normal.
http://www.fdcservers.net/vbulletin/...read.php?t=494
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5

Last edited by ijk; 27th July 2008 at 05:48 PM.
Reply With Quote
Old 27th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

devfs and procfs's basically are managed in memory by the kernel, it ain't a "formal" file system.


>the only bsd partition with 8GB is the tmp drive. does this mean no swap drive was created ?


I don't quite understand what you mean, because you just listed the contents of a swap partition above that text.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 27th July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default

Quote:
I don't quite understand what you mean, because you just listed the contents of a swap partition above that text.
Trying to work my headaround unix partitioning slices versus bsd partitions which is becoming quiet clear now.

The below is the swap drive. thanks to you just notice the ad2s1b b at the end so a different partition.
Code:
Device          1K-blocks     Used    Avail Capacity
/dev/ad2s1b       8388608        0  8388608     0%
I was expecting to see it as /swap. But did not so got a bit confused.

I take it all the below are bsdpartitions and not slices.
Code:
ad2s1a 
ad2s1b
ad2s1e
ad2s1f
ad2s1d
still wonder why my one and only harddrive is not following normal naming convention and is a ad2 instead of a ad0

Now the sysadmin who installed freebsd on myserver would he have any sane reason to give me a swap drive of 8gb when I have ram of 8gb.
The normal norm is to have x2 or x3 the amount of ram you have.

As always your help is greatly appreciated thank you
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5

Last edited by ijk; 27th July 2008 at 07:35 PM.
Reply With Quote
Old 27th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

The discussion of what sice swap space is needed on a server, is most defiantly one I'll keep my head out of for any system beyond my personal control.


The only time I've had problems with FreeBSD detecting a machine with only 1 disk as anything >0, is my test machines SATA drive. Where the 'ATA_STATIC_ID' option in FreeBSDs GENERIC kernel configuration usually causes the machines lone hard drive to be detected as ad4, instead of ad0. A lot of people here have used FreeBSD longer then I have and on much more varied system configurations, maybe someone might have an idea?




The disk notation used on FreeBSD is very simple,

Code:
[driver name] [disk number] s[slice number] [[partition letter]]

So, using 'ad2s1b' as an example for the above notation. 'ad' is the driver name, '2' is the disk number, 's1' is the slice number, and 'b' is the partition letter.


By convention some of the letters used for denoting partitions have special meanings on some systems. 'a' on the boot disk => /, 'b' => swap, 'c' => the entire slice, e.g. ad2s1c is equal to ad2s1 and all partitions within slice 1's label, in meaning that is.


You can find more details in the FreeBSD handbook and manual pages for bsdlabel. FreeBSD is also fairly consistent in its device naming practices.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 28th July 2008
ijk ijk is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 47
Default feedback please

Now after doing a bit of research and all your fantastic feedback I have decided on the below partitions for my 750 GB hardrive . And few questions still remain but here goes.

/ = 2gb
Quote:
Most say 512mb is enough but have got a lot of harddrive space so using 2gb which should still put all of root in the outermost track of the harddrive for good speed
swapdrive = 2 x8gb =16gb
Quote:
Recommendation is x2 to x4 of your ram I have 8 GB ram
/tmp = 10gb
/usr = 30gb
Quote:
According to the FreeBSD hier(7) man page, programs installed from the ports system are installed in /usr/local. So by creating a separate filesystem for /usr/local you will separate your applications from the remainder of the system.
/var/db = 50gb
Quote:
have big mysql databases
/var/log = 10gb
/var/mail = 20gb
/var = 100gb
/home = remaining . The plan is to host the websites files from the home directory so will need the most space as log of images file etc.

Questions:
1] /usr = 30gb is it better to give /usr/local =20gb and /usr = 30 gb or just have /usr = 30 gb
2] would it be better to create another directory say /www for the sites I will be hosting ? was thinking of putting them in /home as a subdirectory. There is just going to be one user.
3] /var/mail = 20gb is that enough for a moderately busy website. what would be the size of /var/mail of a typical mailserver.

Anything else you think I should be doing would be most grateful for your help
thank you.

List of links I felt were useful.
http://www.freebsd.org/cgi/man.cgi?q...SE&format=html
http://www.vmunix.com/fbsd-book/install.phtml
http://www.raiden.net/?cat=2&aid=291&pid=2
http://www.freebsd.org/cgi/man.cgi?query=hier&sektion=7
http://groups.google.com/group/lucky...c0e3075befea76
http://lists.freebsd.org/pipermail/f...ry/073534.html
__________________
Freebsd 7 64 bit apache2.2 php5 mysql5

Last edited by ijk; 28th July 2008 at 01:28 PM.
Reply With Quote
Old 20th October 2008
abiallan abiallan is offline
New User
 
Join Date: Oct 2008
Posts: 1
Default

hi.

Thanks for your clear explanation...

really it helps me lot..

hats of to u

could u send me some links to learn more
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FBSD 7.2 installation not seeing partition table correctly Mantazz FreeBSD Installation and Upgrading 0 2nd July 2009 11:36 AM
Negative partition size? giga FreeBSD General 1 2nd January 2009 09:02 PM
freebsd 7 64 bit installation ijk FreeBSD Installation and Upgrading 9 1st September 2008 03:16 AM
Mounting a FreeBSD UFS partition roddierod Solaris 1 7th August 2008 02:02 PM
Resizing FreeBSD partition Cloud FreeBSD General 3 28th June 2008 03:40 AM


All times are GMT. The time now is 04:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick