[Linux] Hard Drive Partitions
Kwan Lowe
linux@flux.org
Sat, 17 Mar 2007 17:42:11 -0400 (EDT)
> I'm new to the group and attended my first meeting in March. I've been
> messing around with Linux for a couple of years now, but I'd still
> consider myself as being new. I've got a couple of questions that I
> hope someone might be able to answer.
Welcome!
> 1. Partitioning Scheme. I've read in a couple of places,
> recommendations for partitioning the file system and the reasons for
> that. The books I've read suggest placing /, /boot, /var, /tmp, /usr,
> /home, and swap (twice the amount of RAM) all in different partitions.
> What I haven't found is size recommendations. I would assume that I'd
> make /home whatever is left after creating all the other partitions, but
> I don't really know how large to make the other partitions, so that they
> would have enough space to allow for expansion to install more
> software. Drive space really isn't a problem for me, I've just
> purchased a 320 GB drive and have several 120 GB drives kicking around.
> Could someone suggest some sizes?
This is one of those things where you ask six people and you'll get twelve answers :D
Your partitioning scheme depends entirely on what you're using the machine for.
These are the ones I separate:
/home
On my servers the /home partition is only 300M or so, just enough to keep some
profiles and home directories. On a home system it's good to keep it separate
because it makes for easier upgrading and also prevents you from inadvertently
filling the root filesystem with a runaway log.
/var
RPM/YUM based systems use /var/cache/ to hold downloaded updates. It's also where
logs, the RPM database, mail, and a lot of other things are kept. I almost always
separate this partition since it can grow rapidly. I usually size it to a gig.
/tmp
Many applications keep temporary files here. If it's not separate a runaway file can
blow out the root filesystem and cause other problems. On a less loaded system it
doesn't really matter as long as you have sufficient space in /.
/usr
I separate this mainly so I can mount it read-only. Files in /usr should not change
unless you're installing/deinstalling. It also holds the majority of applications.
My /usr partition is usually 2G for a server, but can grow to 5G or more on a
desktop system with lots of applications.
/boot
Should be separate. This is somewhat of a holdover from early days, but still a good
idea. Most distros complain if it's less than 100M and that's what I use.
swap
Oooohhh... You'll hear a dozen answers here too. It's a copout answer, but this one
does seriously depend on what you're doing. If you have 2G of RAM, my suggestion is
to size it at 512M then watch your swap usage over a month or so. If you're dropping
into swap (or more properly, page space) then bump up the size by 200M or so. If
not, just leave it. Sizing it as double the RAM was an OK rule of thumb when memory
was measured in K and M, but not so useful now since there are many more factors.
For example, are you running 32bit or 64-bit, PAE or not, more/less than 4G memory,
how many users active at once, how many processes, etc..
BTW, I'd strongly suggest that you use LVM. It makes it trivial to grow a partition.
> 2. 32 bit vs. 64 bit. My second question is What benefit do I get from
> a 64 bit OS beyond the addressable memory space? I recently built a box
> with an AMD Athalon 64 X2 processor with 2 GB of ram. (This is the box
> in which I intend to install the new drive.) I installed Ubuntu64. I
> noticed that my CD ripping and encoding went much faster, but I
> attributed that to the dual cores. Beyond this though I haven't noticed
> any significant difference, other than not as many programs available
> for the 64 bit OS. Any thoughts?
Besides the address space, many of the 64-bit systems have hardware support for
virtualization. Keep in mind that the extra address space is something you'd
probably want to have over the next couple years. Of that 2G of RAM, only about
1400M is available to user programs. Most 32-bit boards can address 3G of memory,
with maybe 2G available. On a server machine that gets used up very quickly.
--
* The Digital Hermit http://www.digitalhermit.com
* Unix and Linux Solutions kwan@digitalhermit.com