home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / doc / HOWTO / mini / Partition < prev    next >
Text File  |  1997-07-31  |  29KB  |  565 lines

  1.   Linux Partition mini-HOWTO
  2.   Kristan Koehntopp, kris@koehntopp.de
  3.   $Id: howto.sgml,v 2.2 97/07/15 20:07:21 kris Exp Locker: kris $
  4.  
  5.   1.  Introduction
  6.  
  7.   1.1.  What is this?
  8.  
  9.   This is a Linux Mini-HOWTO text. A Mini-HOWTO is a small text
  10.   explaining some business related to Linux installation and maintenance
  11.   tutorial style. It's mini, because either the text or the topic it
  12.   discusses are to small for a real HOWTO or even a book. A HOWTO is not
  13.   a reference:  that's what manual pages are for.
  14.  
  15.   1.2.  What is in it? and related HOWTO documents
  16.  
  17.   This particular Mini-HOWTO teaches you how to plan and layout disk
  18.   space for your Linux system. It talks about disk hardware, partitions,
  19.   swap space sizing and positioning considerations, file systems, file
  20.   system types and related topics. The intent is to teach some
  21.   background knowlegde, so we are talking mainly principles and not
  22.   tools in this text.
  23.  
  24.   Ideally, this document should be read before your first installation,
  25.   but this is somehow difficult for most people.  First timers have
  26.   other problems than disk layout optimization, too. So you are probably
  27.   someone who just finished a Linux installation and is now thinking
  28.   about ways to optimize this installation or how to avoid some nasty
  29.   miscalculations in the next one. Well, exspect some desire to tear
  30.   down and rebuild your installation when you are finished with this
  31.   text. :-)
  32.  
  33.   This Mini-HOWTO limits itself to planning and layouting disk space
  34.   most of the time. It does not discuss the usage of fdisk, LILO, mke2fs
  35.   or backup programs. There are other HOWTOs that address these
  36.   problems. Please see the Linux HOWTO Index for current information on
  37.   Linux HOWTOs. There are instructions for obtaining HOWTO documents in
  38.   the index, too.
  39.  
  40.   For instructions and considerations regarding disks with more that
  41.   1024 cylinders, see "Linux Large Disk mini-HOWTO", Andries Brouwer
  42.   <aeb@cwi.nl>.
  43.  
  44.   For instructions on disk spanning and striping, see "Linux Multiple
  45.   Disks Layout mini-HOWTO", by Gjoen Stein <gjoen@nyx.net>.
  46.  
  47.   For instructions on limiting disk space usage per user (quotas), see
  48.   "Linux Quota mini-HOWTO", by Albert M.C. Tam <bertie@scn.org>
  49.  
  50.   Currently, there is no general document on disk backup, but there are
  51.   several documents with pointers to specific backup solutions. See
  52.   "Linux ADSM Backup mini-HOWTO", by Thomas Koenig
  53.   <Thomas.Koenig@ciw.uni-karlsruhe.de> for instructions on integrating
  54.   Linux into an IBM ADSM backup environment. See "Linux Backup with
  55.   MSDOS mini-HOWTO", by Christopher Neufeld
  56.   <neufeld@physics.utoronto.ca> for information about MS-DOS driven
  57.   Linux backups.
  58.  
  59.   For instructions on writing and submitting a HOWTO document, see the
  60.   Linux HOWTO Index, by Greg Hankins <gregh@sunsite.unc.edu>.
  61.  
  62.   Browsing through /usr/src/linux/Documentation can be very instructive,
  63.   too. See ide.txt and scsi.txt for some background information on the
  64.   properties of your disk drivers and have a look at the filesystems/
  65.   subdirectory.
  66.  
  67.   2.  What is a partition anyway?
  68.  
  69.   When PC hard disks were invented people soon wanted to install
  70.   multiple operating systems, even if their system had only one disk.
  71.   So a mechanism was needed to divide a single physical disk into
  72.   multiple logical disks. So that's what a partition is: A contiguous
  73.   section of blocks on your hard disk that is treated like a completely
  74.   seperate disk by most operating systems.
  75.  
  76.   It is fairly clear that partitions must not overlap: An operating
  77.   system will certainly not be pleased, if another operating system
  78.   installed on the same machine were overwriting important information
  79.   because of overlapping partitions. There should be no gap between
  80.   adjacent partitions, too. While this constellation is not harmful, you
  81.   are wasting precious disk space by leaving space between partitions.
  82.  
  83.   A disk need not be partitioned completely. You may decide to leave
  84.   some space at the end of your disk that is not assigned to any of your
  85.   installed operating systems, yet. Later, when it is clear which
  86.   installation is used by you most of the time, you can partition this
  87.   left over space and put a file system on it.
  88.  
  89.   Partitions can not be moved nor can they be resized without destroying
  90.   the file system contained in it. So repartitioning usually involves
  91.   backup and restore of all file systems touched during the
  92.   repartitioning.  In fact it is fairly common to mess up things
  93.   completely during repartitioning, so you should back up anything on
  94.   any disk on that particular machine before even touching things like
  95.   fdisk.
  96.  
  97.   Well, some partitions with certain file system types on them actually
  98.   can be split in two without losing any data (if you are lucky). For
  99.   example there is a program called "fips" for splitting MS-DOS
  100.   partitions into two to make room for a Linux installation without
  101.   having to reinstall MS-DOS. You are still not going to touch these
  102.   things without carefully backing up everything on that machine, aren't
  103.   you?
  104.  
  105.   2.1.  Backups are important
  106.  
  107.   Tapes are your friend for backups. They are fast, reliable and easy to
  108.   use, so you can make backups often, preferably automatically and
  109.   without hassle.
  110.  
  111.   Step on soapbox: And I am talking about real tapes, not that disk
  112.   controller driven ftape crap. Consider buying SCSI: Linux does support
  113.   SCSI natively. You don't need to load ASPI drivers, you are not losing
  114.   precious HMA under Linux and once the SCSI host adapter is installed,
  115.   you just attach additional disks, tapes and CD-ROMs to it. No more I/O
  116.   addresses, IRQ juggling or Master/Slave and PIO-level matching.
  117.  
  118.   Plus: Proper SCSI host adapters give you high I/O performance without
  119.   much CPU load. Even under heavy disk activity you will experience good
  120.   response times. If you are planning to use a Linux system as a major
  121.   USENET news feed or if you are about to enter the ISP business, don't
  122.   even think about deploying a system without SCSI. Climb of soapbox.
  123.   2.2.  Device numbers and device names
  124.  
  125.   The number of partitions on an Intel based system was limited from the
  126.   very beginning: The original partition table was installed as part of
  127.   the boot sector and held space for only four partition entries.  These
  128.   partitions are now called primary partitions. When it became clear
  129.   that people needed more partitions on their systems, logical
  130.   partitions were invented.  The number of logical partitions is not
  131.   limited: Each logical partition contains a pointer to the next logical
  132.   partition, so you can have a potentially unlimited chain of partition
  133.   entries.
  134.  
  135.   For compatibility reasons, the space occupied by all logical
  136.   partitions had to be accounted for. If you are using logical
  137.   partitions, one primary partition entry is marked as "extended
  138.   partition" and its starting and ending block mark the area occupied by
  139.   your logical partitions. This implies that the space assigned to all
  140.   logical partitions has to be contiguous.
  141.  
  142.   Linux cannot handle more than a limited number of partitions per
  143.   drive. So in Linux you have 4 primary partitions (3 of them useable,
  144.   if you are using logical partitions) and at most 15 partitions
  145.   altogether on an SCSI disk (63 altogether on an IDE disk).
  146.  
  147.   In Linux, partitions are represented by device files. A device file is
  148.   a file with type c (for "character" devices, devices that do not use
  149.   the buffer cache) or b (for "block" devices, which go through the
  150.   buffer cache). In Linux, all disks are represented as block devices
  151.   only. Unlike other Unices, Linux does not offer "raw" character
  152.   versions of disks and their partitions.
  153.  
  154.   The only important thing with a device file are its major and minor
  155.   device number, shown instead of the files size:
  156.  
  157.        ______________________________________________________________________
  158.        $ ls -l /dev/hda
  159.        brw-rw----   1 root     disk       3,   0 Jul 18  1994 /dev/hda
  160.                                           ^    ^
  161.                                           |    minor device number
  162.                                           major device number
  163.        ______________________________________________________________________
  164.  
  165.   When accessing a device file, the major number selects which device
  166.   driver is being called to perform the input/output operation. This
  167.   call is being done with the minor number as a parameter and it is
  168.   entirely up to the driver how the minor number is being interpreted.
  169.   The driver documentation usually describes how the driver uses minor
  170.   numbers. For IDE disks, this documentation is in
  171.   /usr/src/linux/Documentation/ide.txt.  For SCSI disks, one would
  172.   exspect such documentation in /usr/src/linux/Documentation/scsi.txt,
  173.   but it isn't there. One has to look at the driver source to be sure
  174.   (/usr/src/linux/driver/scsi/sd.c:184-196). Fortunately, there is Peter
  175.   Anvin's list of device numbers and names in
  176.   /usr/src/linux/Documentation/devices.txt; see the entries for block
  177.   devices, major 3, 22, 33, 34 for IDE and major 8 for SCSI disks. The
  178.   major and minor numbers are a byte each and that is why the number of
  179.   partitions per disk is limited.
  180.  
  181.   By convention device files have certain names and many system programs
  182.   have knowledge about these names compiled in. They exspect your IDE
  183.   disks to be named /dev/hd* and your SCSI disks to be named /dev/sd*.
  184.   Disks are numbered a, b, c and so on, so /dev/hda is your first IDE
  185.   disk and /dev/sda is your first SCSI disk. Both devices represent
  186.   entire disks, starting at block one.  Writing to these devices with
  187.   the wrong tools will destroy the master boot loader and partition
  188.   table on these disks, rendering all data on this disk unusable or
  189.   making your system unbootable. Know what you are doing and, again,
  190.   back up before you do it.
  191.  
  192.   Primary partitions on a disk are 1, 2, 3 and 4. So /dev/hda1 is the
  193.   first primary partition on the first IDE disk and so on.  Logical
  194.   partitions have numbers 5 and up, so /dev/sdb5 is the first logical
  195.   partition on the second SCSI disk.
  196.  
  197.   Each partition entry has a starting and an ending block address
  198.   assigned to it and a type. The type is a numerical code (a byte) which
  199.   designates a particular partition to a certain type of operating
  200.   system. For the benefit of computing consultants partition type codes
  201.   are not really unique, so there is always the probability of two
  202.   operating systems using the same type code.
  203.  
  204.   Linux reserves the type code 0x82 for swap partitions and 0x83 for
  205.   "native" file systems (that's ext2 for almost all of you).  The once
  206.   popular, now outdated Linux/Minix file system used the type code 0x81
  207.   for partitions. OS/2 marks it's partitions with a 0x07 type and so
  208.   does Windows NT's NTFS. MS-DOS allocates several type codes for its
  209.   various flavors of FAT file systems: 0x01, 0x04 and 0x06 are known.
  210.   DR-DOS used 0x81 to indicate proteced FAT partitions, creating a type
  211.   clash with Linux/Minix at that time, but neither Linux/Minix nor DR-
  212.   DOS are widely used any more. The extended partition which is used as
  213.   a container for logical partitions has a type of 0x05, by the way.
  214.  
  215.   Partitions are created and deleted with the fdisk program.  Every self
  216.   respecting operating system program comes with an fdisk and
  217.   traditionally it is even called fdisk (or FDISK.EXE) in almost all
  218.   OSes. Some fdisks, noteable the DOS one, are somehow limited when they
  219.   have to deal with other operating systems partitions. Such limitations
  220.   include the complete inability to deal with anything with a foreign
  221.   type code, the inability to deal with cylinder numbers above 1024 and
  222.   the inability to create or even understand partitions that do not end
  223.   on a cylinder boundary. For example, the MS-DOS fdisk can't delete
  224.   NTFS partitions, the OS/2 fdisk has been known to silently "correct"
  225.   partitions created by the Linux fdisk that do not end on a cylinder
  226.   boundary and both, the DOS and the OS/2 fdisk, have had problems with
  227.   disks with more than 1024 cylinders (see the "large-disk" Mini-Howto
  228.   for details on such disks).
  229.  
  230.   3.  What Partitions do I need?
  231.  
  232.   3.1.  How many partitions do I need?
  233.  
  234.   Okay, so what partitions do you need? Well, some operating systems do
  235.   not believe into booting from logical partitions for reasons that are
  236.   beyond the scope of any sane mind. So you probably want to reserve
  237.   your primary partitions as boot partitions for your MS-DOS, OS/2 and
  238.   Linux or whatever you are using. Remember that one primary partition
  239.   is needed as an extended partition, which acts as a container for the
  240.   rest of your disk with logical partitions.
  241.  
  242.   Booting operating systems is a real-mode thing involving BIOSes and
  243.   1024 cylinder limitations. So you probably want to put all your boot
  244.   partitions into the first 1024 cylinders of your hard disk, just to
  245.   avoid problems. Again, read the "large-disk" Mini-Howto for the gory
  246.   details.
  247.   To install Linux, you will need at least one partition. If the kernel
  248.   is loaded from this partition (for example by LILO), this partition
  249.   must be readable by your BIOS. If you are using other means to load
  250.   your kernel (for example a boot disk or the LOADLIN.EXE MS-DOS based
  251.   Linux loader) the partition can be anywhere. In any case this
  252.   partition will be of type 0x83 "Linux native".
  253.  
  254.   Your system will need some swap space. Unless you swap to files you
  255.   will need a dedicated swap partition. Since this partition is only
  256.   accessed by the Linux kernel and the Linux kernel does not suffer from
  257.   PC BIOS deficiencies, the swap partition may be positioned anywhere.
  258.   I recommed using a logical partition for it (/dev/?d?5 and higher).
  259.   Dedicated Linux swap partitions are of type 0x82 "Linux swap".
  260.  
  261.   These are minimal partition requirements. It may be useful to create
  262.   more partitions for Linux. Read on.
  263.  
  264.   3.2.  How large should my swap space be?
  265.  
  266.   If you have decided to use a dedicated swap partition, which is
  267.   generally a Good Idea tm, follow these guidelines for estimating its
  268.   size:
  269.  
  270.   ╖  In Linux RAM and swap space add up (This is not true for all
  271.      Unices). For example, if you have 8 MB of RAM and 12 MB swap space,
  272.      you have a total of about 20 MB virtual memory.
  273.  
  274.   ╖  When sizing your swap space, you should have at least 16 MB of
  275.      total virtual memory. So for 4 MB of RAM consider at least 12 MB of
  276.      swap, for 8 MB of RAM consider at least 8 MB of swap.
  277.  
  278.   ╖  In Linux, a single swap partition can not be larger than 128 MB.
  279.      That is, the partition may be larger than 128 MB, but excess space
  280.      is never used. If you want more than 128 MB of swap, you have to
  281.      create multiple swap partitions.
  282.  
  283.   ╖  When sizing swap space, keep in mind that too much swap space may
  284.      not be useful at all.
  285.  
  286.      Every process has a "working set". This is a set of in-memory pages
  287.      which will be referenced by the processor in the very near future.
  288.      Linux tries to predict these memory accesses (assuming that
  289.      recently used pages will be used again in the near future) and
  290.      keeps these pages in RAM if possible. If the program has a good
  291.      "locality of reference" this assumption will be true and prediction
  292.      algorithm will work.
  293.  
  294.      Holding a working set in main memory does only work if there is
  295.      enough main memory. If you have too many processes running on a
  296.      machine, the kernel is forced to put pages on disk that it will
  297.      reference again in the very near future (forcing a page-out of a
  298.      page from another working set and then a page-in of the page
  299.      referenced). Usually this results in a very heavy increase in
  300.      paging activity and in a sustantial drop of performance. A machine
  301.      in this state is said to be "thrashing" (For you german readers:
  302.      That's "thrashing" ("dreschen", "schlagen", "haemmern") and not
  303.      trashing ("muellen")).
  304.  
  305.      On a thrashing machine the processes are essentially running from
  306.      disk and not from RAM. Expect performance to drop by approximately
  307.      the ratio between memory access speed and disk access speed.
  308.  
  309.      A very old rule of thumb in the days of the PDP and the Vax was
  310.      that the size of the working set of a program is about 25% of its
  311.      virtual size. Thus it is probably useless to provide more swap than
  312.      three times your RAM.
  313.  
  314.      But keep in mind that this is just a rule of thumb. It is easily
  315.      possible to create scenarios where programs have extremely large or
  316.      extremely small working sets. For example, a simulation program
  317.      with a large data set that is accessed in a very random fashion
  318.      would have almost no noticeable locality of reference in its data
  319.      segment, so its working set would be quite large.
  320.  
  321.      On the other hand, an xv with many simultaneously opened JPEGs, all
  322.      but one iconified, would have a very large data segment. But image
  323.      transformations are all done on one single image, most of the
  324.      memory occupied by xv is never touched.  The same is true for an
  325.      editor with many editor windows where only one window is being
  326.      modified at a time.  These programs have - if they are designed
  327.      properly - a very high locality of reference and large parts of
  328.      them can be kept swapped out without too severe performance impact.
  329.  
  330.      One could suspect that the 25% number from the age of the command
  331.      line is no longer true for modern GUI programs editing multiple
  332.      documents, but I know of no newer papers that try to verify these
  333.      numbers.
  334.  
  335.   So for a configuration with 16 MB RAM, no swap is needed for a minimal
  336.   configuration and more than 48 MB of swap are probably useless. The
  337.   exact amount of memory needed depends on the application mix on the
  338.   machine (what did you expect?).
  339.  
  340.   3.3.  Where should I put my swap space?
  341.  
  342.   ╖  Mechanics are slow, electronics are fast.
  343.  
  344.      Modern hard disks have many heads. Switching between heads of the
  345.      same track is fast, since it is purely electronic.  Switching
  346.      between tracks is slow, since it involves moving real world matter.
  347.  
  348.      So if you have a disk with many heads and one with less heads and
  349.      both are identical in other parameters, the disk with many heads
  350.      will be faster.
  351.  
  352.      Splitting swap and putting it on both disks will be even faster,
  353.      though.
  354.  
  355.   ╖  Older disks have the same number of sectors on all tracks.  With
  356.      this disks it will be fastest to put your swap in the middle of the
  357.      disks, assuming that your disk head will move from a random track
  358.      towards the swap area.
  359.  
  360.   ╖  Newer disks use ZBR (zone bit recording). They have more sectors on
  361.      the outer tracks. With a constant number of rpms, this yields a far
  362.      greater performance on the outer tracks than on the inner ones. Put
  363.      your swap on the fast tracks.
  364.  
  365.   ╖  Of course your disk head will not move randomly. If you have swap
  366.      space in the middle of a disk between a constantly busy home
  367.      partition and an almost unused archive partition, you would be
  368.      better of if your swap were in the middle of the home partition for
  369.      even shorter head movements. You would be even better off, if you
  370.      had your swap on another otherwise unused disk, though.
  371.  
  372.   Summary: Put your swap on a fast disk with many heads that is not busy
  373.   doing other things. If you have multiple disks: Split swap and scatter
  374.   it over all your disks or even different controllers.
  375.  
  376.   Even better: Buy more RAM.
  377.  
  378.   3.4.  Some facts about file systems and fragmentation
  379.  
  380.   Disk space is administered by the operating system in units of blocks
  381.   and fragments of blocks. In ext2, fragments and blocks have to be of
  382.   the same size, so we can limit our discussion to blocks.
  383.  
  384.   Files come in any size. They don't end on block boundaries.  So with
  385.   every file a part of the last block of every file is wasted. Assuming
  386.   that file sizes are random, there is approximately a half block of
  387.   waste for each file on your disk.  Tanenbaum calls this "internal
  388.   fragmentation" in his book "Operating Systems".
  389.  
  390.   You can guess the number of files on your disk by the number of
  391.   allocated inodes on a disk. On my disk
  392.  
  393.        ______________________________________________________________________
  394.        # df -i
  395.        Filesystem           Inodes   IUsed   IFree  %IUsed Mounted on
  396.        /dev/hda3              64256   12234   52022    19%  /
  397.        /dev/hda5              96000   43058   52942    45%  /var
  398.        ______________________________________________________________________
  399.  
  400.   there are about 12000 files on / and about 44000 files on /var.  At a
  401.   block size of 1 KB, about 6+22 = 28 MB of disk space are lost in the
  402.   tail blocks of files. Had I chosen a block size of 4 KB, I had lost 4
  403.   times this space.
  404.  
  405.   Data transfer is faster for large contiguous chunks of data, though.
  406.   That's why ext2 tries to preallocate space in units of 8 contigous
  407.   blocks for growing files. Unused preallocation is released when the
  408.   file is closed, so no space is wasted.
  409.  
  410.   Noncontiguous placement of blocks in a file is bad for performance,
  411.   since files are often accessed in a sequential manner. It forces the
  412.   operating system to split a disk access and the disk to move the head.
  413.   This is called "external fragmentation" or simply "fragmentation" and
  414.   is a common problem with DOS file systems.
  415.  
  416.   ext2 has several strategies to avoid external fragmentation.  Normally
  417.   fragmentation is not a large problem in ext2, not even on heavily used
  418.   partitions such as a USENET news spool. While there is a tool for
  419.   defragmentation of ext2 file systems, nobody ever uses it and it is
  420.   not up to date with the current release of ext2. Use it, but do so on
  421.   your own risk.
  422.  
  423.   The MS-DOS file system is well known for its pathological managment of
  424.   disk space. In conjunction with the abysmal buffer cache used by MS-
  425.   DOS the effects of file fragmentation on performance are very
  426.   noticeable. DOS users are accustomed to defragging their disks every
  427.   few weeks and some have even developed some ritualistic beliefs
  428.   regarding defragmentation.  None of these habits should be carried
  429.   over to Linux and ext2.  Linux native file systems do not need
  430.   defragmentation under normal use and this includes any condition with
  431.   at least 5% of free space on a disk.
  432.  
  433.   The MS-DOS file system is also known to lose large amounts of disk
  434.   space due to internal fragmentation. For partitions larger than 256
  435.   MB, DOS block sizes grow so large that they are no longer useful (This
  436.   has been corrected to some extent with FAT32).
  437.  
  438.   ext2 does not force you to choose large blocks for large file systems,
  439.   except for very large file systems in the 0.5 TB range and above,
  440.   where small block sizes become inefficient. So unlike DOS there is no
  441.   need to split up large disks into multiple partitions to keep block
  442.   size down. Use the 1 KB default block size if possible. You may want
  443.   to experiment with a block size of 2 KB for some partitions, but
  444.   expect to meet some seldom exercised bugs: Most people use the
  445.   default.
  446.  
  447.   3.5.  File lifetimes and backup cycles as partitioning criteria
  448.  
  449.   With ext2, Partitioning decisions should be governed by backup
  450.   considerations and to avoid external fragmentation from different file
  451.   lifetimes.
  452.  
  453.   Files have lifetimes. After a file has been created, it will remain
  454.   some time on the system and them be removed. File lifetime varies
  455.   greatly throughout the system and is partly dependend on the pathname
  456.   of the file. For example, files in /bin, /sbin, /usr/sbin, /usr/bin
  457.   and similar directories are likely to have a very long lifetime: many
  458.   months and above.  Files in /home are likely to have a medium
  459.   lifetime: several weeks or so. File in /var are usually short lived:
  460.   Almost no file in /var/spool/news will remain longer than a few days,
  461.   files in /var/spool/lpd measure their lifetime in minutes or less.
  462.  
  463.   For backup it is useful if the amount of daily backup is smaller than
  464.   the capacity of a single backup medium. A daily backup can be a
  465.   complete backup or an incremental backup.
  466.  
  467.   You can decide to keep your partition sizes small enough that they fit
  468.   completely onto one backup medium (choose daily full backups). In any
  469.   case a partition should be small enough that its daily delta (all
  470.   modified files) fits onto one backup medium (choose incremental backup
  471.   and exspect to change backup media for the weekly/monthly full dump -
  472.   no unattended operation possible).
  473.  
  474.   Your backup strategy depends on that decision.
  475.  
  476.   When planning and buying disk space, remember to set aside a
  477.   sufficient amount of money for backup! Unbackuped data is worthless!
  478.   Data reproduction costs are much higher than backup costs for
  479.   virtually everyone!
  480.  
  481.   For performance it is useful to keep files of different lifetimes on
  482.   different partitions. This way the short lived files on the news
  483.   partition may be fragmented very heavily.  This has no impact on the
  484.   performance of the / or /home partition.
  485.  
  486.   4.  An example
  487.  
  488.   4.1.  A recommended model for ambitious beginners
  489.  
  490.   A common model creates /, /home and /var partitions as discussed
  491.   above. This is simple to install and maintain and differentiates well
  492.   enough to avoid adverse effects from different lifetimes. It fits well
  493.   into a backup model, too: Almost noone bothers to backup USENET news
  494.   spools and only some files in /var are worth backing up
  495.   (/var/spool/mail comes to mind). On the other hand, / changes
  496.   infrequently and can be backup up on demand (after configuration
  497.   changes) and is small enough to fit on most modern backup media as a
  498.   full backup (plan 250 to 500 MB depending on the amount of installed
  499.   software). /home contains valuable user data and should be backuped up
  500.   daily. Some installations have very large /homes and must use
  501.   incremental backups.
  502.  
  503.   Some systems put /tmp onto a seperate partition as well, others
  504.   symlink it to /var/tmp to achieve the same effect (note that this can
  505.   affect single user mode, where /var will be unavailable and the system
  506.   will have no /tmp until you create one or mount /var manually) or put
  507.   it onto a RAM disk (Solaris does this for example). This keeps /tmp
  508.   out of /, a good idea.
  509.  
  510.   This model is convenient for upgrades or reinstallations as well: Save
  511.   your configuration files (or the entire /etc) to some /home directory,
  512.   scrap your /, reinstall and fetch the old configurations from the save
  513.   directory on /home.
  514.  
  515.   5.  How I did it on my machine
  516.  
  517.   There was this old ISA bus 386/40 sitting on my shelf that I abandoned
  518.   two years ago because it no longer cut it. I was planning to turn it
  519.   into a small X-less server for my household LAN.
  520.  
  521.   Here is how I did it: I took that 386 and put 16 MB RAM into it.
  522.   Added a cheapo EIDE disk, the smallest I could get (800 MB) and an
  523.   ethernet card. Added an old Hercules because I still had a monitor for
  524.   it. Installed Linux on it and there I have my local NFS, SMB, HTTP,
  525.   LPD/LPR and NNTP server as well as my mail router and POP3 server.
  526.   With an additional ISDN card the machine become my TCP/IP router and
  527.   firewall, too.
  528.  
  529.   Most of the disk space on this machine went into the /var directories,
  530.   /var/spool/mail, /var/spool/news and /var/httpd/html. I put /var on a
  531.   separate partition and made this one large. There will be almost no
  532.   users on this machine, so I created no home partition and mounted
  533.   /home from some other workstation via NFS.
  534.  
  535.   Linux without X plus several locally installed utilities will be fine
  536.   with a 250 MB partition as /. The machine has 16 MB of RAM, but it
  537.   will be running many servers. 16 MB swap should be in order, 32 MB
  538.   should be plenty. We are not short on disk space, so the machine will
  539.   get 32 MB.  Out of sentimentality a MS-DOS partition of some 20 MB is
  540.   kept on it.  I decided to import /home from another machine, so the
  541.   remaining 500+ MB will end up as /var. This is more than sufficient
  542.   for a household USENET news feed.
  543.  
  544.   We get
  545.  
  546.   ______________________________________________________________________
  547.   Device     Mounted on                      Size
  548.   /dev/hda1  /dos_c                           25 MB
  549.   /dev/hda2  - (Swapspace)                    32 MB
  550.   /dev/hda3  /                               250 MB
  551.   /dev/hda4  - (Extended Container)          500 MB
  552.   /dev/hda5  /var                            500 MB
  553.  
  554.   homeserver:/home /home                     1.6 GB
  555.   ______________________________________________________________________
  556.  
  557.   I am backing up this machine via the network using the tape in
  558.   homeserver. Since everything on this machine has been installed from
  559.   CD-ROM all I have to save are some configuration files from /etc, my
  560.   customized locally installed *.tgz files from /root/Source/Installed
  561.   and /var/spool/mail as well as /var/httpd/html.  I copy these files
  562.   into a dedicated directory /home/backmeup on homeserver every night,
  563.   where the regular homeserver backup picks them up.
  564.  
  565.