[SGVLUG] newbie qu: HDD partitions
John Riehl
jcriehl at mail.jpl.nasa.gov
Fri Jul 29 19:46:04 PDT 2005
Jeff Kutz wrote:
> 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
well, there are lots of ways/reasons to partition a hard drive.
swap - you gotta have swap and your swap partition will be a separate
partition. old rule of thumb was to make it twice the size of real
memory. this isnt quite true anymore but it is a good estimate. many
of the distributions automatically calculate a swap space size.
/ - gotta have root. I would make this pretty large, like 10G, less
any partitions (other than home).
/home - I would make this something like 5g, maybe the rest of the
drive. You want home on a separate partition, because if you install
another/ a newer version on top of your old version, you want to avoid
wiping out your personal files.
some other partitions that you MIGHT want:
/boot - in days of your, the bios of many a computer could not address
booting a kernel that was not in the first 1024M of a disk. hence, you
put the /boot on its own partition, at the top of the disk. some people
still do this, for purposes of reserving space. I dont think it is
necessary. If you do put /boot on its own partition, it would make it
200mb.
/var - I think this is what you reference. if someone hits you network
activity, especially stuff that your firewall logs, it gets put into
your system log, /var/log/messages. If your system is exposed to the
internet (as a server), you want to put /var or /var/log on its own
partition. If someone hits you with a dos attack (i.e. generate
millions of messages), your isolated /var or /var/log might fill up, but
it wont crash your system. now, mail is also under /var. ergo, some
will put /var/spool on its own system, or create a /var and a /var/log,
or whatever. I usually make /var at least a gig, sometimes two.
/usr - some people put this on its own partition, and mount the parition
read-only by default. This kinda prevents a lot of hack attacks from
overwriting system utilities. Someone who is smart enough will get
around this, by remounting the system as readwrite, but it will filter
out some kiddies, and some attacks. If your system is just a home
system behind a firewall, I wouldnt bother. /usr is big, several gig,
but depends on your distro, and how much you put in it.
/tmp - sometimes you have multi-user systems, with people doing a lot of
processing in temp space. you might want to fence off /tmp, to prevent
people from filling up the entire systems. I would make it a gig or
two, depending on your system needs.
really, if you notice a theme. you make separate partitions to fence
off the possibility of certain areas being overrun. You want to keep a
process, person, or attack from filling up all disk and disrupting your
system. the trade-off is manageability. If this is a home system,
behind a firewall/router, I probably wouldnt make all these separate
partitions. If it was an internet server, I probably would (and I have).
another tip is that you dont need to allocate all your disk. You can
alway leave some space unallocated, or allocate to another partition
like "/empty". This lets you allocate it if your needs change, without
reinstalling. You might have a system running for a time, and then
realize that you really need a larger or separate partition. It can be
a pain to shrink a partition to resize something else. ..(of course,
there is always lvm).
jr
john riehl
More information about the SGVLUG
mailing list