Best Partitioning Scheme?
I am looking to set up a Slackware box with Apache, PHP and MySQL. Along with qMail to provide email for a couple domains.
What is the best partitioning scheme for doing this?
My current layout is:
/boot 300MB hda1
/root 1000MB hda2
/swap 240MB hda3
/usr 1000MB hda5
/var 1000MB hda6
/opt 1000MB hda7
/home 1900MB hda8
This is just a test system... will have a 40GB and a 20GB hard drive on production box.
What about Inode density on each of these partitions?
I understand you might want to use a lower Inode setting if you are going to have alot of small files, which might be the case for qMail.
So which partitions might need a smaller Inode density?
Any suggestions are welcome... especially from others who might be running Apache, PHP, MySQL and qMail on a Slackware box.
set up in this order
then set up a swap twice that of youre ram
how much hd space do you have left? (write that down)
delete swap and make a / root to the size that you wrote down now make a swap using the remaining space on harddrive.
must be in this order to work though
that is the most basic setup i can think of.
use the 40 gig for storage or what ever you like.
thats just my opinion though.
The answer is really: it depends. There are two main configurations I use.
1. For a desktop/workstation environment, I have:
/boot (50 megs)
swap (twice my RAM or 512 Meg, whichever is smaller)
/ (root partition - 3 to 5 gigs depending on space)
/home - whatever is left
This would also be a good setup for a file server.
2. Production server setup
Your initial suggestion is actually pretty close to what I usually see recommended for a server. You'll want to drop /opt unless you plan on installing any add-on packages in there. Also, you really should have a /tmp partition on a server. Otherwise, if something tries to write a ton of stuff to /tmp, your root partition will fill up and cause all kinds of problems. Oh yeah, and /boot has no reason to be over 50 megs.
On the inode density, its not usually something I mess with. The default has never seemed to cause any problems.
another question that might start a holy war :}
My personal setup on my notebook is
(was ... *makes the cross-symbol with his hand)
I don't understand the /boot partition. I have been using slack for a few years now and always use:
first x number of MB for swap. whatever twice my RAM is. Right now my first partition is 500MB (256MB RAM). I make swap my first part because the first sectors of the HDD are supposed to be accessed the fasted.
I then create the / (root) partition. I have never created a /boot partition. Why would one create a /boot part.. ?
/boot was originally made to overcome a limitation of LILO. In the past, it could only boot to the first 1024 cylinders of your hard drive, so could make a tiny partition at the beginning of the drive, and throw your kernel in there to avoid the problem. This problem has been firxed for a while now, but I still use /boot. There are a couple reasons:
mount /boot read-only (except during kernel upgrades) and you don't have to worry about anything messing with the kernel.
I don't feel like repartitioning all my boxes. If I have to do a clean install I might consider it.
So /boot partition is not necessary?
And for my scheme it might be a good idea to do away with /opt and replace it with a 1GB /tmp?
Eventually I am working toward building a server that will use Apache, PHP, MySQL, DJBDNS, qMail and either PureFTP or ProFTP. I also want to test some of the weblog apps like PHPNuke.
So what would be a good partition scheme for this purpose?
My workstation is a Dell 4100 1GHZ with 80GB hard drive... my server is one I built myself... an Athlon XP 1.8GHZ with a 40GB and a 20GB hard drive.
Should swap be created first and then root?
I currently have a 9.5Gb /usr, 8Gb / and a 1.6Gb /home on /dev/hda's 1,5 and 6 respectively. The reason for /usr and / being back to front is because hda1 used to be my Windows drive and since /usr is the fastest growing part of my system (due to an overflowing /usr/src directory) it got first dibs on the free space. At 1.6Gb, /home is way too small but it was all I could really spare at the time I created it.
If I were reinstalling I'd forego the seperate /usr and / partitions (the only reason I have them seperate now is that it would have taken a lot of partition massaging to unify hda1 and hda5 after Windows was removed and I didn't really want to reinstall Slack again, not when I was so close to finally getting GNOME built and after I'd just reinstalled because of stupidity on my part) but still maintain a /home partition but this time making it larger because I have more space to work with.
If nothing else, it's a good idea to have at least /home mounted on a seperate partition. Knowing you're stuff will be safe in between OS reinstalls makes things a lot easier.
edit: Forgot to mention theres also a swap partition (I don't have enough RAM to go without one yet!) in there, that's on hda7 and is ~197Mb in size.
Many many ways to do this--my formula is like this:
/boot 512 mb
/swap x2 ram
/ 3gig mininmum for slackware (8.1 will fit in 2.2 full install i believe)
/home the rest of drive (I generally save and uncompress everything in here and ln -s to other places when I can)
This seperate partition for /boot thing is new for you Slackware guys (weren't old kernels in root / dir) but Redhat has had it for a while mainly to keep the kernel down below the 1024 cyllinder mark for old LILO versions which doesn't apply to Slackware 8.1. I do like the supenguin's idea though of mounting /boot read only so nothing can change your kernel image.
Anyhow, Redhat says 5-10MB (meg not gig) for /boot, all it will ever hold is kernel images, symlinks and small text files. 10MB is room for 8 or 9 kernels plus whatever else and at the most I've had 5 kernels under Redhat but 3 tops in Slackware; Unless your doing kernel development and build new kernels daily... Some of the sizes at 512MB, 50MB are overkill and just waste hdd space. Sorry if it sounds like a flame of those with big /boot partitions but 10MB is fine, no more than 40MB max.
If your new to linux and playing with slack do one giant root then a swap and you can repartition when (not if) you decide to reinstall which will give you an idea how much space you use in each dir. (try "du -hs /*" to see how much space you use after installing.)
swap is a point of contention too, in olden days swap was reccomended 2-3x RAM but we can get massive cheap RAM. So again I defer to supenguin's choice "swap twice my RAM or 512 Meg, whichever is smaller." If you had 512RAM and 512SWAP that's a giant amount for linux that you wouldn't use unless you ran a major website while playing UT under wine and surfing with an oversized web cache. Older versions of linux had a max of roughly 130MB for swap and this is also ample for most systems. (open everything you can think of and then type vmstat)
My current scheme:
/usr 3.4 gig
/home 10 gig
swap 131 megs
but I use my system different than you and I think my judgement was off when picking this.
/var I'd go seperate for log files; on a web/mail server on the net you could fill a drive with log files if you come under attack or something goes haywire and a seperate /var keeps the root partition from filling up when this happens, maybe 1 gig tops, probably 500megs is ample (my personal web server/firewall has 32meg in /var.)
/tmp maybe seperate too, similar to /var though don't overkill because it will be mostly empty unless something breaks, maybe 500meg to 1 gig tops (my server has 1.1megs in /tmp right now, mostly X/KDE stuff.)
/opt I have no idea, I think apache uses opt for web site space but you can change that to /home if you have few users taking space
/home is for users and you can move your http root and ftp root here too so put whatever is left here.
/usr or /usr/local this is supposed to be seperate to make it easier to do upgrades to new versions of your distro but it's kind of a preference thing and if your server is running live you won't be doing a distro upgrade but probably package upgrades or installing tarballs.
/ is sort of a what's left thing, between / and /usr you need about 3 gig to install everything in slack and have breathing room, if you do a seperate /usr and /home then 1gig is probably fine, if you don't seperate /usr then 3-5gig is good.
Also if you have multiple HDDs and one is faster put swap and / there so the system can get at it's binaries quickly and swap quickly. Put web space etc on the slow drive since most of your web hits if your site is busy will be cache hits and if it's slow then your internet pipe will be the bottleneck not hdd speed.
the only reason I used 100 meg for a boot partition is that that is what the default is for redhat 8.0. No big deal i just went with that. Still trying to keep it simple I used the rest of the drive for the root partition carefully leaving my self enough space for a swap partition. I run Websites on my box so ram is a big Deal here. I have 384 meg of ram and a swap of yes you guessed it 768meg. When running websites under apache they reccomend that you have enough ram so that you never have to use you're swap space. For example I fire up my server and everything is running ok. someone accesses my website. It takes a little bit to load, but if someone else visits that site than it is already stored it ram and loads immediately. After the server is up for two days the available ram goes from 230meg to about 50 meg. Why because linux indexes the drive to keep the performance of accessing the harddrive up, also i have search engines scanning my sites all the time, and if i have to work on the server that takes up ram, I mean it gets cached. I'm not saying that it is important and I don't really have problems, but i have the peace of mind knowing that the websites that i host always load fast, Having a really quick harddrive helps also. If you can afford a 15,000 rpm scsi than get it, as a matter of fact get two and mirror them. If you are on a budget like me get 2 maxtor udma 133 drives and mirror them. My experience for a budget server is getting at least a pentium II 350. A pentum I with my experience is way too slow. or at least a amdk62 500 or above. But the pentium will run cool to the touch. at least a udma 66 drive maxtor seems to be the fastest from my benchmarks compared to other drives, but if you have a udma100 or faster drive than this doesnt matter. the siig udma133 interface card works perfectly under redhat 7.3 and 8.0 and with a maxtor udma133 drive linux will scream. with this setup you will only need 128 meg of ram but if you wan't more go ahead it won't hurt. my personal setup goes like this........
biostar socket 370 motherboard model #M6VCF says Vega on the box.
cheap pc133 ram 384meg would like 768
smc $10.00 network card. This is the fastest card i have ever seen
the only thing faster is a d-link 1000tx network card, this card will blow the doors off any 10/100 card even running in 100tx mode
siig udma133 interface card with a 60gig maxtor udma133 drive
ati 8meg agp card so i can watch divx movies and dvds if i wanted
(I Love Computers Can't you tell!)
teac 1.44 floppy drive. I love these drives but I love for them to work also thats why i always get one of these babys
My preference is lite-on for a cdrom dvd or cdr drive cheap and extremely dependable, get it at pc club in fact if you want dependable parts that always work buy it there.
my server screams.
i wonder if theres a noticable difference between a celeron 800 and a 1ghz pIII which is the max this board will support.
anyways thats my input. this is a completely stable setup.
by the way the motherboard has the latest bios abd the cards are agp slot 1 ethernet slot 2 and siig udma card slot 3.
This is just my input and a suggestion don't flame me on it and I'm not an intel only guy I use an athlon xp proccessor on my workstation. 7vrxp gigabyte mobo 256meg ddr333 ram and stiped maxtors. works wonderfull in linux but as far as performance it seems to be just slightly faster that my celeron setup under linux only.
One distro (forgot the name) actually umount'ed the /boot partition after boot, for that extra measure of safety.
As to formulae for partitioning... there isn't one. What I recommend is this:
1) List the various types of data you will host (mail, database, multimedia, user home dirs, etc)
2) Rank the relative importance of each type of data, and take into consideration whether you will have a backup strategy for each
3) Estimate the volume of each type of data
4) Estimate the volume of application logging you will have (sendmail logs, Apache logs, etc) and consider whether these are important to you. You may want to keep /var/log on its own partition.
5) Estimate how much swap space you REALLY need. We've all heard the "2x RAM" estimate, but this dates back to 32M machines -- I have 512M on my workstation, and I hardly ever swap out more that 20M (and that's only when running a LOT of heavy duty processes, which is something most "servers" probably won't experience).
Now you may be in a position to start determining what needs to be kept on its own partition, and how big each partition should be.
As to inode size, that depends on the file system you choose... for example, I think that inode is meaningless in a reiserfs, but it is important if you use ext2/3fs. At any rate, you probably want to use a journaling fs.
Thanks for info... good info there...
I have already chosen ReiserFS for my file system.
Greetings All: This is to Daren...... I have been wondering about the /boot partition stuff for some time. Your post answered a question that has been bothering me for a while.
I have a small collection of Toshiba T200 Pen-tablets that have a propriatory harddrive of 80 meg with a PCMCIA type 3 slot for an ATA HD which I have several of. I am wanting to install a distro of linux but was having trouble getting around the small main (non-replacable) drive. Assuming your info is straight all I need to do is use my boot floppys to start the install via my PCMCIA CD drive in the other PCMCIA slot, partition the Main drive with /boot of about 10 meg use the other 70 meg as swap, install a kernel that will run my PCMCIA HD with it identified as / (root) (2gig)
As these machines have 36 meg of RAM it will be a light weight system by todays standards, but what else is new, in 486s that is??!?!?!?!?!?!?!
Anyone out there running Apache, PHP, MySQL and qMail have any other suggestions about partitioning for a server?
|All times are GMT -5. The time now is 03:00 PM.|