PDA

View Full Version : freebsd 7 installation partition size for 250gb harddrive


ijk
07-21-2008, 12:08 PM
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

killasmurf86
07-21-2008, 03:42 PM
There is no ideal.
I have 250GBas well

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

ijk
07-22-2008, 08:55 AM
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.

killasmurf86
07-22-2008, 04:20 PM
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 :D

ijk
07-22-2008, 04:44 PM
infact I have 100 gb for /var :-)
have 750gb disc space and big databases

TerryP
07-23-2008, 12:25 AM
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.

J65nko
07-23-2008, 12:40 AM
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.

killasmurf86
07-23-2008, 06:41 AM
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]

ijk
07-23-2008, 05:53 PM
thanks for all the help. This is what I went for in the end

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

J65nko
07-23-2008, 07:39 PM
Your root partition is way too big. The remaining18 GB will never be usedSize 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. ;)

ijk
07-24-2008, 07:10 AM
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
So separate the system software, the server applications software and the user data by giving each a separate partition.

J65nko
07-25-2008, 12:31 AM
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 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 ;)

ijk
07-27-2008, 04:20 PM
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.


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/C006208/data/device-harddrives3.php
http://www.pcguide.com/ref/hdd/geom/tracks.htm
when I run swapinfo I get the below.

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

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]:"
ad2: 715403MB <Seagate ST3750640AS 3.AAE> at ata1-master SATA150



thanks for the help.

answered one question myself after a lot of googling.

devfs 1.0K 1.0K 0B 100% /dev

was worried it was 100% full but this is normal.
http://www.fdcservers.net/vbulletin/showthread.php?t=494

TerryP
07-27-2008, 07:27 PM
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.

ijk
07-27-2008, 08:30 PM
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.

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.
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

TerryP
07-27-2008, 09:23 PM
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,



[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.

ijk
07-28-2008, 10:53 AM
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
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
Recommendation is x2 to x4 of your ram I have 8 GB ram
/tmp = 10gb
/usr = 30gb
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
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?query=tuning&apropos=0&sektion=7&manpath=FreeBSD+7.0-RELEASE&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.freebsd.questions/browse_thread/thread/2f2c1aa7c3028927/bcc0e3075befea76?lnk=gst&q=partitioning#bcc0e3075befea76
http://lists.freebsd.org/pipermail/freebsd-questions/2005-January/073534.html

abiallan
10-20-2008, 08:50 PM
hi.

Thanks for your clear explanation...

really it helps me lot..

hats of to u:)

could u send me some links to learn more:D