Click to See Complete Forum and Search --> : Correct Partitoning


ntuser
03-31-2000, 10:11 AM
Although I'm not completely new to Linux, I'm new enough to be making quite a few mistakes. Could someone please explain the correct partitoning scheme to me for a Linux install. The install would be with no other operating systems in use on the machine. Just Red hat Linux. I usually juat create a swap partition and a another for the rest of the drive using a single forward slash. However, I'm told that I should be using a /root, /boot, and /usr partitions also. Any help here is appreciated. Thanks.

furrycat
03-31-2000, 01:20 PM
Attention: I ramble again on this reply.

It's a good idea to create different partitions so that if one gets corrupted you don't lose all your work. Also, if you're going to be doing something which you know may hang the system (like editing your init scripts) you can mount one or more partitions read-only so they don't need to be checked on boot up (which takes forever).

A separate partition for /usr is a good idea because it has a lot of important stuff in it, but none that's essential to getting the system up and running - and none that can't easily be replaced. Hence it's easily classifiable as being in the "second level" of filesystem importance, if that makes any sense (I suspect not). /var is a good candidate because it has files that are constantly changing (/var/log/messages and friends) so there's a lot of disk activity going on there. I personally also have partitions for /home and /opt so I can distinguish between stuff that came on the base system (stuff in /bin, /usr etc) and stuff I installed myself (in /opt and /home).

If your box is running one particular service you might want to dedicate another partition to it (eg /opt/apache/htdocs or /mp3).

A separate partition for /boot isn't always necessary but lilo wants its kernels to be before cylinder 1024 so you sometimes need to put a /boot partition "higher up" the partition table.

In summary, my partition table would be like this (for a 4 gig drive and assuming swap is somewhere else because I can't be bothered to do the maths):

/ 512Mb
/usr 1024Mb
/opt 1024Mb
/home 512Mb
/var 512Mb
/tmp 512Mb

Of course you don't have to be like me: pick your own convention... The important thing is to realise WHY you're doing this, ie lessening the chances of a corrupt partition ruining your whole drive and minimising the time needed to check and repair filesystems.

geekd
03-31-2000, 07:34 PM
I work for a company that has several hundred linux servers (mostly web servers)

these machines have 36 gig harddrives, and get no GUI or X installed (they are "headless")

They have 1/2 Gig of RAM, so we make another 1/2 Gig swap space. (it's good to make swap the same as your RAM amount)

Then we use i Gig for /, and the rest for /home.

Then, we move /usr/local and put it on /home, with a symlink from /usr (because all our web content in /usr/local/www

I recently re-did my desktop linux box. I use X and alot of other apps, so I made / 2.5 Gigs and put the rest in /home. The I put /usr/local on /home with the symlink thingie.

(this is because I play Quake 3, UT and Myth 2 under Linux, and they get installed to /usr/local/games, and each take up 1/2 Gig when installed.


There are an infinite number of ways to do it. There is no "correct" way.

It's good to have /home separate because if you need to re-install, presumably all your personal files will be in /home, so you can save them. A re-install will usually leave /home alone, and put it's stuff in /, /usr and /bin.

-geekd