Main Content

Disc Partitioning

Archive - Originally posted on "The Horse's Mouth" - 2006-04-30 08:32:25 - Graham Ellis

When installing Linux, you're able to choose how to split up (partition or slice) your disc(s) and which part of the file system to put on each. Here's a partitioning algorithm that we came up with for an organisation that has a variety of servers.

WHAT do you want on separate partitions?

/ - duh, yes, must be a partition name
swap - ANY chance of running out of memory, have a swap area!
/var - if mail system, printer controller, etc
/usr - if you're looking to share /usr (not likely these days); also worth
separating if you're doing a dual boot and both OS's need to start before the the 4Gb mark on the disk.
/usr/local - if you'll be adding lots of extra s/w and want to upgrade the OS later on without reloading all your local extras OR if you want to NFS / Samba share your /usr/local
/tmp - if you have lots of meaty applications that write / read huge temporary files
/home - if you have any local users apart from admin's accounts
/boot - if you're acting as a tftp boot server; also perhaps because grub is here

RULE in general - use separate partitions for things that have different backup strategies, and things that you don't want to crash the system when the users get them full.

How big should they be?

000 question

/ - Need not be too big - 2Gb should be twice what you need
/usr - Build is typically 2Gb to 7Gb - allow, say, 9Gb.
/tmp - Allow, say 2Gb. If you're running an A0 pixel mapped plotter though, you'll need a *** of a lot more space, or if you're doing fluid dynamics, seismic oil data processing.
/var - Allow 1Gb PLUS space for mail, print queues, etc - see /tmp
/usr/local - How much extra s/w are you likely to add? Allow 2 or 3 Gb - lots of s/w, especially Java to add? Allow an extra 4Gb on top ...
swap - authorities say "twice the size of your memory"
/home - as much space as you have left!

Add together the various amounts if you're not having a separate partition for each ... so

Typical system, 512 Mb memory

/ - 2 + 9 + 2 + 3 = 16 Gb
swap - 1 Gb
/var - 3 Gb
/home - the rest

* Do NOT put swap at the very end!
* Multidisc systems - spread swap between all discs with fastest r.p.m.s
* Tend to have / and swap as primary.