Re: Best Practices Survey: Disk Partitioning

From: Juha Laiho (Juha.Laiho@iki.fi)
Date: 09/08/02


From: Juha Laiho <Juha.Laiho@iki.fi>
Date: Sun, 08 Sep 2002 08:32:01 GMT

mactech@webdragon.net said:
>>> Do current practitioners recommend a separate partition for /tmp ? Does
>>> it make sense to put /var /usr/ and /usr/local (and possibly /usr/src)
>>> on separate partitions?
>>>
>>> I'm already aware of the usefulness of a /home partition. :)
...
>True however there are obviously still going to be some good *general*
>practices, and if anyone has any usage-specific stipulations, suggestions
>along those lings would obviously be welcome as well.
>
>I mean I know *I* am not looking for a
>partition-guide-to-end-all-partition-guides posting here, and I doubt the
>original poster was either.

Ok, let's start with something.

Goals:
- separate read/write and read-mostly/read-only filesystems
- minimise root fs; minimise writes to root fs
- disallow public writes to root fs

Rationale:
- in events of disaster, partitions with the most disk write
  activity are the most prone to corruption
  => try to get as much static (read-only) data off from the
     actively changed filesystems to minimise the loss in
     disasters
  => minimise size of actively changed filesystems to speed
     up post-disaster recovery
- a minimally sized root fs is less prone to corruption, and
  in the case of corruption fsck has better chances to succeed
  - minimising changes on root fs help this, too
  => tolerant root fs with necessary tools to resue rest of the
     system after a disaster
- filling up root fs can cause loss of log information and
  loss of configuration data

So, fs list:
/
(/boot)
/tmp
/var
/usr
/home
swap

The /boot is more or less optional; I see it mostly beneficial when
sharing the machine with another OS; it's then possible to just
allocate a minimalistic /boot on the boot drive, and have rest of
the linux installation on a separate drive.

For more resilience, add
/var/tmp

(same rationale as with /tmp; in this case check also other ways
 users can maliciously fill up /var)

For mail servers, add
/var/spool/mail
(and possibly add also /var/spool/imap, if using Cyrus imapd)

(again to restrict most disk activity to a more limited partition,
 also to segregate disk consumption by mail content and mail logs)

For news servers, add
/var/spool/news

For web cache servers, add some fs for web cache content
(/var/spool/squid, f.ex.)

Then the next question is, how these should be located on a disk or
shared across disks (when having the luxury of multiple independent
disks -- and note that IDE drives sharing a channel are not independent,
whereas SCSI drives sharing a channel are)

I tend to group the actively updated filesystems as closely together
as I can, with read-mostly filesystems residing on both sides of this
"write zone". This might just be a superstition, though, but I expect
some added performance by minimising the average seek distance.

>From the list above, the various filesystems beneath /var/spool are
likely to benefit from a disk of their own (if the servers are really
utilised).

-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)



Relevant Pages

  • SUMMARY: Moving /usr From Under Root "/" To Its Own Partition
    ... One of the reasons for doing this is to end up with a smaller root ... Install the boot block and boot off the new drive. ... " In order for the root partition to be fscked and remounted ... D> temporarily on the existing disk. ...
    (SunManagers)
  • Summary: Restoring root fileset on 4.0d
    ... There is a renamefset command that was suggested, but since the system was running (only the clone backups were failing because the root fileset was mistakenly named "roottmp") I did not want to risk renaming the root filesystem in multiuser mode. ... I used the vdump/vrestore process to copy the original data for root, usr, and var to another disk and then I had a tech onsite move the new disk into the scsi position of the original disk. ... I want to restore the root advfs filesystem on a 4.0d system. ...
    (Tru64-UNIX-Managers)
  • Re: what to do about "cannot dump to dumpdev hd(1/41): space for
    ... smoke out anything that would point to root being there. ... whole disk division and maybe boot but nothing else. ... I've see that before when a client used Microlite Backup ... alter the file system and log its results to /tmp/logfsck. ...
    (comp.unix.sco.misc)
  • Re: Does Scandisk MSG indicate Hardware, Application, or OS Issue? - R
    ... Windows 2000 SP4, ... I had a problem that I am trying to determine the root cause of a problem. ... A disk check has been scheduled. ... After this restore it complained ...
    (microsoft.public.windows.file_system)