[SGVLUG] newbie qu: HDD partitions

Terry Hancock hancock at anansispaceworks.com
Sat Jul 30 15:05:05 PDT 2005


On Friday 29 July 2005 06:54 pm, Jeff Kutz wrote:
> Subj: newbie qu: HDD partitions
> My question is what would be the smartest way to partition the 20 GB hard 
> drive.  The author talks about partitions but it seems more like 
> subdirectories that he is talking about.  The way I read the book he would 
> have me putting in some half-dozen partitions.  I am coming from the 
> DOS/Windows world.  Am I missing something here in the transition?

Well, the DOS/Windows way is to use one massive partition, but there are
some drawbacks to this.  Unix has a long tradition of using multiple partitions.

There is no concept of a "drive letter" in Unix/Linux of course, there is just
"the filesystem", and partitions are "mounted" to "mountpoints" which are,
in fact, just directories (the contents of the mounted disk replace any contents
the directory might have, which become invisible --- hence mountpoints are
usually empty).

My preference is to use:

/
/usr
/var
/tmp
/home

as seperate partitions, taking up the first 10-15 GB of space, and then
use the remainder in a large partition called "project" or something similar,
which I will usually share between 2 or 3 machines (but if I don't do that,
then the remainder just goes in /home).

Why?

Because each of these directory trees has very different characteristics:

/           - changes rarely, sensitive data in /etc
/usr     -  only changes when you install software
/var      - log files, caches, etc. that the OS needs to write to often
/tmp    - a space for unpacking data when you need one, throwaway space
/home - all your personal stuff goes here

One reason to put these things on separate partitions is that if you should
feel it's necessary (never actually have, but I like to know I can) you can
mount / and /usr to be read-only, so that program files can't get corrupted
even if you accidentally do something dangerous as root (at least you'd have
to somehow manage to remount them in the process in order to do any
damage).

Another is that many things like backup utility and archivers know how to
"stay on the same partition" so you can, for example, back up only the home
drive (it's your original files that are most valuable -- programs and OS data
can be reinstalled from the original sources).

But the NUMBER ONE reason is because with this kind of configuration you
will run out of disk space on /var or /tmp without having destructive effects
on /home, /usr/, or /!  This is a much better failure mode.  You don't want
runaway processes or logger programs chewing up all your disk space and
leaving you unable to log in (this happens when /home fills up, although you
can still get in as root) or something similar.   Also, since you know that /tmp
stuff is throwaway stuff you don't really need, and you can be somewhat
cavalier about the stuff in /var (though not as much!) you can feel fairly secure
at fixing the problem by deleting unnecessary data there -- and long before it
really screws up your system.  You also have a chance to catch whatever it is
that caused the problem in the act, instead of waiting for it to bite you later
on after it's had time to build up to a multi-gigabyte problem.

At least that's my take on it.

Cheers,
Terry


--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com



More information about the SGVLUG mailing list