home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 11 / IOPROG_11.ISO / docs / disk-h~1 < prev    next >
Encoding:
Text File  |  1997-09-02  |  139.0 KB  |  3,074 lines

  1.   Linux Disk HOWTO
  2.   Stein Gjoen, sgjoen@nyx.net
  3.   v0.13c, 12 August 1997
  4.  
  5.   This document describes how best to use multiple disks and partitions
  6.   for a Linux system. Although some of this text is Linux specific the
  7.   general approach outlined here can be applied to many other multi
  8.   tasking operating systems.
  9.  
  10.   1.  Introduction
  11.  
  12.   In commemoration of the "Linux Hacker V2.0 - The New Generation" this
  13.   brand new release is code named the Patricia Miranda release.  After
  14.   all, this is a growing project... New code names will appear as per
  15.   industry standard guidelines to emphasize the state-of-the-art-ness of
  16.   this document.
  17.  
  18.   This document was written for two reasons, mainly because I got hold
  19.   of 3 old SCSI disks to set up my Linux system on and I was pondering
  20.   how best to utilise the inherent possibilities of parallelizing in a
  21.   SCSI system. Secondly I hear there is a prize for people who write
  22.   documents...
  23.  
  24.   This is intended to be read in conjunction with the Linux Filesystem
  25.   Structure Standard (FSSTND). It does not in any way replace it but
  26.   tries to suggest where physically to place directories detailed in the
  27.   FSSTND, in terms of drives, partitions, types, RAID, file system (fs),
  28.   physical sizes and other parameters that should be considered and
  29.   tuned in a Linux system, ranging from single home systems to large
  30.   servers on the Internet.
  31.  
  32.   Even though it is now more than a year since last release of the
  33.   FSSTND work is still continuing, under a new name, and will encompass
  34.   more than Linux, fill in a few blanks hinted at in FSSTND version 1.2
  35.   as well as other general improvements. The development mailing list is
  36.   currently private but a general release is hopefully in the near
  37.   future. The new issue will be named Filesystem Hierarchy Standard
  38.   (FHS) and will cover more than Linux alone.
  39.  
  40.   It is also a good idea to read the Linux Installation guides
  41.   thoroughly and if you are using a PC system, which I guess the
  42.   majority still does, you can find much relevant and useful information
  43.   in the FAQs for the newsgroup comp.sys.ibm.pc.hardware especially for
  44.   storage media.
  45.  
  46.   This is also a learning experience for myself and I hope I can start
  47.   the ball rolling with this Mini-HOWTO and that it perhaps can evolve
  48.   into a larger more detailed and hopefully even more correct HOWTO.
  49.  
  50.   First of all we need a bit of legalese. Recent development shows it is
  51.   quite important.
  52.  
  53.   1.1.  Copyright
  54.  
  55.   This HOWTO is copyrighted 1996 Stein Gjoen.
  56.  
  57.   Unless otherwise stated, Linux HOWTO documents are copyrighted by
  58.   their respective authors. Linux HOWTO documents may be reproduced and
  59.   distributed in whole or in part, in any medium physical or electronic,
  60.   as long as this copyright notice is retained on all copies. Commercial
  61.   redistribution is allowed and encouraged; however, the author would
  62.   like to be notified of any such distributions.
  63.   All translations, derivative works, or aggregate works incorporating
  64.   any Linux HOWTO documents must be covered under this copyright notice.
  65.   That is, you may not produce a derivative work from a HOWTO and impose
  66.   additional restrictions on its distribution. Exceptions to these rules
  67.   may be granted under certain conditions; please contact the Linux
  68.   HOWTO coordinator at the address given below.
  69.  
  70.   In short, we wish to promote dissemination of this information through
  71.   as many channels as possible. However, we do wish to retain copyright
  72.   on the HOWTO documents, and would like to be notified of any plans to
  73.   redistribute the HOWTOs.
  74.  
  75.   If you have questions, please contact Greg Hankins, the Linux HOWTO
  76.   coordinator, at gregh@sunsite.unc.edu via email.
  77.  
  78.   1.2.  Disclaimer
  79.  
  80.   Use the information in this document at your own risk. I disavow any
  81.   potential liability for the contents of this document. Use of the
  82.   concepts, examples, and/or other content of this document is entirely
  83.   at your own risk.
  84.  
  85.   All copyrights are owned by their owners, unless specifically noted
  86.   otherwise.  Use of a term in this document should not be regarded as
  87.   affecting the validity of any trademark or service mark.
  88.  
  89.   You are strongly recommended to take a backup of your system before
  90.   major installation and backups at regular intervals.
  91.  
  92.   1.3.  News
  93.  
  94.   Since the 0.12 version was released there have been too many changes
  95.   to list here. The document has grown a lot, actually beyond
  96.   expectations.  There are many new chapters, old sections expanded into
  97.   separate chapters and many other improvements.
  98.  
  99.   I have also upgraded my system to Debian 1.2.6 and have replaced the
  100.   old Slackware values with the Debian values for disk space
  101.   requirements for the various directory. I will use Debian as a base
  102.   for discussions and examples here, though the HOWTO is equally
  103.   applicable to other distributions, even other operating systems. At
  104.   the time of writing this Debian 1.3 is out in beta and will soon be
  105.   used as the test bench for further versions of this document.
  106.  
  107.   More news: there has been a fair bit of interest in new kinds of file
  108.   systems in the comp.os.linux newsgroups, in particular logging,
  109.   journaling and inherited file systems. Watch out for updates. Projects
  110.   on volume management is also under way. The old defragmentation
  111.   program for ext2fs is being updated and there is continuing interests
  112.   for compression.
  113.  
  114.   The latest version number of this document can be gleaned from my plan
  115.   entry if you do "finger sgjoen@nox.nyx.net"
  116.  
  117.   Also, the latest version will be available on my web space on nyx: The
  118.   Multiple Disk System Tuning mini-HOWTO Homepage
  119.   <http://www.nyx.net/~sgjoen/disk.html>.
  120.  
  121.   A text-only version as well as the SGML source can also be downloaded
  122.   there.  A nicely formatted postscript version is also available now.
  123.  
  124.   Also planned is a series of URLs to helpful software referred to in
  125.   this document. A mirror in Europe will be announced soon.
  126.  
  127.   1.4.  Credits
  128.  
  129.   In this version I have the pleasure of acknowledging even more people
  130.   who have contributed in one way or another:
  131.  
  132.        ronnej@ucs.orst.edu
  133.        cm@kukuruz.ping.at
  134.        armbru@pond.sub.org
  135.        R.P.Blake@open.ac.uk
  136.        neuffer@goofy.zdv.Uni-Mainz.de
  137.        sjmudd@redestb.es
  138.        nat@nataa.fr.eu.org
  139.        sundbyk@horten.geco-prakla.slb.com
  140.        gjoen@sn.no
  141.        mike@i-Connect.Net
  142.        roth@uiuc.edu
  143.        phall@ilap.com
  144.        szaka@mirror.cc.u-szeged.hu
  145.        CMckeon@swcp.com
  146.  
  147.   Special thanks go to nakano@apm.seikei.ac.jp for doing the Japanese
  148.   translation, general contributions as well as contributing an example
  149.   of a computer in an academic setting, which is included at the end of
  150.   this document.
  151.  
  152.   Not many still, so please read through this document, make a
  153.   contribution and join the elite. If I have forgotten anyone, please
  154.   let me know.
  155.  
  156.   New in this version is an appendix with a few tables you can fill in
  157.   for your system in order to simplify the design process.
  158.  
  159.   Any comments or suggestions can be mailed to my mail address on nyx:
  160.   sgjoen@nyx.net.
  161.  
  162.   So let's cut to the chase where swap and /tmp are racing along hard
  163.   drive...
  164.  
  165.   2.  Structure
  166.  
  167.   As this type of document is supposed to be as much for learning as a
  168.   technical reference document I have rearranged the structure to this
  169.   end. For the designer of a system it is more useful to have the
  170.   information presented in terms of the goals of this exercise than from
  171.   the point of view of the logical layer structure of the devices
  172.   themselves. Nevertheless this document would not be complete without
  173.   such a layer structure the computer field is so full of, so I will
  174.   include it here as an introduction to how it works.
  175.  
  176.   It is a long time since the mini in mini-HOWTO could be defended as
  177.   proper but I am convinced that this document is as long as it needs to
  178.   be in order to make the right design decisions, and not longer.
  179.  
  180.   2.1.  Logical structure
  181.  
  182.   This is based on how each layer access each other, traditionally with
  183.   the application on top and the physical layer on the bottom.  It is
  184.   quite useful to show the interrelationship between each of the layers
  185.   used in controlling drives.
  186.  
  187.                ___________________________________________________________
  188.                |__     File structure          ( /usr /tmp etc)        __|
  189.                |__     File system             (ext2fs, vfat etc)      __|
  190.                |__     Volume management       (AFS)                   __|
  191.                |__     RAID, concatenation     (md)                    __|
  192.                |__     Device driver           (SCSI, IDE etc)         __|
  193.                |__     Controller              (chip, card)            __|
  194.                |__     Connection              (cable, network)        __|
  195.                |__     Drive                   (magnetic, optical etc) __|
  196.                -----------------------------------------------------------
  197.  
  198.   In the above diagram both volume management and RAID and concatenation
  199.   are optional layers. The 3 lower layers are in hardware.  All parts
  200.   are discussed at length later on in this document.
  201.  
  202.   2.2.  Document structure
  203.  
  204.   Most users start out with a given set of hardware and some plans on
  205.   what they wish to achieve and how big the system should be. This is
  206.   the point of view I will adopt in this document in presenting the
  207.   material, starting out with hardware, continuing with design
  208.   constraints before detailing the design strategy that I have found to
  209.   work well.  I have used this both for my own personal computer at
  210.   home, a multi purpose server at work and found it worked quite well.
  211.   In addition my Japanese co-worker in this project have applied the
  212.   same strategy on a server in an academic setting with similar success.
  213.  
  214.   Finally at the end I have detailed some configuration tables for use
  215.   in your own design. If you have any comments regarding this or notes
  216.   from your own design work I would like to hear from you so this
  217.   document can be upgraded.
  218.  
  219.   3.  Drive technologies
  220.  
  221.   A far more complete discussion on drive technologies for IBM PCs can
  222.   be found at the home page of The Enhanced IDE/Fast-ATA FAQ
  223.   <http://thef-nym.sci.kun.nl/~pieterh/storage.html> which is also
  224.   regularly posted on Usenet News.  Here I will just present what is
  225.   needed to get an understanding of the technology and get you started
  226.   on your setup.
  227.  
  228.   3.1.  Drives
  229.  
  230.   This is the physical device where your data lives and although the
  231.   operating system makes the various types seem rather similar they can
  232.   in actual fact be very different. An understanding of how it works can
  233.   be very useful in your design work. Floppy drives fall outside the
  234.   scope of this document, though should there be a big demand I could
  235.   perhaps be persuaded to add a little here.
  236.  
  237.   3.2.  Geometry
  238.  
  239.   Physically disk drives consists of one or more platters containing
  240.   data that is read in and out using sensors mounted on movable heads
  241.   that are fixed with respects to themselves. Data transfers therefore
  242.   happens across all surfaces simultaneously which defines a cylinder of
  243.   tracks. The drive is also divided into sectors containing a number of
  244.   data fields.
  245.  
  246.   Drives are therefore often specified in terms of its geometry: the
  247.   number of Cylinders, Heads and Sectors (CHS).
  248.  
  249.   For various reasons there is now a number of translations between
  250.  
  251.   ╖  the physical CHS of the drive itself
  252.  
  253.   ╖  the logical CHS the drive reports to the BIOS or OS
  254.  
  255.   ╖  the logical CHS used by the OS
  256.  
  257.   Basically it is a mess and a source of much confusion. For more
  258.   information you are strongly recommended to read the Large Disk mini-
  259.   HOWTO
  260.  
  261.   3.3.  Media
  262.  
  263.   The media technology determines important parameters such as
  264.   read/write rates, seek times, storage size as well as if it is
  265.   read/write or read only.
  266.  
  267.   3.3.1.  Magnetic Drives
  268.  
  269.   This is the typical read-write mass storage medium, and as everything
  270.   else in the computer world, comes in many flavours with different
  271.   properties. Usually this is the fastest technology and offers
  272.   read/write capability. The platter rotates with a constant angular
  273.   velocity (CAV) with a variable physical sector density for more
  274.   efficient magnetic media area utilisation.  In other words, the number
  275.   of bits per unit length is kept roughly constant by increasing the
  276.   number of logical sectors for the outer tracks.
  277.  
  278.   Typical values for rotational speeds are 4500 and 5400 rpm, though
  279.   7200 is also used. Very recently also 10000 rpm has entered the mass
  280.   market.  Seek times are around 10ms, transfer rates quite variable
  281.   from one type to another but typically 4-40 MB/s.  With the extreme
  282.   high performance drives you should remember that performance costs
  283.   more electric power which is dissipated as heat, see the point on
  284.   ``Power and Heating''.
  285.  
  286.   Note that there are several kinds of transfers going on here, and that
  287.   these are quoted in different units. First of all there is the
  288.   platter-to-drive cache transfer, usually quoted in Mbits/s. Typical
  289.   values here is about 50-250 Mbits/s. The second stage is from the
  290.   built in drive cache to the adapter, and this is typically quoted in
  291.   MB/s, and typical quoted values here is 3-40 MB/s. Note, however, that
  292.   this assumed data is already in the cache and hence for maximum
  293.   readout speed from the drive the effective transfer rate will decrease
  294.   dramatically.
  295.  
  296.   Drives are usually described by the geometry or drive parameters which
  297.   is the number of heads, sectors and cylinders, which is confused by
  298.   translation schemes between physical and various logical geometries.
  299.   This is a mine field which is described in painful details in many
  300.   storage related FAQs. Read and weep.
  301.  
  302.   3.3.2.  Optical drives
  303.  
  304.   Optical read/write drives exist but are slow and not so common. They
  305.   were used in the NeXT machine but the low speed was a source for much
  306.   of the complaints. The low speed is mainly due to the thermal nature
  307.   of the phase change that represents the data storage. Even when using
  308.   relatively powerful lasers to induce the phase changes the effects are
  309.   still slower than the magnetic effect used in magnetic drives.
  310.  
  311.   Today many people use CD-ROM drives which, as the name suggests, is
  312.   read-only. Storage is about 650MB, transfer speeds are variable,
  313.   depending on the drive but can exceed 1.5MB/s. Data is stored on a
  314.   spiraling single track so it is not useful to talk about geometry for
  315.   this. Data density is constant so the drive uses constant linear
  316.   velocity (CLV). Seek is also slower, about 100ms, partially due to the
  317.   spiraling track. Recent, high speed drives, use a mix of CLV and CAV
  318.   in order to maximize performance. This also reduces access time caused
  319.   by the need to reach correct rotational speed for readout.
  320.  
  321.   A new type (DVD) is on the horizon, offering up to about 18GB on a
  322.   single disk.
  323.  
  324.   3.3.3.  Solid State Drives
  325.  
  326.   This is a relatively recent addition to the available technology and
  327.   has been made popular especially in portable computers as well as in
  328.   embedded systems. Containing no movable parts they are very fast both
  329.   in terms of access and transfer rates. The most popular type is flash
  330.   RAM, but also other types of RAM is used. A few years ago many had
  331.   great hopes for magnetic bubble memories but it turned out to be
  332.   relatively expensive and is not that common.
  333.  
  334.   In general the use of RAM disks are regarded as a bad idea as it is
  335.   normally more sensible to add more RAM to the motherboard and let the
  336.   operating system divide the memory pool into buffers, cache, program
  337.   and data areas. Only in very special cases, such as real time systems
  338.   with short time margins, can RAM disks be a sensible solution.
  339.  
  340.   Flash RAM is today available in several 10's of megabytes in storage
  341.   and one might be tempted to use it for fast, temporary storage in a
  342.   computer. There is however a huge snag with this: flash RAM has a
  343.   finite life time in terms of the number of times you can rewrite data,
  344.   so putting swap, /tmp or /var/tmp on such a device will certainly
  345.   shorten its lifetime dramatically.  Instead, using flash RAM for
  346.   directories that are read often but rarely written to, will be a big
  347.   performance win.
  348.  
  349.   In order to get the optimum life time out of flash RAM you will need
  350.   to use special drivers that will use the RAM evenly and minimize the
  351.   number of block erases.
  352.  
  353.   This example illustrates the advantages of splitting up your directory
  354.   structure over several devices.
  355.  
  356.   Solid state drives have no real cylinder/head/sector addressing but
  357.   for compatibility reasons this is simulated by the driver to give a
  358.   uniform interface to the operating system.
  359.  
  360.   3.4.  Interfaces
  361.  
  362.   There is a plethora of interfaces to chose from widely ranging in
  363.   price and performance. Most motherboards today include IDE interface
  364.   or better, Intel supports it through the Triton PCI chip set which is
  365.   very popular these days. Many motherboards also include a SCSI
  366.   interface chip made by NCR and that is connected directly to the PCI
  367.   bus.  Check what you have and what BIOS support you have with it.
  368.  
  369.   3.4.1.  MFM and RLL
  370.  
  371.   Once upon a time this was the established technology, a time when 20MB
  372.   was awesome, which compared to todays sizes makes you think that
  373.   dinosaurs roamed the Earth with these drives. Like the dinosaurs these
  374.   are outdated and are slow and unreliable compared to what we have
  375.   today. Linux does support this but you are well advised to think twice
  376.   about what you would put on this. One might argue that an emergency
  377.   partition with a suitable vintage of DOS might be fitting.
  378.  
  379.   3.4.2.  ESDI
  380.  
  381.   This technology became outdated almost before it got popular, so you
  382.   are unlikely to come across it these days. Basically it was an attempt
  383.   of increasing the upper limit of the old interfaces. You might get
  384.   such a drive to work under Linux if it is compatible with the ST506
  385.   standard.
  386.  
  387.   3.4.3.  IDE and ATA
  388.  
  389.   Progress made the drive electronics migrate from the ISA slot card
  390.   over to the drive itself and Integrated Drive Electronics was borne.
  391.   It was simple, cheap and reasonably fast so the BIOS designers
  392.   provided the kind of snag that the computer industry is so full of. A
  393.   combination of an IDE limitation of 16 heads together with the BIOS
  394.   limitation of 1024 cylinders gave us the infamous 504MB limit.
  395.   Following the computer industry traditions again, the snag was patched
  396.   with a kludge and we got all sorts of translation schemes and BIOS
  397.   bodges. This means that you need to read the installation
  398.   documentation very carefully and check up on what BIOS you have and
  399.   what date it has as the BIOS has to tell Linux what size drive you
  400.   have. Fortunately with Linux you can also tell the kernel directly
  401.   what size drive you have with the drive parameters, check the
  402.   documentation for LILO and Loadlin, thoroughly. Note also that IDE is
  403.   equivalent to ATA, AT Attachment.  IDE uses CPU-intensive Programmed
  404.   Input/Output (PIO) to transfer data to and from the drives and has no
  405.   capability for the more efficient Direct Memory Access (DMA)
  406.   technology. Highest transfer rate is 8.3MB/s.
  407.  
  408.   3.4.4.  EIDE, Fast-ATA and ATA-2
  409.  
  410.   These 3 terms are roughly equivalent, fast-ATA is ATA-2 but EIDE
  411.   additionally includes ATAPI. ATA-2 is what most use these days which
  412.   is faster and with DMA. Highest transfer rate is increased to 16.6
  413.   MB/s.
  414.  
  415.   3.4.5.  ATAPI
  416.  
  417.   The ATA Packet Interface was designed to support CD-ROM drives using
  418.   the IDE port and like IDE it is cheap and simple.
  419.  
  420.   3.4.6.  SCSI
  421.  
  422.   The Small Computer System Interface is a multi purpose interface that
  423.   can be used to connect to everything from drives, disk arrays,
  424.   printers, scanners and more. The name is a bit of a misnomer as it has
  425.   traditionally been used by the higher end of the market as well as in
  426.   work stations since it is well suited for multi tasking environments.
  427.  
  428.   The standard interface is 8 bits wide and can address 8 devices.
  429.   There is a wide version with 16 bit that is twice as fast on the same
  430.   clock and can address 16 devices. The host adapter always counts as a
  431.   device and is usually number 7.
  432.  
  433.   The old standard was 5MB/s and the newer fast-SCSI increased this to
  434.   10MB/s. Recently ultra-SCSI, also known as Fast-20, arrived with 20
  435.   MB/s transfer rates for an 8 bit wide bus.
  436.  
  437.   The higher performance comes at a cost that is usually higher than for
  438.   (E)IDE. The importance of correct termination and good quality cables
  439.   cannot be overemphasized. SCSI drives also often tend to be of a
  440.   higher quality than IDE drives. Also adding SCSI devices tend to be
  441.   easier than adding more IDE drives.
  442.  
  443.   There is a number of useful documents you should read if you use SCSI,
  444.   the SCSI HOWTO as well as the SCSI FAQ posted on Usenet News.
  445.  
  446.   SCSI also has the advantage you can connect it easily to tape drives
  447.   for backing up your data, as well as some printers and scanners. It is
  448.   even possible to use it as a very fast network between computers while
  449.   simultaneously share SCSI devices on the same bus. Work is under way
  450.   but due to problems with ensuring cache coherency between the
  451.   different computers connected, this is a non trivial task.
  452.  
  453.   3.5.  Cabling
  454.  
  455.   I do not intend to make too many comments on hardware but I feel I
  456.   should make a little note on cabling. This might seem like a
  457.   remarkably low technological piece of equipment, yet sadly it is the
  458.   source of many frustrating problems. At todays high speeds one should
  459.   think of the cable more of a an RF device with its inherent demands on
  460.   impedance matching. If you do not take your precautions you will get a
  461.   much reduced reliability or total failure. Some SCSI host adapters are
  462.   more sensitive to this than others.
  463.  
  464.   Shielded cables are of course better than unshielded but the price is
  465.   much higher. With a little care you can get good performance from a
  466.   cheap unshielded cable.
  467.  
  468.   ╖  Use as short cable as possible, but do not forget the 30cm minimum
  469.      separation for ultra SCSI.
  470.  
  471.   ╖  Avoid long stubs between the cable and the drive, connect the plug
  472.      on the cable directly to the drive without an extension.
  473.  
  474.   ╖  Use correct termination for SCSI devices and at the correct
  475.      position: the end of the SCSI chain.
  476.  
  477.   ╖  Do not mix shielded or unshielded cabling, do not wrap cables
  478.      around metal, try to avoid proximity to metal parts along parts of
  479.      the cabling. Any such discontinuities can cause impedance
  480.      mismatching which in turn can cause reflection of signals which
  481.      increases noise on the cable.
  482.  
  483.   3.6.  Host Adapters
  484.  
  485.   This is the other end of the interface from the drive, the part that
  486.   is connected to a computer bus. The speed of the computer bus and that
  487.   of the drives should be roughly similar, otherwise you have a
  488.   bottleneck in your system. Connecting a RAID 0 disk-farm to a ISA card
  489.   is pointless. These days most computers come with 32 bit PCI bus
  490.   capable of 132MB/s transfers which should not represent a bottleneck
  491.   for most people in the near future.
  492.  
  493.   As the drive electronic migrated to the drives the remaining part that
  494.   became the (E)IDE interface is so small it can easily fit into the PCI
  495.   chip set. The SCSI host adapter is more complex and often includes a
  496.   small CPU of its own and is therefore more expensive and not
  497.   integrated into the PCI chip sets available today. Technological
  498.   evolution might change this.
  499.  
  500.   Some host adapters come with separate caching and intelligence but as
  501.   this is basically second guessing the operating system the gains are
  502.   heavily dependent on which operating system is used. Some of the more
  503.   primitive ones, that shall remain nameless, experience great gains.
  504.   Linux, on the other hand, have so much smarts of its own that the
  505.   gains are much smaller.
  506.  
  507.   Mike Neuffer, who did the drivers for the DPT controllers, states that
  508.   the DPT controllers are intelligent enough that given enough cache
  509.   memory it will give you a big push in performance and suggests that
  510.   people who have experienced little gains with smart controllers just
  511.   have not used a sufficiently intelligent caching controller.
  512.  
  513.   3.7.  Multi Channel Systems
  514.  
  515.   In order to increase throughput it is necessary to identify the most
  516.   significant bottlenecks and then eliminate them. In some systems, in
  517.   particular where there are a great number of drives connected, it is
  518.   advantageous to use several controllers working in parallel, both for
  519.   SCSI host adapters as well as IDE controllers which usually have 2
  520.   channels built in. Linux supports this.
  521.  
  522.   Some RAID controllers feature 2 or 3 channels and it pays to spread
  523.   the disk load across all channels.
  524.  
  525.   3.8.  Comparisons
  526.  
  527.   SCSI offers more performance than EIDE but at a price. Termination is
  528.   more complex but expansion not too difficult. Having more than 4 (or
  529.   in some cases 2) IDE drives can be complicated, with wide SCSI you can
  530.   have up to 15. Some SCSI host adapters have several channels thereby
  531.   multiplying the number of possible drives even further.
  532.  
  533.   RLL and MFM is in general too old, slow and unreliable to be of much
  534.   use.
  535.  
  536.   3.9.  Future Development
  537.  
  538.   The general trend is for faster and faster devices for every update in
  539.   the specifications. ATA-3 is just out but does not define faster
  540.   transfers, that could happen in ATA-4 which is under way. Quantum has
  541.   already released DMA/33 and recent motherboard chip sets now supports
  542.   this standard.
  543.  
  544.   SCSI-3 is under way and will hopefully be released soon. Faster
  545.   devices are already being announced, most recently an 80MB/s monster
  546.   specification has been proposed.  This is based around the ultra-2
  547.   standard (which used a 40MHz clock) combined with a 16 bit cable.
  548.  
  549.   Some manufacturers already announce SCSI-3 devices but this is
  550.   currently rather premature as the standard is not yet firm. As the
  551.   transfer speeds increase the saturation point of the PCI bus is
  552.   getting closer. Currently the 64 bit version has a limit of 264MB/s.
  553.   The PCI transfer rate will in the future be increased from the current
  554.   33MHz to 66MHz, thereby increasing the limit to 528MB/s.
  555.  
  556.   Another trend is for larger and larger drives. I hear it is possible
  557.   to get 55GB on a single drive though this is rather expensive.
  558.   Currently the optimum storage for your money is about 5GB but also
  559.   this is continuously increasing. The introduction of DVD will in the
  560.   near future have a big impact, with nearly 20GB on a single disk you
  561.   can have a complete copy of even major FTP sites from around the
  562.   world. The only thing we can be reasonably sure about the future is
  563.   that even if it won't get any better, it will definitely be bigger.
  564.  
  565.   Addendum: soon after I first wrote this I read that the maximum useful
  566.   speed for a CD-ROM was 20x as mechanical stability would be too great
  567.   a problem at these speeds. About one month after that again the first
  568.   commercial 24x CD-ROMs were available...
  569.  
  570.   3.10.  Recommendations
  571.  
  572.   My personal view is that EIDE is the best way to start out on your
  573.   system, especially if you intend to use DOS as well on your machine.
  574.   If you plan to expand your system over many years or use it as a
  575.   server I would strongly recommend you get SCSI drives. Currently wide
  576.   SCSI is a little more expensive. You are generally more likely to get
  577.   more for your money with standard width SCSI. There is also
  578.   differential versions of the SCSI bus which increases maximum length
  579.   of the cable. The price increase is even more substantial and cannot
  580.   therefore be recommended for normal users.
  581.  
  582.   In addition to disk drives you can also connect some types of scanners
  583.   and printers and even networks to a SCSI bus.
  584.  
  585.   Also keep in mind that as you expand your system you will draw ever
  586.   more power, so make sure your power supply is rated for the job and
  587.   that you have sufficient cooling. Many SCSI drives offer the option of
  588.   sequential spin-up which is a good idea for large systems.  See also
  589.   the point on ``Power and Heating''.
  590.  
  591.   4.  Considerations
  592.  
  593.   The starting point in this will be to consider where you are and what
  594.   you want to do. The typical home system starts out with existing
  595.   hardware and the newly converted Linux user will want to get the most
  596.   out of existing hardware. Someone setting up a new system for a
  597.   specific purpose (such as an Internet provider) will instead have to
  598.   consider what the goal is and buy accordingly. Being ambitious I will
  599.   try to cover the entire range.
  600.  
  601.   Various purposes will also have different requirements regarding file
  602.   system placement on the drives, a large multiuser machine would
  603.   probably be best off with the /home directory on a separate disk, just
  604.   to give an example.
  605.  
  606.   In general, for performance it is advantageous to split most things
  607.   over as many disks as possible but there is a limited number of
  608.   devices that can live on a SCSI bus and cost is naturally also a
  609.   factor. Equally important, file system maintenance becomes more
  610.   complicated as the number of partitions and physical drives increases.
  611.  
  612.   4.1.  File system features
  613.  
  614.   The various parts of FSSTND have different requirements regarding
  615.   speed, reliability and size, for instance losing root is a pain but
  616.   can easily be recovered. Losing /var/spool/mail is a rather different
  617.   issue. Here is a quick summary of some essential parts and their
  618.   properties and requirements. Note that this is just a guide, there can
  619.   be binaries in etc and lib directories, libraries in bin directories
  620.   and so on.
  621.  
  622.   4.1.1.  Swap
  623.  
  624.      Speed
  625.         Maximum! Though if you rely too much on swap you should consider
  626.         buying some more RAM. Note, however, that on many PC
  627.         motherboards the cache will not work on RAM above 128MB.
  628.  
  629.      Size
  630.         Similar as for RAM. Quick and dirty algorithm: just as for tea:
  631.         16MB for the machine and 2MB for each user. Smallest kernel run
  632.         in 1MB but is tight, use 4MB for general work and light
  633.         applications, 8MB for X11 or GCC or 16MB to be comfortable.
  634.         (The author is known to brew a rather powerful cuppa tea...)
  635.  
  636.         Some suggest that swap space should be 1-2 times the size of the
  637.         RAM, pointing out that the locality of the programs determines
  638.         how effective your added swap space is. Note that using the same
  639.         algorithm as for 4BSD is slightly incorrect as Linux does not
  640.         allocate space for pages in core.
  641.  
  642.         Also remember to take into account the type of programs you use.
  643.         Some programs that have large working sets, such as finite
  644.         element modeling (FEM) have huge data structures loaded in RAM
  645.         rather than working explicitly on disk files. Data and computing
  646.         intensive programs like this will cause excessive swapping if
  647.         you have less RAM than the requirements.
  648.  
  649.         Other types of programs can lock their pages into RAM. This can
  650.         be for security reasons, preventing copies of data reaching a
  651.         swap device or for performance reasons such as in a real time
  652.         module. Either way, locking pages reduces the remaining amount
  653.         of swappable memory and can cause the system to swap earlier
  654.         then otherwise expected.
  655.  
  656.      Reliability
  657.         Medium. When it fails you know it pretty quickly and failure
  658.         will cost you some lost work. You save often, don't you?
  659.  
  660.      Note 1
  661.         Linux offers the possibility of interleaved swapping across
  662.         multiple devices, a feature that can gain you much. Check out
  663.         "man 8 swapon" for more details. However, software raiding swap
  664.         across multiple devices adds more overheads than you gain.
  665.  
  666.         Thus the fstab file might look like this:
  667.  
  668.           /dev/sda1       swap            swap    pri=1           0       0
  669.           /dev/sdc1       swap            swap    pri=1           0       0
  670.  
  671.      Remember that the fstab file is very sensitive to the formatting
  672.      used, read the man page carefully and do not just cut and paste the
  673.      lines above.
  674.  
  675.      Note 2
  676.         Some people use a RAM disk for swapping or some other file
  677.         systems. However, unless you have some very unusual requirements
  678.         or setups you are unlikely to gain much from this as this cuts
  679.         into the memory available for caching and buffering.
  680.  
  681.   4.1.2.  Temporary storage (/tmp and /var/tmp)
  682.  
  683.      Speed
  684.         Very high. On a separate disk/partition this will reduce
  685.         fragmentation generally, though ext2fs handles fragmentation
  686.         rather well.
  687.  
  688.      Size
  689.         Hard to tell, small systems are easy to run with just a few MB
  690.         but these are notorious hiding places for stashing files away
  691.         from prying eyes and quota enforcements and can grow without
  692.         control on larger machines. Suggested: small home machine: 8MB,
  693.         large home machine: 32MB, small server: 128MB, and large
  694.         machines up to 500MB (The machine used by the author at work has
  695.         1100 users and a 300MB /tmp directory). Keep an eye on these
  696.         directories, not only for hidden files but also for old files.
  697.         Also be prepared that these partitions might be the first reason
  698.         you might have to resize your partitions.
  699.  
  700.      Reliability
  701.         Low. Often programs will warn or fail gracefully when these
  702.         areas fail or are filled up. Random file errors will of course
  703.         be more serious, no matter what file area this is.
  704.  
  705.      Files
  706.         Mostly short files but there can be a huge number of them.
  707.         Normally programs delete their old tmp files but if somehow an
  708.         interruption occurs they could survive. Many distributions have
  709.         a policy regarding cleaning out tmp files at boot time, you
  710.         might want to check out what your setup is.
  711.  
  712.      Note
  713.         In FSSTND there is a note about putting /tmp on RAM disk. This,
  714.         however, is not recommended for the same reasons as stated for
  715.         swap. Also, as noted earlier, do not use flash RAM drives for
  716.         these directories. One should also keep in mind that some
  717.         systems are set to automatically clean tmp areas on rebooting.
  718.  
  719.   (* That was 50 lines, I am home and dry! *)
  720.  
  721.   4.1.3.  Spool areas (/var/spool/news and /var/spool/mail)
  722.  
  723.      Speed
  724.         High, especially on large news servers. News transfer and
  725.         expiring are disk intensive and will benefit from fast drives.
  726.         Print spools: low. Consider RAID0 for news.
  727.  
  728.      Size
  729.         For news/mail servers: whatever you can afford. For single user
  730.         systems a few MB will be sufficient if you read continuously.
  731.         Joining a list server and taking a holiday is, on the other
  732.         hand, not a good idea.  (Again the machine I use at work has
  733.         100MB reserved for the entire /var/spool)
  734.  
  735.      Reliability
  736.         Mail: very high, news: medium, print spool: low. If your mail is
  737.         very important (isn't it always?) consider RAID for reliability.
  738.  
  739.      Files
  740.         Usually a huge number of files that are around a few KB in size.
  741.         Files in the print spool can on the other hand be few but quite
  742.         sizable.
  743.  
  744.      Note
  745.         Some of the news documentation suggests putting all the
  746.         .overview files on a drive separate from the news files, check
  747.         out all news FAQs for more information.
  748.  
  749.   4.1.4.  Home directories (/home)
  750.  
  751.      Speed
  752.         Medium. Although many programs use /tmp for temporary storage,
  753.         others such as some news readers frequently update files in the
  754.         home directory which can be noticeable on large multiuser
  755.         systems. For small systems this is not a critical issue.
  756.  
  757.      Size
  758.         Tricky! On some systems people pay for storage so this is
  759.         usually then a question of finance. Large systems such as
  760.         nyx.net <http://www.nyx.net/> (which is a free Internet service
  761.         with mail, news and WWW services) run successfully with a
  762.         suggested limit of 100K per user and 300K as enforced maximum.
  763.         Commercial ISPs offer typically about 5MB in their standard
  764.         subscription packages.
  765.  
  766.         If however you are writing books or are doing design work the
  767.         requirements balloon quickly.
  768.  
  769.      Reliability
  770.         Variable. Losing /home on a single user machine is annoying but
  771.         when 2000 users call you to tell you their home directories are
  772.         gone it is more than just annoying. For some their livelihood
  773.         relies on what is here. You do regular backups of course?
  774.  
  775.      Files
  776.         Equally tricky. The minimum setup for a single user tends to be
  777.         a dozen files, 0.5 - 5 kB in size. Project related files can be
  778.         huge though.
  779.  
  780.      Note1
  781.         You might consider RAID for either speed or reliability. If you
  782.         want extremely high speed and reliability you might be looking
  783.         at other operating system and hardware platforms anyway.  (Fault
  784.         tolerance etc.)
  785.  
  786.      Note2
  787.         Web browsers often use a local cache to speed up browsing and
  788.         this cache can take up a substantial amount of space and cause
  789.         much disk activity. There are many ways of avoiding this kind of
  790.         performance hits, for more information see the sections on
  791.         ``Home Directories'' and ``WWW''.
  792.  
  793.   4.1.5.  Main binaries ( /usr/bin and /usr/local/bin)
  794.  
  795.      Speed
  796.         Low. Often data is bigger than the programs which are demand
  797.         loaded anyway so this is not speed critical. Witness the
  798.         successes of live file systems on CD ROM.
  799.  
  800.      Size
  801.         The sky is the limit but 200MB should give you most of what you
  802.         want for a comprehensive system. A big system, for software
  803.         development or a multi purpose server should perhaps reserve
  804.         500MB both for installation and for growth.
  805.  
  806.      Reliability
  807.         Low. This is usually mounted under root where all the essentials
  808.         are collected. Nevertheless losing all the binaries is a pain...
  809.  
  810.      Files
  811.         Variable but usually of the order of 10 - 100 kB.
  812.  
  813.   4.1.6.  Libraries ( /usr/lib and /usr/local/lib)
  814.  
  815.      Speed
  816.         Medium. These are large chunks of data loaded often, ranging
  817.         from object files to fonts, all susceptible to bloating. Often
  818.         these are also loaded in their entirety and speed is of some use
  819.         here.
  820.  
  821.      Size
  822.         Variable. This is for instance where word processors store their
  823.         immense font files. The few that have given me feedback on this
  824.         report about 70MB in their various lib directories.  A rather
  825.         complete Debian 1.2 installation can take as much as 250MB which
  826.         can be taken as an realistic upper limit.  The following ones
  827.         are some of the largest disk space consumers: GCC, Emacs,
  828.         TeX/LaTeX, X11 and perl.
  829.  
  830.      Reliability
  831.         Low. See point ``Main binaries''.
  832.  
  833.      Files
  834.         Usually large with many of the order of 100 kB in size.
  835.  
  836.      Note
  837.         For historical reasons some programs keep executables in the lib
  838.         areas. One example is GCC which have some huge binaries in the
  839.         /usr/lib/gcc/lib hierarchy.
  840.  
  841.   4.1.7.  Root
  842.  
  843.      Speed
  844.         Quite low: only the bare minimum is here, much of which is only
  845.         run at startup time.
  846.  
  847.      Size
  848.         Relatively small. However it is a good idea to keep some
  849.         essential rescue files and utilities on the root partition and
  850.         some keep several kernel versions. Feedback suggests about 20MB
  851.         would be sufficient.
  852.  
  853.      Reliability
  854.         High. A failure here will possibly cause a fair bit of grief and
  855.         you might end up spending some time rescuing your boot
  856.         partition. With some practice you can of course do this in an
  857.         hour or so, but I would think if you have some practice doing
  858.         this you are also doing something wrong.
  859.  
  860.         Naturally you do have a rescue disk? Of course this is updated
  861.         since you did your initial installation? There are many ready
  862.         made rescue disks as well as rescue disk creation tools you
  863.         might find valuable.  Presumably investing some time in this
  864.         saves you from becoming a root rescue expert.
  865.  
  866.      Note 1
  867.         If you have plenty of drives you might consider putting a spare
  868.         emergency boot partition on a separate physical drive. It will
  869.         cost you a little bit of space but if your setup is huge the
  870.         time saved, should something fail, will be well worth the extra
  871.         space.
  872.  
  873.      Note 2
  874.         For simplicity and also in case of emergencies it is not
  875.         advisable to put the root partition on a RAID level 0 system.
  876.         Also if you use RAID for your boot partition you have to
  877.         remember to have the md option turned on for your emergency
  878.         kernel.
  879.  
  880.   4.1.8.  DOS etc.
  881.  
  882.   At the danger of sounding heretical I have included this little
  883.   section about something many reading this document have strong
  884.   feelings about.  Unfortunately many hardware items come with setup and
  885.   maintenance tools based around those systems, so here goes.
  886.  
  887.      Speed
  888.         Very low. The systems in question are not famed for speed so
  889.         there is little point in using prime quality drives.
  890.         Multitasking or multi-threading are not available so the command
  891.         queueing facility found in SCSI drives will not be taken
  892.         advantage of. If you have an old IDE drive it should be good
  893.         enough. The exception is to some degree Win95 and more notably
  894.         NT which have multi-threading support which should theoretically
  895.         be able to take advantage of the more advanced features offered
  896.         by SCSI devices.
  897.  
  898.      Size
  899.         The company behind these operating systems is not famed for
  900.         writing tight code so you have to be prepared to spend a few
  901.         tens of MB depending on what version you install of the OS or
  902.         Windows. With an old version of DOS or Windows you might fit it
  903.         all in on 50MB.
  904.  
  905.      Reliability
  906.         Ha-ha. As the chain is no stronger than the weakest link you can
  907.         use any old drive. Since the OS is more likely to scramble
  908.         itself than the drive is likely to self destruct you will soon
  909.         learn the importance of keeping backups here.
  910.  
  911.         Put another way: "Your mission, should you choose to accept it,
  912.         is to keep this partition working. The warranty will self
  913.         destruct in 10 seconds..."
  914.  
  915.         Recently I was asked to justify my claims here. First of all I
  916.         am not calling DOS and Windows sorry excuses for operating
  917.         systems. Secondly there are various legal issues to be taken
  918.         into account. Saying there is a connection between the last two
  919.         sentences are merely the ravings of the paranoid. Surely.
  920.         Instead I shall offer the esteemed reader a few key words: DOS
  921.         4.0, DOS 6.x and various drive compression tools that shall
  922.         remain nameless.
  923.  
  924.   4.2.  Explanation of terms
  925.  
  926.   Naturally the faster the better but often the happy installer of Linux
  927.   has several disks of varying speed and reliability so even though this
  928.   document describes performance as 'fast' and 'slow' it is just a rough
  929.   guide since no finer granularity is feasible. Even so there are a few
  930.   details that should be kept in mind:
  931.  
  932.   4.2.1.  Speed
  933.  
  934.   This is really a rather woolly mix of several terms: CPU load,
  935.   transfer setup overhead, disk seek time and transfer rate. It is in
  936.   the very nature of tuning that there is no fixed optimum, and in most
  937.   cases price is the dictating factor. CPU load is only significant for
  938.   IDE systems where the CPU does the transfer itself but is generally
  939.   low for SCSI, see SCSI documentation for actual numbers. Disk seek
  940.   time is also small, usually in the millisecond range. This however is
  941.   not a problem if you use command queueing on SCSI where you then
  942.   overlap commands keeping the bus busy all the time. News spools are a
  943.   special case consisting of a huge number of normally small files so in
  944.   this case seek time can become more significant.
  945.  
  946.   There are two main parameters that are of interest here:
  947.  
  948.      Seek
  949.         is usually specified in the average time take for the read/write
  950.         head to seek from one track to another. This parameter is
  951.         important when dealing with a large number of small files such
  952.         as found in spool files.  There is also the extra seek delay
  953.         before the desired sector rotates into position under the head.
  954.         This delay is dependent on the angular velocity of the drive
  955.         which is why this parameter quite often is quoted for a drive.
  956.         Common values are 4500, 5400 and 7200 rpm (rotations per
  957.         minute). Higher rpm reduces the seek time but at a substantial
  958.         cost.  Also drives working at 7200 rpm have been known to be
  959.         noisy and to generate a lot of heat, a factor that should be
  960.         kept in mind if you are building a large array or "disk farm".
  961.         Very recently drives working at 10000 rpm has entered the market
  962.         and here the cooling requirements are even stricter and minimum
  963.         figures for air flow are given.
  964.  
  965.      Transfer
  966.         is usually specified in megabytes per second.  This parameter is
  967.         important when handling large files that have to be transferred.
  968.         Library files, dictionaries and image files are examples of
  969.         this. Drives featuring a high rotation speed also normally have
  970.         fast transfers as transfer speed is proportional to angular
  971.         velocity for the same sector density.
  972.  
  973.   It is therefore important to read the specifications for the drives
  974.   very carefully, and note that the maximum transfer speed quite often
  975.   is quoted for transfers out of the on board cache (burst speed) and
  976.   not directly from the platter (sustained speed).  See also section on
  977.   ``Power and Heating''.
  978.  
  979.   4.2.2.  Reliability
  980.  
  981.   Naturally no-one would want low reliability disks but one might be
  982.   better off regarding old disks as unreliable. Also for RAID purposes
  983.   (See the relevant information) it is suggested to use a mixed set of
  984.   disks so that simultaneous disk crashes become less likely.
  985.  
  986.   So far I have had only one report of total file system failure but
  987.   here unstable hardware seemed to be the cause of the problems.
  988.  
  989.   4.2.3.  Files
  990.  
  991.   The average file size is important in order to decide the most
  992.   suitable drive parameters. A large number of small files makes the
  993.   average seek time important whereas for big files the transfer speed
  994.   is more important.  The command queueing in SCSI devices is very handy
  995.   for handling large numbers of small files, but for transfer EIDE is
  996.   not too far behind SCSI and normally much cheaper than SCSI.
  997.  
  998.   4.3.  Technologies
  999.  
  1000.   In order to decide how to get the most of your devices you need to
  1001.   know what technologies are available and their implications. As always
  1002.   there can be some tradeoffs with respect to speed, reliability, power,
  1003.   flexibility, ease of use and complexity.
  1004.  
  1005.   4.3.1.  RAID
  1006.  
  1007.   This is a method of increasing reliability, speed or both by using
  1008.   multiple disks in parallel thereby decreasing access time and
  1009.   increasing transfer speed. A checksum or mirroring system can be used
  1010.   to increase reliability.  Large servers can take advantage of such a
  1011.   setup but it might be overkill for a single user system unless you
  1012.   already have a large number of disks available. See other documents
  1013.   and FAQs for more information.
  1014.  
  1015.   For Linux one can set up a RAID system using either software (the md
  1016.   module in the kernel) or hardware, using a Linux compatible
  1017.   controller. Check the documentation for what controllers can be used.
  1018.   A hardware solution is usually faster, and perhaps also safer, but
  1019.   comes at a significant cost.
  1020.  
  1021.   Currently the only supported hardware SCSI RAID controllers are the
  1022.   SmartCache I/III/IV and SmartRAID I/III/IV controller families from
  1023.   DPT. These controllers are supported by the EATA-DMA driver in the
  1024.   standard kernel. This company also has an informative home page
  1025.   <http://www.dpt.com> which also describes various general aspects of
  1026.   RAID and SCSI in addition to the product related information.
  1027.  
  1028.   More information from  the author of the DPT controller drivers (EATA*
  1029.   drivers) can be found at his pages on SCSI <http://www.i-
  1030.   connect.net/~mike/scsi> and DPT <http://www.i-
  1031.   connect.net/~mike/scsi/dpt>.
  1032.  
  1033.   RAID comes in many levels and flavours which I will give a brief
  1034.   overview of this here. Much has been written about it and the
  1035.   interested reader is recommended to read more about this in the RAID
  1036.   FAQ.
  1037.  
  1038.   ╖  RAID 0 is not redundant at all but offers the best throughput of
  1039.      all levels here. Data is striped across a number of drives so read
  1040.      and write operations take place in parallel across all drives. On
  1041.      the other hand if a single drive fail then everything is lost. Did
  1042.      I mention backups?
  1043.  
  1044.   ╖  RAID 1 is the most primitive method of obtaining redundancy by
  1045.      duplicating data across all drives. Naturally this is massively
  1046.      wasteful but you get one substantial advantage which is fast
  1047.      access.  The drive that access the data first wins. Transfers are
  1048.      not any faster than for a single drive, even though you might get
  1049.      some faster read transfers by using one track reading per drive.
  1050.  
  1051.      Also if you have only 2 drives this is the only method of achieving
  1052.      redundancy.
  1053.  
  1054.   ╖  RAID 2, 3 and 4 are not so common and is not covered here.
  1055.  
  1056.   ╖  RAID 5 offers excellent redundancy without wasteful duplication. It
  1057.      is fast in reading but not so fast for writing. It is normally
  1058.      recommended to use at least 3, preferrably more than 5 drives for
  1059.      this level.
  1060.  
  1061.   There are also hybrids available based on RAID 1 and one other level.
  1062.   Many combinations are possible but I have only seen a few referred to.
  1063.   These are more complex than the above mentioned RAID levels.
  1064.  
  1065.   RAID 0/1 combines striping with duplication which gives very high
  1066.   transfers combined with fast seeks as well as redundancy. The
  1067.   disadvantage is high disk consumption as well as the above mentioned
  1068.   complexity.
  1069.  
  1070.   RAID 1/5 combines the speed and redundancy benefits of RAID5 with the
  1071.   fast seek of RAID1. Redundancy is improved compared to RAID 0/1 but
  1072.   disk consumption is still substantial. Implementing such a system
  1073.   would involve typically more than 6 drives, perhaps even several
  1074.   controllers or SCSI channels.
  1075.  
  1076.   4.3.2.  AFS, Veritas and Other Volume Management Systems
  1077.  
  1078.   Although multiple partitions and disks have the advantage of making
  1079.   for more space and higher speed and reliability there is a significant
  1080.   snag: if for instance the /tmp partition is full you are in trouble
  1081.   even if the news spool is empty, as it is not easy to retransfer
  1082.   quotas across partitions. Volume management is a system that does just
  1083.   this and AFS and Veritas are two of the best known examples. Some also
  1084.   offer other file systems like log file systems and others optimised
  1085.   for reliability or speed. Note that Veritas is not available (yet) for
  1086.   Linux and it is not certain they can sell kernel modules without
  1087.   providing source for their proprietary code, this is just mentioned
  1088.   for information on what is out there. Still, you can check their home
  1089.   page <http://www.veritas.com> to see how such systems function.
  1090.  
  1091.   Derek Atkins, of MIT, ported AFS to Linux and has also set up the
  1092.   Linux AFS mailing List for this which is open to the public.  Requests
  1093.   to join the list should go to Request and finally bug reports should
  1094.   be directed to Bug Reports.
  1095.  
  1096.   Important: as AFS uses encryption it is restricted software and cannot
  1097.   easily be exported from the US. AFS is now sold by Transarc and they
  1098.   have set up a www site. The directory structure there has been
  1099.   reorganized recently so I cannot give a more accurate URL than just
  1100.   the Transarc Home Page <http://www.transarc.com> which lands you in
  1101.   the root of the web site. There you can also find much general
  1102.   information as well as a FAQ.
  1103.  
  1104.   Volume management is for the time being an area where Linux is
  1105.   lacking.  Hot news: someone has just started a virtual partition
  1106.   system project that will reimplement many of the volume management
  1107.   functions found in IBM's AIX system.
  1108.  
  1109.   4.3.3.  Linux md Kernel Patch
  1110.  
  1111.   There is however one kernel project that attempts to do some of this,
  1112.   md, which has been part of the kernel distributions since 1.3.69.
  1113.   Currently providing spanning and RAID it is still in early development
  1114.   and people are reporting varying degrees of success as well as total
  1115.   wipe out. Use with caution.
  1116.  
  1117.   4.3.4.  General File System Consideration
  1118.  
  1119.   In the Linux world ext2fs is well established as a general purpose
  1120.   system.  Still for some purposes others can be a better choice. News
  1121.   spools lend themselves to a log file based system whereas high
  1122.   reliability data might need other formats. This is a hotly debated
  1123.   topic and there are currently few choices available but work is
  1124.   underway. Log file systems also have the advantage of very fast file
  1125.   checking. Mail servers in the 100G class can suffer file checks taking
  1126.   several days before becoming operational after rebooting.
  1127.  
  1128.   The Minix file system is the oldest one, used in some rescue disk
  1129.   systems but otherwise very little used these days. At one time the
  1130.   Xiafs was a strong contender to the standard for Linux but seems to
  1131.   have fallen behind these days.
  1132.  
  1133.   Adam Richter from Yggdrasil posted recently that they have been
  1134.   working on a compressed log file based system but that this project is
  1135.   currently on hold. Nevertheless a non-working version is available on
  1136.   their FTP server. Check out the yggdrasil ftp server
  1137.   <ftp://ftp.yggdrasil.com/private/adam> where special patched versions
  1138.   of the kernel can be found.  Hopefully this will be rolled into the
  1139.   mainstream kernel in the near future.
  1140.  
  1141.   There is room for access control lists (ACL) and other unimplemented
  1142.   features in the existing ext2fs, stay tuned for future updates. There
  1143.   has been some talk about adding on the fly compression too.
  1144.  
  1145.   There is also an encrypted file system available but again as this is
  1146.   under export control from the US, make sure you get it from a legal
  1147.   place.
  1148.  
  1149.   File systems is an active field of academic and industrial research
  1150.   and development, the results of which are quite often freely
  1151.   available. Linux has in many cases been a development tool in such
  1152.   activities so you can expect a lot of continuous work in this field,
  1153.   stay tuned for the latest development.
  1154.  
  1155.   4.3.5.  CD-ROM File Systems
  1156.  
  1157.   There has been a number of file systems available for use on CD-ROM
  1158.   systems and one of the earliest one was the High Sierra format,
  1159.   supposedly named after the hotel where the final agreement took place.
  1160.   This was the precursor to the ISO 9660 format which is supported by
  1161.   Linux.  Later there were the Rock Ridge extensions which added file
  1162.   system features such as long filenames, permissions and more.
  1163.  
  1164.   The Linux iso9660 file system supports both High Sierra as well as
  1165.   Rock Ridge extensions.
  1166.  
  1167.   However, once again Microsoft decided it should create another
  1168.   standard and their latest effort here is called Joliet and offers some
  1169.   internationalisation features. This is at the time of writing not yet
  1170.   available in the standard kernel releases but exists in beta versions.
  1171.   Hopefully this should soon work its way into the standard kernel.
  1172.  
  1173.   In a recent Usenet News posting hpa@transmeta.com (H. Peter Anvin)
  1174.   writes the following the following interesting piece of trivia:
  1175.  
  1176.        Actually, Joliet is a city outside Chicago; best known for being the
  1177.        site of the prison where Elwood was locked up in the movie "Blues
  1178.        Brothers."  Rock Ridge (the UNIX extensions to ISO 9660) is named
  1179.        after the (fictional) town in the movie "Blazing Saddles."
  1180.  
  1181.   4.3.6.  Compression
  1182.  
  1183.   Disk versus file compression is a hotly debated topic especially
  1184.   regarding the added danger of file corruption. Nevertheless there are
  1185.   several options available for the adventurous administrators. These
  1186.   take on many forms, from kernel modules and patches to extra libraries
  1187.   but note that most suffer various forms of limitations such as being
  1188.   read-only. As development takes place at neck breaking speed the specs
  1189.   have undoubtedly changed by the time you read this. As always: check
  1190.   the latest updates yourself. Here only a few references are given.
  1191.  
  1192.   ╖  DouBle features file compression with some limitations.
  1193.  
  1194.   ╖  Zlibc adds transparent on-the-fly decompression of files as they
  1195.      load.
  1196.  
  1197.   ╖  there are many modules available for reading compressed files or
  1198.      partitions that are native to various other operating systems
  1199.      though currently most of these are read-only.
  1200.  
  1201.   ╖  dmsdos (currently in version 0.8.0a) offer many of the compression
  1202.      options available for DOS and Windows. It is not yet complete but
  1203.      work is ongoing and new features added regularly.
  1204.  
  1205.   Also there is the user file system (userfs) that allows FTP based file
  1206.   system and some compression (arcfs) plus fast prototyping and many
  1207.   other features.
  1208.  
  1209.   Recent kernels feature the loop or loopback device which can be used
  1210.   to put a complete file system within a file. There are some
  1211.   possibilities for using this for making new file systems with
  1212.   compression, tarring, encryption etc.
  1213.  
  1214.   Note that this device is unrelated to the network loopback device.
  1215.  
  1216.   Very recently a compression package that extends ext2fs was announced.
  1217.   It is still under testing and will therefore mainly be of interest for
  1218.   kernel hackers but should soon gain stability for wider use.
  1219.  
  1220.   4.3.7.  Physical Track Positioning
  1221.  
  1222.   This trick used to be very important when drives were slow and small,
  1223.   and some file systems used to take the varying characteristics into
  1224.   account when placing files. Although higher overall speed, on board
  1225.   drive and controller caches and intelligence has reduced the effect of
  1226.   this.
  1227.  
  1228.   Nevertheless there is still a little to be gained even today.  As we
  1229.   know, "world dominance" is soon within reach but to achieve this
  1230.   "fast" we need to employ all the tricks we can use
  1231.  
  1232.   To understand the strategy we need to recall this near ancient piece
  1233.   of knowledge and the properties of the various track locations.  This
  1234.   is based on the fact that transfer speeds generally increase for
  1235.   tracks further away from the spindle, as well as the fact that it is
  1236.   faster to seek to or from a central tracks than to or from the inner
  1237.   or outer tracks.
  1238.  
  1239.   Most drives use disks running at constant angular velocity but use
  1240.   (fairly) constant data density across all tracks. This means that you
  1241.   will get much higher transfer rates on the outer tracks than on the
  1242.   inner tracks; a characteristics which fits the requirements for large
  1243.   libraries well.
  1244.  
  1245.   Newer disks use a logical geometry mapping which differs from the
  1246.   actual physical mapping which is transparently mapped by the drive
  1247.   itself.  This makes the estimation of the "middle" tracks a little
  1248.   harder.
  1249.  
  1250.   In most cases track 0 is at the outermost track and this is the
  1251.   general assumption most people use. Still, it should be kept in mind
  1252.   that there are no guarantees this is so.
  1253.  
  1254.      Inner
  1255.         tracks are usually slow in transfer, and lying at one end of the
  1256.         seeking position it is also slow to seek to.
  1257.  
  1258.         This is more suitable to the low end directories such as DOS,
  1259.         root and print spools.
  1260.  
  1261.      Middle
  1262.         tracks are on average faster with respect to transfers than
  1263.         inner tracks and being in the middle also on average faster to
  1264.         seek to.
  1265.  
  1266.         This characteristics is ideal for the most demanding parts such
  1267.         as swap, /tmp and /var/tmp.
  1268.  
  1269.      Outer
  1270.         tracks have on average even faster transfer characteristics but
  1271.         like the inner tracks are at the end of the seek so
  1272.         statistically it is equally slow to seek to as the inner tracks.
  1273.  
  1274.         Large files such as libraries would benefit from a place here.
  1275.  
  1276.   Hence seek time reduction can be achieved by positioning frequently
  1277.   accessed tracks in the middle so that the average seek distance and
  1278.   therefore the seek time is short. This can be done either by using
  1279.   fdisk or cfdisk to make a partition on the middle tracks or by first
  1280.   making a file (using dd) equal to half the size of the entire disk
  1281.   before creating the files that are frequently accessed, after which
  1282.   the dummy file can be deleted. Both cases assume starting from an
  1283.   empty disk.
  1284.  
  1285.   The latter trick is suitable for news spools where the empty directory
  1286.   structure can be placed in the middle before putting in the data
  1287.   files.  This also helps reducing fragmentation a little.
  1288.  
  1289.   This little trick can be used both on ordinary drives as well as RAID
  1290.   systems. In the latter case the calculation for centring the tracks
  1291.   will be different, if possible. Consult the latest RAID manual.
  1292.  
  1293.   5.  Other Operating System
  1294.  
  1295.   Many Linux users have several operating systems installed, often
  1296.   necessitated by hardware setup systems that run under other operating
  1297.   systems, typically DOS or some flavour of Windows. A small section on
  1298.   how best to deal with this is therefore included here.
  1299.  
  1300.   5.1.  DOS
  1301.  
  1302.   Leaving aside the debate on weather or not DOS qualifies as an
  1303.   operating system one can in general say that it has little
  1304.   sophistication with respect to disk operations. The more important
  1305.   result of this is that there can be severe difficulties in running
  1306.   various versions of DOS on large drives, and you are therefore
  1307.   strongly recommended in reading the Large Drives mini-HOWTO. One
  1308.   effect is that you are often better off placing DOS on low track
  1309.   numbers.
  1310.  
  1311.   Having been designed for small drives it has a rather unsophisticated
  1312.   file system (FAT) which when used on large drives will allocate
  1313.   enormous block sizes. It is also prone to block fragmentation which
  1314.   will after a while cause excessive seeks and slow effective transfers.
  1315.  
  1316.   One solution to this is to use a defragmentation program regularly but
  1317.   it is strongly recommended to back up data and verify the disk before
  1318.   defragmenting. All versions of DOS have chkdsk that can do some disk
  1319.   checking, newer versions also have scandisk which is somewhat better.
  1320.   There are many defragmentation programs available, some versions have
  1321.   one called defrag. Norton Utilities have a large suite of disk tools
  1322.   and there are many others available too.
  1323.  
  1324.   As always there are snags, and this particular snake in our drive
  1325.   paradise is called hidden files. Some vendors started to use these for
  1326.   copy protection schemes and would not take kindly to being moved to a
  1327.   different place on the drive, even if it remained in the same place in
  1328.   the directory structure. The result of this was that newer
  1329.   defragmentation programs will not touch any hidden file, which in turn
  1330.   reduces the effect of defragmentation.
  1331.  
  1332.   Being a single tasking, single threading and single most other things
  1333.   operating system there is very little gains in using multiple drives
  1334.   unless you use a drive controller with built in RAID support of some
  1335.   kind.
  1336.  
  1337.   There are a few utilities called join and subst which can do some
  1338.   multiple drive configuration but there is very little gains for a lot
  1339.   of work. Some of these commands have been removed in newer versions.
  1340.  
  1341.   In the end there is very little you can do, but not all hope is lost.
  1342.   Many programs need fast, temporary storage, and the better behaved
  1343.   ones will look for environment variables called TMPDIR or TEMPDIR
  1344.   which you can set to point to another drive. This is often best done
  1345.   in autoexec.bat.
  1346.  
  1347.   ______________________________________________________________________
  1348.   SET TMPDIR=E:/TMP
  1349.   ______________________________________________________________________
  1350.  
  1351.   Not only will this possibly gain you some speed but also it can reduce
  1352.   fragmentation.
  1353.  
  1354.   5.2.  Windows
  1355.  
  1356.   Most of the above points are valid for Windows too, with the exception
  1357.   of Windows95 which apparently has better disk handling, which will get
  1358.   better performance out of SCSI drives.
  1359.  
  1360.   A useful thing is the introduction of long filenames, to read these
  1361.   from Linux you will need the vfat file system for mounting these
  1362.   partitions.
  1363.  
  1364.   The most important thing is the introduction of the new file system
  1365.   FAT32 which is better suited to large drives. The snag is that there
  1366.   is very little support for this today, not even in NT 4.0 or many
  1367.   drive utility systems. A stable driver for Linux is coming soon but is
  1368.   not yet ready for prime time. Stay tuned for updates.
  1369.  
  1370.   Disk fragmentation is still a problem. Some of this can be avoided by
  1371.   doing a defragmentation immediately before and immediately after
  1372.   installing large programs or systems. I use this scheme at work and
  1373.   have found it to work quite well. Purging unused files and emptying
  1374.   the waste basket first can improve defragmentation further.
  1375.  
  1376.   Windows also use swap drives, redirecting this to another drive can
  1377.   give you some performance gains. There are several mini-HOWTOs telling
  1378.   you how best to share swap space between various operating systems.
  1379.  
  1380.   Very recently someone started a project supporting ext2fs support for
  1381.   Win95 which you can read about at this web site
  1382.   <http://www.globalxs.nl/home/p/pvs/>.
  1383.  
  1384.   5.3.  OS/2
  1385.  
  1386.   The only special note here is that you can get a file system driver
  1387.   for OS/2 that can read an ext2fs partition.
  1388.  
  1389.   5.4.  NT
  1390.  
  1391.   This is a more serious system featuring most buzzwords known to
  1392.   marketing.  It is well worth noting that it features software striping
  1393.   and other more sophisticated setups. Check out the drive manager in
  1394.   the control panel.  I do not have easy access to NT, more details on
  1395.   this can take a bit of time.
  1396.  
  1397.   One important snag was recently reported by acahalan at cs.uml.edu :
  1398.   (reformatted from a Usenet News posting)
  1399.  
  1400.   NT DiskManager has a serious bug that can corrupt your disk when you
  1401.   have several (more than one?) extended partitions.  Microsoft provides
  1402.   an emergency fix program at their web site. See the knowledge base
  1403.   <http://www.microsoft.com/kb/> for more.  (This affects Linux users,
  1404.   because Linux users have extra partitions)
  1405.  
  1406.   5.5.  Sun OS
  1407.  
  1408.   There is a little bit of confusion in this area between Sun OS vs.
  1409.   Solaris.  Strictly speaking Solaris is just Sun OS 5.x packaged with
  1410.   Openwindows and a few other things. If you run Solaris, just type
  1411.   uname -a to see your version. Parts of the reason for this confusion
  1412.   is that Sun Microsystems used to use an OS from the BSD family,
  1413.   albeight with a few bits and pieces from elsewhere as well as things
  1414.   made by themselves. This was the situation up to Sun OS 4.x.y when
  1415.   they did a "strategic roadmap decision" and decided to switch over to
  1416.   the official Unix, System V, Release 4, and Sun OS 5 was created.
  1417.   This made a lot of people unhappy. Also this was bundled with other
  1418.   things and marketed under the name Solaris, which currently stands at
  1419.   release 2.6 beta.
  1420.  
  1421.   5.5.1.  Sun OS 4
  1422.  
  1423.   This is quite familiar to most Linux users. Note however that the file
  1424.   system structure is quite different and does not conform to FSSTND so
  1425.   any planning must be based on the traditional structure. You can get
  1426.   some information by the man page on this: man hier. This is, like most
  1427.   manpages, rather brief but should give you a good start. If you are
  1428.   still confused by the structure it will at least be at a higher level.
  1429.  
  1430.   5.5.2.  Sun OS 5 (aka Solaris)
  1431.  
  1432.   This comes with a snazzy installation system that runs under
  1433.   Openwindows, it will help you in partitioning and formatting the
  1434.   drives before installing the system from CD-ROM. It will also fail if
  1435.   your drive setup is too far out, and as it takes a complete
  1436.   installation run from a full CD-ROM in a 1x only drive this failure
  1437.   will dawn on you after too long time. That is the experience we had
  1438.   where I work. Instead we installed everything onto one drive and then
  1439.   moved directories across.
  1440.  
  1441.   The default settings are sensible for most things, yet there remains a
  1442.   little oddity: swap drives. Even though the official manual recommends
  1443.   multiple swap drives (which are used in a similar fashion as on Linux)
  1444.   the default is to use only a single drive. It is recommended to change
  1445.   this as soon as possible.
  1446.  
  1447.   Sun OS 5 offers also a file system especially designed for temporary
  1448.   files, tmpfs. This is a kind of souped up RAM disk, and like ordinary
  1449.   RAM disks the contents is lost when the power goes. If space is scarce
  1450.   parts of the pseudo drive is swapped out, so in effect you store
  1451.   temporary files on the swap partition. Linux does not have such a file
  1452.   system; it has been discussed in the past but opinions were mixed. I
  1453.   would be interested in hearing comments on this.
  1454.  
  1455.   6.  Clusters
  1456.  
  1457.   In this section I will briefly touch on the ways machines can be
  1458.   connected together but this is so big a topic it could be a separate
  1459.   HOWTO in its own right, hint, hint. Also, strictly speaking, this
  1460.   section lies outside the scope of this HOWTO, so if you feel like
  1461.   getting fame etc. you could contact me and take over this part and
  1462.   turn it into a new document.
  1463.  
  1464.   These days computers gets outdated at an incredible rate. There is
  1465.   however no reason why old hardware could not be put to good use with
  1466.   Linux. Using an old and otherwise outdated computer as a network
  1467.   server can be both useful in its own right as well as a valuable
  1468.   educational exercise. Such a local networked cluster of computers can
  1469.   take on many forms but to remain within the charter of this HOWTO I
  1470.   will limit myself to the disk strategies.  Nevertheless I would hope
  1471.   someone else could take on this topic and turn it into a document on
  1472.   its own.
  1473.  
  1474.   This is an exciting area of activity today, and many forms of
  1475.   clustering is available today, ranging from automatic workload
  1476.   balancing over local network to more exotic hardware such as Scalable
  1477.   Coherent Interface (SCI) which gives a tight integration of machines,
  1478.   effectively turning them into a single machine. Various kinds of
  1479.   clustering has been available for larger machines for some time and
  1480.   the VAXcluster is perhaps a well known example of this. Clustering is
  1481.   done usually in order to share resources such as disk drives, printers
  1482.   and terminals etc, but also processing resources equally transparently
  1483.   between the computational nodes.
  1484.   There is no universal definition of clustering, in here it is taken to
  1485.   mean a network of machines that combine their resources to serve
  1486.   users. Admittedly this is a rather loose definition but this will
  1487.   change later.
  1488.  
  1489.   These days also Linux offers some clustering features but for a
  1490.   starter I will just describe a simple local network. It is a good way
  1491.   of putting old and otherwise unusable hardware to good use, as long as
  1492.   they can run Linux or something similar.
  1493.  
  1494.   One of the best ways of using an old machine is as a network server in
  1495.   which case the effective speed is more likely to be limited by network
  1496.   bandwidth rather than pure computational performance. For home use you
  1497.   can move the following functionality off to an older machine used as a
  1498.   server:
  1499.  
  1500.   ╖  news
  1501.  
  1502.   ╖  mail
  1503.  
  1504.   ╖  web proxy
  1505.  
  1506.   ╖  printer server
  1507.  
  1508.   ╖  modem server (PPP, SLIP, FAX, Voice mail)
  1509.  
  1510.   You can also NFS mount drives from the server onto your workstation
  1511.   thereby reducing drive space requirements. Still read the FSSTND to
  1512.   see what directories should not be exported. The best candidates for
  1513.   exporting to all machines are /usr and /var/spool and possibly
  1514.   /usr/local
  1515.  
  1516.   Most of the time even slow disks will deliver sufficient performance.
  1517.   On the other hand, if you do processing directly on the disks on the
  1518.   server or have very fast networking, you might want to rethink your
  1519.   strategy and use faster drives. Searching features on a web server or
  1520.   news database searches are two examples of this.
  1521.  
  1522.   Such a network can be an excellent way of learning system
  1523.   administration and building up your own toaster network, as it often
  1524.   is called. You can get more information on this in other HOWTOs but
  1525.   there are two important things you should keep in mind:
  1526.  
  1527.   ╖  Do not pull IP numbers out of thin air. Configure your inside net
  1528.      using IP numbers reserved for private use, and use your network
  1529.      server as a router that handles this IP masquerading.
  1530.  
  1531.   ╖  Remember that if you additionally configure the router as a
  1532.      firewall you might not be able to get to your own data from the
  1533.      outside, depending on the firewall configuration.
  1534.  
  1535.   The nyx network provides an example of a cluster in the sense defined
  1536.   here.  It consists of the following machines:
  1537.  
  1538.      nyx
  1539.         is one of the two user login machines and also provides some of
  1540.         the networking services.
  1541.  
  1542.      nox
  1543.         (aka nyx10) is the main user login machine and is also the mail
  1544.         server.
  1545.  
  1546.      noc
  1547.         is a dedicated news server. The news spool is made accessible
  1548.         through NFS mounting to nyx and nox.
  1549.  
  1550.      arachne
  1551.         (aka www) is the web server. Web pages are written by NFS
  1552.         mounting onto nox.
  1553.  
  1554.   There are also some more advanced clustering projects going, notably
  1555.  
  1556.   ╖  The Beowolf Project
  1557.      <http://cesdis.gsfc.nasa.gov/linux/beowulf/beowulf.html>
  1558.  
  1559.   ╖  The Genoa Active Message Machine (GAMMA)
  1560.      <http://www.disi.unige.it/project/gamma/>
  1561.  
  1562.   High-tech clustering requires high-tech interconnect, and SCI is one
  1563.   of them.  To find out more you can either look up the home page of
  1564.   Dolphin Interconnect Solutions <http://www.dolphinics.no/> which is
  1565.   one of the main actors in this field, or you can have a look at scizzl
  1566.   <http://www.scizzl.com/>.
  1567.  
  1568.   7.  Mounting Points
  1569.  
  1570.   In designing the disk layout it is important not to split off the
  1571.   directory tree structure at the wrong points, hence this section.  As
  1572.   it is highly dependent on the FSSTND it has been put aside in a
  1573.   separate section, and will most likely have to be totally rewritten
  1574.   when FHS is released. Nobody knows when that will happen, and at the
  1575.   time of writing this a debate of near-religious qualities is taking
  1576.   place on the mailing list. In the meanwhile this will do.
  1577.  
  1578.   Remember that this is a list of where a separation can take place, not
  1579.   where it has to be. As always, good judgement is always required.
  1580.  
  1581.   Again only a rough indication can be given here. The values indicate
  1582.  
  1583.        0=don't separate here
  1584.        1=not recommended
  1585.        4=useful
  1586.        5=recommended
  1587.  
  1588.   In order to keep the list short, the uninteresting parts are removed.
  1589.  
  1590.   Directory   Suitability
  1591.   /
  1592.   |
  1593.   +-bin       0
  1594.   +-boot      0
  1595.   +-dev       0
  1596.   +-etc       0
  1597.   +-home      5
  1598.   +-lib       0
  1599.   +-mnt       0
  1600.   +-proc      0
  1601.   +-root      0
  1602.   +-sbin      0
  1603.   +-tmp       5
  1604.   +-usr       5
  1605.   | \
  1606.   | +-X11R6     3
  1607.   | +-bin       3
  1608.   | +-lib       4
  1609.   | +-local     4
  1610.   | | \
  1611.   | | +bin        2
  1612.   | | +lib        4
  1613.   | +-src       3
  1614.   |
  1615.   +-var       5
  1616.     \
  1617.     +-adm       0
  1618.     +-lib       2
  1619.     +-lock      1
  1620.     +-log       1
  1621.     +-preserve  1
  1622.     +-run       1
  1623.     +-spool     4
  1624.     | \
  1625.     | +-mail      3
  1626.     | +-mqueue    3
  1627.     | +-news      5
  1628.     | +-smail     3
  1629.     | +-uucp      3
  1630.     +-tmp       5
  1631.  
  1632.   There is of course plenty of adjustments possible, for instance a home
  1633.   user would not bother with splitting off the /var/spool hierarchy but
  1634.   a serious ISP should. The key here is usage.
  1635.  
  1636.   8.  Disk Layout
  1637.  
  1638.   With all this in mind we are now ready to embark on the layout. I have
  1639.   based this on my own method developed when I got hold of 3 old SCSI
  1640.   disks and boggled over the possibilities.
  1641.  
  1642.   At the end of this document there is an appendix with a few blank
  1643.   forms that you can fill in to help you decide and design your system.
  1644.   The following few paragraphs will refer to them.
  1645.  
  1646.   8.1.  Selection
  1647.  
  1648.   Determine your needs and set up a list of all the parts of the file
  1649.   system you want to be on separate partitions and sort them in
  1650.   descending order of speed requirement and how much space you want to
  1651.   give each partition.  The table in appendix A is a useful tool to
  1652.   select what directories you should put on different partitions. It is
  1653.   sorted in a logical order with space for your own additions and notes
  1654.   about mounting points and additional systems. It is therefore NOT
  1655.   sorted in order of speed, instead the speed requirements are indicated
  1656.   by bullets ('o').
  1657.  
  1658.   If you plan to RAID make a note of the disks you want to use and what
  1659.   partitions you want to RAID. Remember various RAID solutions offers
  1660.   different speeds and degrees of reliability.
  1661.  
  1662.   (Just to make it simple I'll assume we have a set of identical SCSI
  1663.   disks and no RAID)
  1664.  
  1665.   8.2.  Mapping
  1666.  
  1667.   Then we want to place the partitions onto physical disks. The point of
  1668.   the following algorithm is to maximise parallelizing and bus capacity.
  1669.   In this example the drives are A, B and C and the partitions are
  1670.   987654321 where 9 is the partition with the highest speed requirement.
  1671.   Starting at one drive we 'meander' the partition line over and over
  1672.   the drives in this way:
  1673.  
  1674.                A : 9 4 3
  1675.                B : 8 5 2
  1676.                C : 7 6 1
  1677.  
  1678.   This makes the 'sum of speed requirements' the most equal across each
  1679.   drive.
  1680.  
  1681.   The tables in the appendices are designed to simplify the mapping
  1682.   process.  Note the speed characteristics of your drives and note each
  1683.   directory under the appropriate column. Be prepared to shuffle
  1684.   directories, partitions and drives around a few times before you are
  1685.   satisfied. After that it is recommended to sort this list according to
  1686.   partition numbers into the table in appendix C and to use this when
  1687.   running the partitioning program (fdisk or cfdisk) and when doing the
  1688.   installation.
  1689.  
  1690.   8.3.  Optimizing
  1691.  
  1692.   After this there are usually a few partitions that have to be
  1693.   'shuffled' over the drives either to make them fit or if there are
  1694.   special considerations regarding speed, reliability, special file
  1695.   systems etc. Nevertheless this gives what this author believes is a
  1696.   good starting point for the complete setup of the drives and the
  1697.   partitions. In the end it is actual use that will determine the real
  1698.   needs after we have made so many assumptions. After commencing
  1699.   operations one should assume a time comes when a repartitioning will
  1700.   be beneficial.
  1701.  
  1702.   For instance if one of the 3 drives in the above mentioned example is
  1703.   very slow compared to the two others a better plan would be as
  1704.   follows:
  1705.  
  1706.                A : 9 6 5
  1707.                B : 8 7 4
  1708.                C : 3 2 1
  1709.  
  1710.   8.3.1.  Optimizing by characteristics
  1711.  
  1712.   Often drives can be similar in apparent overall speed but some
  1713.   advantage can be gained by matching drives to the file size
  1714.   distribution and frequency of access. Thus binaries are suited to
  1715.   drives with fast access that offer command queueing, and libraries are
  1716.   better suited to drives with larger transfer speeds where IDE offers
  1717.   good performance for the money.
  1718.  
  1719.   8.3.2.  Optimizing by drive parallelising
  1720.  
  1721.   Avoid drive contention by looking at tasks: for instance if you are
  1722.   accessing /usr/local/bin chances are you will soon also need files
  1723.   from /usr/local/lib so placing these at separate drives allows less
  1724.   seeking and possible parallel operation and drive caching. It is quite
  1725.   possible that choosing what may appear less than ideal drive
  1726.   characteristics will still be advantageous if you can gain parallel
  1727.   operations. Identify common tasks, what partitions they use and try to
  1728.   keep these on separate physical drives.
  1729.  
  1730.   Just to illustrate my point I will give a few examples of task
  1731.   analysis here.
  1732.  
  1733.      Office software
  1734.         such as editing, word processing and spreadsheets are typical
  1735.         examples of low intensity software both in terms of CPU and disk
  1736.         intensity. However, should you have a single server for a huge
  1737.         number of users you should not forget that most such software
  1738.         have auto save facilities which cause extra traffic, usually on
  1739.         the home directories. Splitting users over several drives would
  1740.         reduce contention.
  1741.  
  1742.      News
  1743.         readers also feature auto save features on home directories so
  1744.         ISPs should consider separating home directories, news spool and
  1745.         .overview files on separate drives.
  1746.  
  1747.      Database
  1748.         applications can be demanding both in terms of drive usage and
  1749.         speed requirements. The details are naturally application
  1750.         specific, read the documentation carefully with disk
  1751.         requirements in mind. Also consider RAID both for performance
  1752.         and reliability.
  1753.  
  1754.      E-mail
  1755.         reading and sending involves home directories as well as in- and
  1756.         outgoing spool files. If possible keep home directories and
  1757.         spool files on separate drives. If you are a mail server or a
  1758.         mail hub consider putting in- and outgoing spool directories on
  1759.         separate drives.
  1760.  
  1761.      Software development
  1762.         can require a large number of directories for binaries,
  1763.         libraries, include files as well as source and project files. If
  1764.         possible split as much as possible across separate drives. On
  1765.         small systems you can place /usr/src and project files on the
  1766.         same drive as the home directories.
  1767.  
  1768.      Web browsing
  1769.         is becoming more and more popular. Many browsers have a local
  1770.         cache which can expand to rather large volumes. As this is used
  1771.         when reloading pages or returning to the previous page, speed is
  1772.         quite important here. If however you are connected via a well
  1773.         configured proxy server you do not need more than typically a
  1774.         few megabytes per user for a session.  See also the sections on
  1775.         ``Home Directories'' and ``WWW''.
  1776.  
  1777.   8.4.  Usage requirements
  1778.  
  1779.   When you get a box of 10 or so CD-ROMs with a Linux distribution and
  1780.   the entire contents of the big FTP sites it can be tempting to install
  1781.   as much as your drives can take. Soon, however, one would find that
  1782.   this leaves little room to grow and that it is easy to bite over more
  1783.   than can be chewed, at least in polite company. Therefore I will make
  1784.   a few comments on a few points to keep in mind when you plan out your
  1785.   system. Comments here are actively sought.
  1786.  
  1787.      Testing
  1788.         Linux is simple and you don't even need a hard disk to try it
  1789.         out, if you can get the boot floppies to work you are likely to
  1790.         get it to work on your hardware. If the standard kernel does not
  1791.         work for you, do not forget that often there can be special boot
  1792.         disk versions available for unusual hardware combinations that
  1793.         can solve your initial problems until you can compile your own
  1794.         kernel.
  1795.  
  1796.      Learning
  1797.         about operating system is something Linux excels in, there is
  1798.         plenty of documentation and the source is available. A single
  1799.         drive with 50MB is enough to get you started with a shell, a few
  1800.         of the most frequently used commands and utilities.
  1801.  
  1802.      Hobby
  1803.         use or more serious learning requires more commands and
  1804.         utilities but a single drive is still all it takes, 500MB should
  1805.         give you plenty of room, also for sources and documentation.
  1806.  
  1807.      Serious
  1808.         software development or just serious hobby work requires even
  1809.         more space. At this stage you have probably a mail and news feed
  1810.         that requires spool files and plenty of space. Separate drives
  1811.         for various tasks will begin to show a benefit. At this stage
  1812.         you have probably already gotten hold of a few drives too. Drive
  1813.         requirements gets harder to estimate but I would expect 2-4GB to
  1814.         be plenty, even for a small server.
  1815.  
  1816.      Servers
  1817.         come in many flavours, ranging from mail servers to full sized
  1818.         ISP servers. A base of 2GB for the main system should be
  1819.         sufficient, then add space and perhaps also drives for separate
  1820.         features you will offer. Cost is the main limiting factor here
  1821.         but be prepared to spend a bit if you wish to justify the "S" in
  1822.         ISP. Admittedly, not all do it.
  1823.  
  1824.   8.5.  Servers
  1825.  
  1826.   Big tasks require big drives and a separate section here. If possible
  1827.   keep as much as possible on separate drives. Some of the appendices
  1828.   detail the setup of a small departmental server for 10-100 users. Here
  1829.   I will present a few consideration for the higher end servers. In
  1830.   general you should not be afraid of using RAID, not only because it is
  1831.   fast and safe but also because it can make growth a little less
  1832.   painful. All the notes below come as additions to the points mentioned
  1833.   earlier.
  1834.  
  1835.   Popular servers rarely just happens, rather they grow over time and
  1836.   this demands both generous amounts of disk space as well as a good net
  1837.   connection.  In many of these cases it might be a good idea to reserve
  1838.   entire SCSI drives, in singles or as arrays, for each task. This way
  1839.   you can move the data should the computer fail. Note that transferring
  1840.   drives across computers is not simple and might not always work,
  1841.   especially in the case of IDE drives. Drive arrays require careful
  1842.   setup in order to reconstruct the data correctly, so you might want to
  1843.   keep a paper copy of your fstab file as well as a note of SCSI IDs.
  1844.  
  1845.   8.5.1.  Home directories
  1846.  
  1847.   Estimate how many drives you will need, if this is more than 2 I would
  1848.   recommend RAID, strongly. If not you should separate users across your
  1849.   drives dedicated to users based on some kind of simple hashing
  1850.   algorithm.  For instance you could use the first 2 letters in the user
  1851.   name, so jbloggs is put on /u/j/b/jbloggs where /u/j is a symbolic
  1852.   link to a physical drive so you can get a balanced load on your
  1853.   drives.
  1854.  
  1855.   8.5.2.  Anonymous FTP
  1856.  
  1857.   This is an essential service if you are serious about service. Good
  1858.   servers are well maintained, documented, kept up to date, and
  1859.   immensely popular no matter where in the world they are located. The
  1860.   big server ftp.funet.fi is an excellent example of this.
  1861.  
  1862.   In general this is not a question of CPU but of network bandwidth.
  1863.   Size is hard to estimate, mainly it is a question of ambition and
  1864.   service attitudes. I believe the big archive at ftp.cdrom.com is a
  1865.   *BSD machine with 50GB disk. Also memory is important for a dedicated
  1866.   FTP server, about 256MB RAM would be sufficient for a very big server,
  1867.   whereas smaller servers can get the job done well with 64MB RAM.
  1868.   Network connections would still be the most important factor.
  1869.   8.5.3.  WWW
  1870.  
  1871.   For many this is the main reason to get onto the Internet, in fact
  1872.   many now seem to equate the two. In addition to being network
  1873.   intensive there is also a fair bit of drive activity related to this,
  1874.   mainly regarding the caches. Keeping the cache on a separate, fast
  1875.   drive would be beneficial. Even better would be installing a caching
  1876.   proxy server. This way you can reduce the cache size for each user and
  1877.   speed up the service while at the same time cut down on the bandwidth
  1878.   requirements.
  1879.  
  1880.   With a caching proxy server you need a fast set of drives, RAID0 would
  1881.   be ideal as reliability is not important here. Higher capacity is
  1882.   better but about 2GB should be sufficient for most. Remember to match
  1883.   the cache period to the capacity and demand. Too long periods would on
  1884.   the other hand be a disadvantage, if possible try to adjust based on
  1885.   the URL. For more information check up on the most used servers such
  1886.   as Harvest, Squid <http://www.nlanr.net/Squid> and the one from
  1887.   Netscape.
  1888.  
  1889.   8.5.4.  Mail
  1890.  
  1891.   Handling mail is something most machines do to some extent. The big
  1892.   mail servers, however, come into a class of their own. This is a
  1893.   demanding task and a big server can be slow even when connected to
  1894.   fast drives and a good net feed. In the Linux world the big server at
  1895.   vger.rutgers.edu is a well known example. Unlike a news service which
  1896.   is distributed and which can partially reconstruct the spool using
  1897.   other machines as a feed, the mail servers are centralised. This makes
  1898.   safety much more important, so for a major server you should consider
  1899.   a RAID solution with emphasize on reliability. Size is hard to
  1900.   estimate, it all depends on how many lists you run as well as how many
  1901.   subscribers you have.
  1902.  
  1903.   8.5.5.  News
  1904.  
  1905.   This is definitely a high volume task, and very dependent on what news
  1906.   groups you subscribe to. On nyx there is a fairly complete feed and
  1907.   the spool files consume about 17GB. The biggest groups are no doubt in
  1908.   the alt.binary.* hierarchy, so if you for some reason decide not to
  1909.   get these you can get a good service with perhaps 12GB. Still others,
  1910.   that shall remain nameless, feel 2GB is sufficient to claim ISP
  1911.   status.  In this case news expires so fast I feel the spelling IsP is
  1912.   barely justified.
  1913.  
  1914.   8.5.6.  Others
  1915.  
  1916.   There are many services available on the net and even though many have
  1917.   been put somewhat in the shadows by the web. Nevertheless, services
  1918.   like archie, gopher and wais just to name a few, still exist and
  1919.   remain valuable tools on the net. If you are serious about starting a
  1920.   major server you should also consider these services. Determining the
  1921.   required volumes is hard, it all depends on popularity and demand.
  1922.   Providing good service inevitably has its costs, disk space is just
  1923.   one of them.
  1924.  
  1925.   8.6.  Pitfalls
  1926.  
  1927.   The dangers of splitting up everything into separate partitions are
  1928.   briefly mentioned in the section about volume management. Still,
  1929.   several people have asked me to emphasize this point more strongly:
  1930.   when one partition fills up it cannot grow any further, no matter if
  1931.   there is plenty of space in other partitions.
  1932.  
  1933.   In particular look out for explosive growth in the news spool
  1934.   (/var/spool/news). For multi user machines with quotas keep an eye on
  1935.   /tmp and /var/tmp as some people try to hide their files there, just
  1936.   look out for filenames ending in gif or jpeg...
  1937.  
  1938.   In fact, for single physical drives this scheme offers very little
  1939.   gains at all, other than making file growth monitoring easier (using
  1940.   'df') and physical track positioning. Most importantly there is no
  1941.   scope for parallel disk access. A freely available volume management
  1942.   system would solve this but this is still some time in the future.
  1943.   However, when more specialised file systems become available even a
  1944.   single disk could benefit from being divided into several partitions.
  1945.  
  1946.   8.7.  Compromises
  1947.  
  1948.   One way to avoid the aforementioned pitfalls is to only set off fixed
  1949.   partitions to directories with a fairly well known size such as swap,
  1950.   /tmp and /var/tmp and group together the remainders into the remaining
  1951.   partitions using symbolic links.
  1952.  
  1953.   Example: a slow disk (slowdisk), a fast disk (fastdisk) and an
  1954.   assortment of files. Having set up swap and tmp on fastdisk; and /home
  1955.   and root on slowdisk we have (the fictitious) directories /a/slow,
  1956.   /a/fast, /b/slow and /b/fast left to allocate on the partitions
  1957.   /mnt.slowdisk and /mnt.fastdisk which represents the remaining
  1958.   partitions of the two drives.
  1959.  
  1960.   Putting /a or /b directly on either drive gives the same properties to
  1961.   the subdirectories. We could make all 4 directories separate
  1962.   partitions but would lose some flexibility in managing the size of
  1963.   each directory. A better solution is to make these 4 directories
  1964.   symbolic links to appropriate directories on the respective drives.
  1965.  
  1966.   Thus we make
  1967.  
  1968.        /a/fast point to /mnt.fastdisk/a/fast   or   /mnt.fastdisk/a.fast
  1969.        /a/slow point to /mnt.slowdisk/a/slow   or   /mnt.slowdisk/a.slow
  1970.        /b/fast point to /mnt.fastdisk/b/fast   or   /mnt.fastdisk/b.fast
  1971.        /b/slow point to /mnt.slowdisk/b/slow   or   /mnt.slowdisk/b.slow
  1972.  
  1973.   and we get all fast directories on the fast drive without having to
  1974.   set up a partition for all 4 directories. The second (right hand)
  1975.   alternative gives us a flatter files system which in this case can
  1976.   make it simpler to keep an overview of the structure.
  1977.  
  1978.   The disadvantage is that it is a complicated scheme to set up and plan
  1979.   in the first place and that all mount point and partitions have to be
  1980.   defined before the system installation.
  1981.  
  1982.   9.  Implementation
  1983.  
  1984.   Having done the layout you should now have a detailled description on
  1985.   what goes where. Most likely this will be on paper but hopefully
  1986.   someone will make a more automated system that can deal with
  1987.   everything from the design, through partitioning to formatting and
  1988.   installation. This is the route one will have to take to realise the
  1989.   design.
  1990.  
  1991.   Modern distributions come with installation tools that will guide you
  1992.   through partitioning and formatting and also set up /etc/fstab for you
  1993.   automatically. For later modifications, however, you will need to
  1994.   understand the underlying mechanisms.
  1995.  
  1996.   9.1.  Drives and Partitions
  1997.  
  1998.   When you start DOS or the like you will find all partitions labeled C:
  1999.   and onwards, with no differentiation on IDE, SCSI, network or whatever
  2000.   type of media you have. In the world of Linux this is rather
  2001.   different. During booting you will see partitions described like this:
  2002.  
  2003.   ______________________________________________________________________
  2004.   Dec  6 23:45:18 demos kernel: Partition check:
  2005.   Dec  6 23:45:18 demos kernel:  sda: sda1
  2006.   Dec  6 23:45:18 demos kernel:  hda: hda1 hda2
  2007.   ______________________________________________________________________
  2008.  
  2009.   SCSI drives are labelled sda, sdb, sdc etc, and (E)IDE drives are
  2010.   labelled hda, hdb, hdc etc.  There are also standard names for all
  2011.   devices, full information can be found in /dev/MAKEDEV and
  2012.   ./kernel/Documentation/devices.tex.
  2013.  
  2014.   Partitions are labelled numerically for each drive hda1, hda2 and so
  2015.   on.
  2016.  
  2017.   These are then mounted according to the file /etc/fstab before they
  2018.   appear as a part of the file system.
  2019.  
  2020.   9.2.  Partitioning
  2021.  
  2022.   First you have to partition each drive into a number of separate
  2023.   partitions.  Under Linux there are two main methods, fdisk and the
  2024.   more screen oriented cfdisk. These are complex programs, read the
  2025.   manual very carefully. Under DOS there are other choices, mainly the
  2026.   version of fdisk that is bundled with for instance DOS, or fips. The
  2027.   latter has the unique advantage here that it can repartition a drive
  2028.   without necessarily damaging existing data, unlike all the other
  2029.   partitioning programs.
  2030.  
  2031.   In order to get the most out of fips you should first defragment your
  2032.   drive. This way you can allocate more space to other partitions.
  2033.  
  2034.   Nevertheless, it is important you do a full backup of all your valued
  2035.   data before partitioning.
  2036.  
  2037.   Partitions come in 3 flavours, primary, extended and logical.  You
  2038.   have to use primary partitions for booting, but there is a maximum of
  2039.   4 primary partitions. If you want more you have to define a extended
  2040.   partition within which you define your logical partitions.
  2041.  
  2042.   Each partition has an identifier number which tells the operating
  2043.   system what it is, for Linux the types swap and ext2fs are the ones
  2044.   you will need to know.
  2045.  
  2046.   There is a readme file that comes with fdisk that gives more in-depth
  2047.   information on partitioning.
  2048.  
  2049.   Someone has just made a Partitioning HOWTO which contains excellent,
  2050.   in depth information on the nitty-gritty of partitioning. Rather than
  2051.   repeating it here and bloating this document further, I will instead
  2052.   refer you to it instead.
  2053.  
  2054.   9.3.  Multiple devices (md)
  2055.  
  2056.   Being in a state of flux you should make sure to read the latest
  2057.   documentation on this kernel feature. It is not yet stable, beware.
  2058.  
  2059.   Briefly explained it works by adding partitions together into new
  2060.   devices md0, md1 etc. using mdadd before you activate them using
  2061.   mdrun. This process can be automated using the file /etc/mdtab.
  2062.  
  2063.   Then you then treat these like any other partition on a drive. Proceed
  2064.   with formatting etc. as described below using these new devices.
  2065.  
  2066.   9.4.  Formatting
  2067.  
  2068.   Next comes partition formatting, putting down the data structures that
  2069.   will describe the files and where they are located. If this is the
  2070.   first time it is recommended you use formatting with verify. Strictly
  2071.   speaking it should not be necessary but this exercises the I/O hard
  2072.   enough that it can uncover potential problems, such as incorrect
  2073.   termination, before you store your precious data. Look up the command
  2074.   mkfs for more details.
  2075.  
  2076.   Linux can support a great number of file systems, rather than
  2077.   repeating the details you can read the manpage for fs which describes
  2078.   them in some details. Note that your kernel has to have the drivers
  2079.   compiled in or made as modules in order to be able to use these
  2080.   features. When the time comes for kernel compiling you should read
  2081.   carefully through the file system feature list. If you use make
  2082.   menuconfig you can get online help for each file system type.
  2083.  
  2084.   Note that some rescue disk systems require minix, msdos and ext2fs to
  2085.   be compiled into the kernel.
  2086.  
  2087.   Also swap partitions have to be prepared, and for this you use mkswap.
  2088.  
  2089.   9.5.  Mounting
  2090.  
  2091.   Data on a partition is not available to the file system until it is
  2092.   mounted on a mount point. This can be done manually using mount or
  2093.   automatically during booting by adding appropriate lines to
  2094.   /etc/fstab. Read the manual for mount and pay close attention to the
  2095.   tabulation.
  2096.  
  2097.   10.  Maintenance
  2098.  
  2099.   It is the duty of the system manager to keep an eye on the drives and
  2100.   partitions. Should any of the partitions overflow, the system is
  2101.   likely to stop working properly, no matter how much space is available
  2102.   on other partitions, until space is reclaimed.
  2103.  
  2104.   Partitions and disks are easily monitored using df and should be done
  2105.   frequently, perhaps using a cron job or some other general system
  2106.   management tool.
  2107.  
  2108.   Do not forget the swap partitions, these are best monitored using one
  2109.   of the memory statistics programs such as free or top.
  2110.   Drive usage monitoring is more difficult but it is important for the
  2111.   sake of performance to avoid contention - placing too much demand on a
  2112.   single drive if others are available and idle.
  2113.  
  2114.   It is important when installing software packages to have a clear idea
  2115.   where the various files go. As previously mentioned GCC keeps binaries
  2116.   in a library directory and there are also other programs that for
  2117.   historical reasons are hard to figure out, X11 for instance has an
  2118.   unusually complex structure.
  2119.  
  2120.   When your system is about to fill up it is about time to check and
  2121.   prune old logging messages as well as hunt down core files. Proper use
  2122.   of ulimit in global shell settings can help saving you from having
  2123.   core files littered around the system.
  2124.  
  2125.   10.1.  Backup
  2126.  
  2127.   The observant reader might have noticed a few hints about the
  2128.   usefulness of making backups. Horror stories are legio about accidents
  2129.   and what happened to the person responsible when the backup turned out
  2130.   to be non-functional or even non existent. You might find it simpler
  2131.   to invest in proper backups than a second, secret identity.
  2132.  
  2133.   There are many options and also a mini-HOWTO ( Backup-With-MSDOS )
  2134.   detailling what you need to know. In addition to the DOS specifics it
  2135.   also contains general information and further leads.
  2136.  
  2137.   In addition to making these backups you should also make sure you can
  2138.   restore the data. Not all systems verify that the data written is
  2139.   correct and many administrators have started restoring the system
  2140.   after an accident happy in the belief that everything is working, only
  2141.   to discover to their horror that the backups were useless. Be careful.
  2142.  
  2143.   10.2.  Defragmentation
  2144.  
  2145.   This is very dependent on the file system design, some suffer fast and
  2146.   nearly debilitating fragmentation. Fortunately for us, ext2fs does not
  2147.   belong to this group and therefore there has been very little talk
  2148.   about making a defragmentation tool.
  2149.  
  2150.   If for some reason you feel this is necessary, the quick and easy
  2151.   solution is to do a backup and a restore. If only a small area is
  2152.   affected, for instance the home directories, you could tar it over to
  2153.   a temporary area on another partition, delete the original and then
  2154.   untar it back again.
  2155.  
  2156.   10.3.  Upgrades
  2157.  
  2158.   No matter how large your drives, time will come when you will find you
  2159.   need more. As technology progresses you can get ever more for your
  2160.   money. At the time of writing this, it appears that 5GB drives gives
  2161.   you the most bang for your bucks.
  2162.  
  2163.   Note that with IDE drives you might have to remove an old drive, as
  2164.   the maximum number supported on your mother board is normally only 2
  2165.   or some times 4. With SCSI you can have up to 7 for narrow (8-bit)
  2166.   SCSI or up to 15 for wide (15 bit) SCSI, per channel. Some host
  2167.   adapters can support more than a single channel. My personal
  2168.   recommendation is that you will most likely be better off with SCSI in
  2169.   the long run.
  2170.  
  2171.   The question comes, where should you put this new drive? In many cases
  2172.   the reason for expansion is that you want a larger spool area, and in
  2173.   that case the fast, simple solution is to mount the drive somewhere
  2174.   under /var/spool. On the other hand newer drives are likely to be
  2175.   faster than older ones so in the long run you might find it worth your
  2176.   time to do a full reorganizing, possibly using your old design sheets.
  2177.  
  2178.   If the upgrade is forced by running out of space in partitions used
  2179.   for things like /usr or /var the upgrade is a little more involved.
  2180.   You might consider the option of a full re-installation from your
  2181.   favourite (and hopefully upgraded) distribution. In this case you will
  2182.   have to be careful not to overwrite your essential setups. Usually
  2183.   these things are in the /etc directory. Proceed with care, fresh
  2184.   backups and working rescue disks. The other possibility is to simply
  2185.   copy the old directory over to the new directory which is mounted on a
  2186.   temporary mount point, edit your /etc/fstab file, reboot with your new
  2187.   partition in place and check that it works.  Should it fail you can
  2188.   reboot with your rescue disk, re-edit /etc/fstab and try again.
  2189.  
  2190.   Until volume management becomes available to Linux this is both
  2191.   complicated and dangerous. Do not get too surprised if you discover
  2192.   you need to restore your system from a backup.
  2193.  
  2194.   the Tips-HOWTO gives the following example on how to move an entire
  2195.   directory structure across:
  2196.  
  2197.   ______________________________________________________________________
  2198.   (cd /source/directory; tar cf - . ) | (cd /dest/directory; tar xvfp -)
  2199.   ______________________________________________________________________
  2200.  
  2201.   11.  Advanced Issues
  2202.  
  2203.   Linux and related systems offer plenty of possibilities for fast,
  2204.   efficient and devastating destruction. This document is no exception.
  2205.   With power comes dangers and the following sections describe a few
  2206.   more esoteric issues that should not be attempted before reading and
  2207.   understanding the documentation, the issues and the dangers. You
  2208.   should also make a backup.
  2209.  
  2210.   The techniques described here are rarely necessary but can be used for
  2211.   very specific setups. think very clearly through what you wish to
  2212.   accomplish before playing around with this.
  2213.  
  2214.   11.1.  Hard Disk Tuning
  2215.  
  2216.   The hard drive parameters can be tuned using the hdparms utility. Here
  2217.   the most interesting parameter is probably the read-ahead parameter
  2218.   which determines how much prefetch should be done in sequential
  2219.   reading.
  2220.  
  2221.   11.2.  File System Tuning
  2222.  
  2223.   Most file systems come with a tuning utility and for ext2fs there is
  2224.   the tune2fs utility. Several parameters can be modified but perhaps
  2225.   the most useful parameter here is what size should be reserved and who
  2226.   should be able to take advantage of this which could help you getting
  2227.   more useful space out of your drives, possibly at the cost of less
  2228.   room for repairing a system should it crash.
  2229.  
  2230.   12.  Further Information
  2231.  
  2232.   There is wealth of information one should go through when setting up a
  2233.   major system, for instance for a news or general Internet service
  2234.   provider.  The FAQs in the following groups are useful:
  2235.  
  2236.      News groups
  2237.  
  2238.      ╖  Storage <news:comp.arch.storage>.
  2239.  
  2240.      ╖  PC storage <news:comp.sys.ibm.pc.hardware.storage>.
  2241.  
  2242.      ╖  AFS <news:alt.filesystems.afs>.
  2243.  
  2244.      ╖  SCSI <news:comp.periphs.scsi>.
  2245.  
  2246.      ╖  Linux setup <news:comp.os.linux.setup>.
  2247.  
  2248.         Most newsgroups have their own FAQ that are designed to answer
  2249.         most of your questions, as the name Frequently Asked Questions
  2250.         indicate. Fresh versions should be posted regularly to the
  2251.         relevant newsgroups. If you cannot find it in your news spool
  2252.         you could go directly to the FAQ main archive FTP site
  2253.         <ftp://rtfm.mit.edu>. The WWW versions can be browsed at FAQ
  2254.         main archive WWW site <http://www.cis.ohio-
  2255.         state.edu/hypertext/faq/usenet/FAQ-List.html>.
  2256.  
  2257.         Some FAQs have their own home site, of particular interest here
  2258.         are SCSI FAQ
  2259.         <http://www.paranoia.com/~filipg/HTML/LINK/F_SCSI.html> and
  2260.         comp.arch.storage FAQ
  2261.         <http://alumni.caltch.edu/~rdv/comp_arch_storage/FAQ-1.html>.
  2262.  
  2263.      Mailing lists
  2264.         linux-raid, linux-scsi, linux-ext2fs ...
  2265.  
  2266.      HOWTO
  2267.         Bootdisk, Installation, , SCSI, UMSDOS ...
  2268.  
  2269.      mini-HOWTO
  2270.         Backup-With-MSDOS, Diskless, LILO, Linux+DOS+Win95+OS2,
  2271.         Linux+OS2+DOS, Linux+Win95, NFS-Root, Win95+Win+Linux, ZIP Drive
  2272.         ...
  2273.  
  2274.   The old Linux Large IDE mini-HOWTO is no longer valid, instead read
  2275.   /usr/src/linux/drivers/block/README.ide or
  2276.   /usr/src/linux/Documentation/ide.txt.
  2277.  
  2278.   The kernel source is, of course, the ultimate documentation. In other
  2279.   words, use the source, Luke.
  2280.  
  2281.   Much of the work here is based on the Filesystem Structure Standard
  2282.   (FSSTND).  It has changed name to File Hierarchy Standard (FHS) and is
  2283.   less Linux specific.  The maintainer has set up a home page
  2284.   <http://www.pathname.com/fhs> which tells you how to join the
  2285.   currently private mailing list, where the development takes place.
  2286.  
  2287.   Many mailing lists are at vger.rutgers.edu but this is notoriously
  2288.   overloaded, so try to find a mirror. There are some lists mirrored at
  2289.   The Redhat Home Page <http://www.redhat.com>.  Many lists are also
  2290.   accessible at linuxhq <http://www.linuxhq.com/lnxlists>, and the rest
  2291.   of the web site is a gold mine of useful information.
  2292.  
  2293.   If you want to find out more about the lists available you can send a
  2294.   message with the line lists to the list server.  The lists linux-raid
  2295.   and linux-scsi are of particular interest.
  2296.  
  2297.   A few project pages:
  2298.  
  2299.   ╖  Mike Neuffer, the author of the DPT caching RAID controller
  2300.      drivers, has some interesting pages on SCSI <http://www.i-
  2301.      connect.net/~mike/scsi> and DPT <http://www.i-
  2302.      connect.net/~mike/scsi/dpt>.
  2303.  
  2304.   ╖  Software RAID 1 development information can be found at RAID 1
  2305.      development page <http://www.nuclecu.unam.mx/~miguel/raid>.
  2306.  
  2307.   ╖  Mark D. Roth has information on VPS
  2308.      <http://www.uiuc.edu/ph/www/roth>
  2309.  
  2310.   ╖  A similar kind of project on an Enhanced File System
  2311.      <http://www.virtual.net.au/~rjh/enh-fs.html>
  2312.  
  2313.   ╖  People who are awaiting support for VFAT32 and Joliet could have a
  2314.      look at the development page
  2315.      <http://bmrc.berkeley.edu/people/chaffee/index.html> for a preview.
  2316.      Only minor details are missing before it comes into the kernel.
  2317.  
  2318.   Please let me know if you have any other lead that can be of interest.
  2319.  
  2320.   Remember you can also use the web search engines and that some, like
  2321.  
  2322.   ╖  Altavista <http://www.altavista.digital.com>
  2323.  
  2324.   ╖  Excite <http://www.excite.com>
  2325.  
  2326.   ╖  Hotbot <http://www.hotbot.com>
  2327.  
  2328.      can also search usenet news.
  2329.  
  2330.   Also remember that Dejanews <http://www.dejanews.com> is a dedicated
  2331.   news searcher that keeps a news spool from early 1995 and onwards.
  2332.  
  2333.   For diagrams and information on all sorts of disk drives, controllers
  2334.   etc. both for current and discontinued lines The Ref
  2335.   <http://theref.c3d.rl.af.mil> is the site you need. There is a lot of
  2336.   useful information here, a real treasure trove.  You can also download
  2337.   the database using FTP <ftp://theref.c3d.rl.af.mil/public>.
  2338.  
  2339.   If you have to ask for help you are most likely to get help in the
  2340.   comp.os.linux.setup news group. Due to large workload and a slow
  2341.   network connection I am not able to follow that newsgroup so if you
  2342.   want to contact me you have to do so by e-mail.
  2343.  
  2344.   13.  Concluding Remarks
  2345.  
  2346.   Disk tuning and partition decisions are difficult to make, and there
  2347.   are no hard rules here. Nevertheless it is a good idea to work more on
  2348.   this as the payoffs can be considerable. Maximizing usage on one drive
  2349.   only while the others are idle is unlikely to be optimal, watch the
  2350.   drive light, they are not there just for decoration. For a properly
  2351.   set up system the lights should look like Christmas in a disco. Linux
  2352.   offers software RAID but also support for some hardware base SCSI RAID
  2353.   controllers. Check what is available. As your system and experiences
  2354.   evolve you are likely to repartition and you might look on this
  2355.   document again. Additions are always welcome.
  2356.  
  2357.   13.1.  Coming Soon
  2358.  
  2359.   There are a few more important things that are about to appear here.
  2360.   In particular I will add more example tables as I am about to set up
  2361.   two fairly large and general systems, one at work and one at home.
  2362.   These should give some general feeling on how a system can be set up
  2363.   for either of these two purposes. Examples of smooth running existing
  2364.   systems are also welcome.
  2365.  
  2366.   There is also a fair bit of work left to do on the various kinds of
  2367.   file systems and utilities.
  2368.  
  2369.   There will be a big addition on drive technologies coming soon as well
  2370.   as a more in depth description on using fdisk or cfdisk.  The file
  2371.   systems will be beefed up as more features become available as well as
  2372.   more on RAID and what directories can benefit from what RAID level.
  2373.  
  2374.   Also I hope to get some information from DPT who make the only RAID
  2375.   controller supported by Linux so far. I have contacted them but have
  2376.   yet to hear from them.
  2377.  
  2378.   There is some minor overlapping with the Linux Filesystem Structure
  2379.   Standard that I hope to integrate better soon, which will probably
  2380.   mean a big reworking of all the tables at the end of this document.
  2381.   When the new version is released there will be a substantial rewrite
  2382.   of some of the sections in this HOWTO but no release date has been
  2383.   announced yet.
  2384.  
  2385.   When the new standard appear various details such as directory names,
  2386.   sizes and file placements will be changed.
  2387.  
  2388.   I have made the assumption that the first partition starts at track 0
  2389.   and that this track is the innermost track. That, however, is looking
  2390.   more and more like an unwarranted assumption, and not only because of
  2391.   the logical re-mapping that takes place. More on this when information
  2392.   becomes available.
  2393.  
  2394.   As more people start reading this I should get some more comments and
  2395.   feedback. I am also thinking of making a program that can automate a
  2396.   fair bit of this decision making process and although it is unlikely
  2397.   to be optimum it should provide a simpler, more complete starting
  2398.   point.
  2399.  
  2400.   13.2.  Request for Information
  2401.  
  2402.   It has taken a fair bit of time to write this document and although
  2403.   most pieces are beginning to come together there are still some
  2404.   information needed before we are out of the beta stage.
  2405.  
  2406.   ╖  More information on swap sizing policies is needed as well as
  2407.      information on the largest swap size possible under the various
  2408.      kernel versions.
  2409.  
  2410.   ╖  How common is drive or file system corruption? So far I have only
  2411.      heard of problems caused by flaky hardware.
  2412.  
  2413.   ╖  References to speed and drives is needed.
  2414.  
  2415.   ╖  Are any other Linux compatible RAID controllers available?
  2416.  
  2417.   ╖  Leads to file system, volume management and other related software
  2418.      is welcome.
  2419.  
  2420.   ╖  What relevant monitoring, management and maintenance tools are
  2421.      available?
  2422.  
  2423.   ╖  General references to information sources are needed, perhaps this
  2424.      should be a separate document?
  2425.  
  2426.   ╖  Usage of /tmp and /var/tmp has been hard to determine, in fact what
  2427.      programs use which directory is not well defined and more
  2428.      information here is required. Still, it seems at least clear that
  2429.      these should reside on different physical drives in order to
  2430.      increase parallelicity.
  2431.  
  2432.   13.3.  Suggested Project Work
  2433.  
  2434.   Now and then people post on comp.os.linux.*, looking for good project
  2435.   ideas. Here I will list a few that comes to mind that are relevant to
  2436.   this document. Plans about big projects such as new file systems
  2437.   should still be posted in order to either find co-workers or see if
  2438.   someone is already working on it.
  2439.  
  2440.      Planning tools
  2441.         that can automate the design process outlines earlier would
  2442.         probably make a medium sized project, perhaps as an exercise in
  2443.         constraint based programming.
  2444.  
  2445.      Partitioning tools
  2446.         that take the output of the previously mentioned program and
  2447.         format drives in parallel and apply the appropriate symbolic
  2448.         links to the directory structure. It would probably be best if
  2449.         this were integrated in existing system installation software.
  2450.         The drive partitioning setup used in Solaris is an example of
  2451.         what it can look like.
  2452.  
  2453.      Surveillance tools
  2454.         that keep an eye on the partition sizes and warn before a
  2455.         partition overflows.
  2456.  
  2457.      Migration tools
  2458.         that safely lets you move old structures to new (for instance
  2459.         RAID) systems. This could probably be done as a shell script
  2460.         controlling a back up program and would be rather simple. Still,
  2461.         be sure it is safe and that the changes can be undone.
  2462.  
  2463.   14.  Questions and Answers
  2464.  
  2465.   This is just a collection of what I believe are the most common
  2466.   questions people might have. Give me more feedback and I will turn
  2467.   this section into a proper FAQ.
  2468.   ╖  Q:How many physical disk drives (spindles) does a Linux system
  2469.      need?
  2470.  
  2471.      A: Linux can run just fine on one drive (spindle).  Having enough
  2472.      RAM (around 32 MB, and up to 64 MB) to support swapping is a better
  2473.      price/performance choice than getting a second disk.  (E)IDE disk
  2474.      is usually cheaper (but a little slower) than SCSI.
  2475.  
  2476.   ╖  Q: I have a single drive, will this HOWTO help me?
  2477.  
  2478.      A: Yes, although only to a minor degree. Still, the section on
  2479.      ``Physical Track Positioning'' will offer you some gains.
  2480.  
  2481.   ╖  Q: Are there any disadvantages in this scheme?
  2482.  
  2483.      A: There is only a minor snag: if even a single partition overflows
  2484.      the system might stop working properly. The severity depends of
  2485.      course on what partition is affected. Still this is not hard to
  2486.      monitor, the command df gives you a good overview of the situation.
  2487.      Also check the swap partition(s) using free to make sure you are
  2488.      not about to run out of virtual memory.
  2489.  
  2490.   ╖  Q: OK, so should I split the system into as many partitions as
  2491.      possible for a single drive?
  2492.  
  2493.      A: No, there are several disadvantages to that. First of all
  2494.      maintenance becomes needlessly complex and you gain very little in
  2495.      this. In fact if your partitions are too big you will seek across
  2496.      larger areas than needed.  This is a balance and dependent on the
  2497.      number of physical drives you have.
  2498.  
  2499.   ╖  Q: Does that mean more drives allows more partitions?
  2500.  
  2501.      A: To some degree, yes. Still, some directories should not be split
  2502.      off from root, check out the file system standard (soon released
  2503.      under the name File Hierarchy Standard) for more details.
  2504.  
  2505.   ╖  Q: What if I have many drives I want to use?
  2506.  
  2507.      A: If you have more than 3-4 drives you should consider using RAID
  2508.      of some form. Still, it is a good idea to keep your root partition
  2509.      on a simple partition without RAID, see the section on ``RAID'' for
  2510.      more details.
  2511.  
  2512.   ╖  Q: I have installed the latest Windows95 but cannot access this
  2513.      partition from within the Linux system, what is wrong?
  2514.  
  2515.      A: Most likely you are using FAT32 in your windows partition. It
  2516.      seems that Microsoft decided we needed yet another format, and this
  2517.      was introduced in their latest version of Windows95. The advantage
  2518.      is that this format is better suited to large drives. Unfortunately
  2519.      there is no stable driver for Linux out yet . A test version is out
  2520.      but not yet in the standard kernel.
  2521.  
  2522.      You might also be interested to hear that Microsoft NT 4.0 does not
  2523.      support it yet either.
  2524.  
  2525.      Until a stable version is available you can avoid this problem by
  2526.      installing Windows95 over an existing FAT16 partition, made for
  2527.      instance by an older installation of DOS. This forces the Windows95
  2528.      to use FAT16 which is supported by Linux.
  2529.  
  2530.   ╖  Q: I cannot get the disk size and partition sizes to match,
  2531.      something is missing. What has happened?
  2532.  
  2533.      It is possible you have mounted a partition onto a mount point that
  2534.      was not an empty directory. Mount points are directories and if it
  2535.      is not empty the mounting will mask the contents. If you do the
  2536.      sums you will see the amount of disk space used in this directory
  2537.      is missing from the observed total.
  2538.  
  2539.      To solve this you can boot from a rescue disk and see what is
  2540.      hiding behind your mount points and remove or transfer the contents
  2541.      by mounting th offending partition on a temporary mounting point.
  2542.      You might find it useful to have "spare" emergency mounting points
  2543.      ready made.
  2544.  
  2545.   ╖  Q: What is this nyx that is mentioned several times here?
  2546.  
  2547.      A: It is a large free Unix system with currently about 10000 users.
  2548.      I use it for my web pages for this HOWTO as well as a source of
  2549.      ideas for a setup of large Unix systems. It has been running for
  2550.      many years and has a quite stable setup. For more information you
  2551.      can view the Nyx homepage <http://www.nyx.net> which also gives you
  2552.      information on how to get your own free account.
  2553.  
  2554.   15.  Bits and Pieces
  2555.  
  2556.   This is basically a section where I stuff all the bits I have not yet
  2557.   decided where should go, yet that I feel is worth knowing about. It is
  2558.   a kind of transient area.
  2559.  
  2560.   15.1.  Combining swap and /tmp
  2561.  
  2562.   Recently there have been discussions in the various linux related news
  2563.   groups about specialized file systems for temporary storage.  This is
  2564.   partly inspired by the tmpfs on *BSD* and Solaris, as well as swapfs
  2565.   on the NeXT machines.
  2566.  
  2567.   The rationale is that these are temporary storage that normally does
  2568.   not require much space, yet in normal systems you need to reserve a
  2569.   certain amount of space for these. Elementary statistical knowledge
  2570.   tells you (very simplified) that when you sum a number of variables
  2571.   the relative statistical uncertainty decreases. So combining swap and
  2572.   /tmp you do not need to reserve as much space as you otherwise would
  2573.   need.
  2574.  
  2575.   These specialized file system is nothing more than a swappable RAM
  2576.   disk that are swapped out to disk when and only when space is limited,
  2577.   thus effectively putting temporary files on the swap partition.
  2578.  
  2579.   There is, however, a snag. This scheme prevents you from getting
  2580.   parallel activity on swap and /tmp drives so under heavy activity the
  2581.   system takes a bigger performance hit. Put another way, you trade
  2582.   speed to get space. Interleaving across multiple drives reduces this
  2583.   somewhat.
  2584.  
  2585.   15.2.  Interleaved swap drives.
  2586.  
  2587.   This is not striping across several drives, instead drives are
  2588.   accessed in a round robin fashion in order to spread the load in a
  2589.   crude fashion.  In Linux you additionally have a priority parameter
  2590.   you can adjust for tuning your system, especially useful if your disks
  2591.   differs  significantly in speed. Check man 8 swapon as well as man 2
  2592.   swapon for more information.
  2593.  
  2594.   15.3.  Swap partition: to use or not to use
  2595.  
  2596.   In many cases you do not need a swap partition, for instance if you
  2597.   have plenty of RAM, say, more than 64MB, and you are the sole user of
  2598.   the machine. In this case you can experiment running without a swap
  2599.   partition and check the system logs to see if you ran out of virtual
  2600.   memory at any point.
  2601.  
  2602.   Removing swap partitions have two advantages:
  2603.  
  2604.   ╖  you save disk space (rather obvious really)
  2605.  
  2606.   ╖  you save seek time as swap partitions otherwise would lie in the
  2607.      middle of your disk space.
  2608.  
  2609.   In the end, having a swap partition is like having a heated toilet:
  2610.   you do not use it very often, but you sure appreciate it when you
  2611.   require it.
  2612.  
  2613.   15.4.  Mount point and /mnt
  2614.  
  2615.   In an earlier version of this document I proposed to put all
  2616.   permanently mounted partitions under /mnt. That, however, is not such
  2617.   a good idea as this itself can be used as a mount point, which leads
  2618.   to all mounted partitions becoming unavailable. Instead I will propose
  2619.   mounting straight from root using a meaningful name like
  2620.   /mnt.descriptive-name.
  2621.  
  2622.   Lately I have become aware that some Linux distributions use mount
  2623.   points at subdirectories under /mnt, such as /mnt/floppy and
  2624.   /mnt/cdrom, which just shows how confused the whole issue is.
  2625.   Hopefully FHS should clarify this.
  2626.  
  2627.   15.5.  SCSI id numbers and names
  2628.  
  2629.   Partitions are labeled in the order they are found, not depending on
  2630.   the SCSI id number. This means that if you add a drive with an id
  2631.   number inserted in the previous order of numbers, or change id number
  2632.   in any other way, the partition names will be messed up. This is
  2633.   important if you use removable media. In order to save yourself from
  2634.   some unpleasant experiences, you are recommended to use low numbers
  2635.   for fixed media and reserve the last number(s) for removable media
  2636.   drives.
  2637.  
  2638.   Many have been bitten by this misfeature and there is a strong call
  2639.   for something to be done about it. Nobody knows how soon this will be
  2640.   fixed so in the meantime it is wise to take this into consideration
  2641.   when you design your system. For instance it may be a good idea to use
  2642.   the lowest SCSI id number for you root disk so that it has the least
  2643.   probability of being renumbered should one drive fail.
  2644.  
  2645.   15.6.  Power and Heating
  2646.  
  2647.   Not many years ago a machine with the equivalent power of a modern PC
  2648.   required 3-phase power and cooling, usually by air conditioning the
  2649.   machine room but some times also by water cooling. Technology has
  2650.   progressed very quickly giving not only high speed but also low power
  2651.   components. Still, there is a definite limit to the technology,
  2652.   something one should keep in mind as the system is expanded with yet
  2653.   another disk drive or PCI card. When the power supply is running at
  2654.   full rated power, keep in mind that all this energy is going
  2655.   somewhere, mostly into heat. Unless this is dissipated using fans you
  2656.   will get a serious heating inside the cabinet followed by a reduced
  2657.   reliability and also life time of the electronics.  Manufacturers
  2658.   state minimum cooling requirements for their drives, usually in terms
  2659.   of cubic feet per minute (CFM). You are well advised to take this
  2660.   serious.
  2661.  
  2662.   Keep air flow passages open, clean out dust and check the temperature
  2663.   of your system running. If it is too hot to touch it is probably
  2664.   running too hot.
  2665.  
  2666.   If possible use sequential spin up for the drives. It is during spin
  2667.   up, when the drive platters accelerate up to normal speed, that a
  2668.   drive consumes maximum power and if all drives start up simultaneously
  2669.   you could go beyond the rated power maximum of your power supply.
  2670.  
  2671.   15.7.  Dejanews
  2672.  
  2673.   This is an Internet system that no doubt most of you are familiar
  2674.   with.  It searches and serves Usenet News articles from 1995 and to
  2675.   the latest postings and also offers a web based reading and posting
  2676.   interface.  There is a lot more, check out Dejanews
  2677.   <http://www.dejanews.com> for more information.
  2678.  
  2679.   What perhaps is less known, is that they use about 20 Linux SMP
  2680.   computers each of which uses the md module to manage between 4 and 24
  2681.   Gig of disk space (over 150 Gig altogether) for this service.  The
  2682.   system is continuously growing but at the time of writing they use
  2683.   mostly dual Pentium Pro 200MHz systems with 256M RAM.
  2684.  
  2685.   A production machine normally has 1 disk for the operating system and
  2686.   between 4 and 6 disks managed by the md module where the articles are
  2687.   archived.  The drives are connected to BusLogic Model BT-946C PCI SCSI
  2688.   adapters, usually two to a machine.
  2689.  
  2690.   Just in case: this is not an advertisement, it is stated as an example
  2691.   of how much is required for what is a major Internet service.
  2692.  
  2693.   15.8.  File system structure
  2694.  
  2695.   There are many file system structures in existence, differing with
  2696.   FSSTND (and soon FHS) to varying degree both in terms of philosophy,
  2697.   strategy and implementation. It is not possible to detail all here,
  2698.   instead the interested reader should read the relevant manual page,
  2699.   man hier which is available on many platforms and implementations.
  2700.  
  2701.   15.9.  Track numbering and optimizing schemes
  2702.  
  2703.   In the old days the file system used to take advantage of knowing the
  2704.   physical drive parameters in order to optimize transfers, for instance
  2705.   by endeavouring to keep a file within a single track if possible which
  2706.   saves track-to-track seek time. These days with logical drive
  2707.   parameters, drive cache and schemes to map out bad sectors, such
  2708.   optimizations become meaningless and might even cost more than it
  2709.   would gain. As most Linux installations use modern file systems these
  2710.   schemes are not used, however, some other operating systems have
  2711.   retained such schemes.
  2712.  
  2713.   16.  Appendix A: Partitioning layout table: mounting and linking
  2714.  
  2715.   The following table is designed to make layout a simpler paper and
  2716.   pencil exercise. It is probably best to print it out (using NON
  2717.   PROPORTIONAL fonts) and adjust the numbers until you are happy with
  2718.   them.
  2719.  
  2720.   Mount point is what directory you wish to mount a partition on or the
  2721.   actual device. This is also a good place to note how you plan to use
  2722.   symbolic links.
  2723.  
  2724.   The size given corresponds to a fairly big Debian 1.2.6 installation.
  2725.   Other examples are coming later.
  2726.  
  2727.   Mainly you use this table to select what structure and drives you will
  2728.   use, the partition numbers and letters will come from the next two
  2729.   tables.
  2730.  
  2731.   Directory       Mount point     speed   seek    transfer        size    SIZE
  2732.  
  2733.   swap            __________      ooooo   ooooo   ooooo           32      ____
  2734.  
  2735.   /               __________      o       o       o               20      ____
  2736.  
  2737.   /tmp            __________      oooo    oooo    oooo                    ____
  2738.  
  2739.   /var            __________      oo      oo      oo              25      ____
  2740.   /var/tmp        __________      oooo    oooo    oooo                    ____
  2741.   /var/spool      __________                                              ____
  2742.   /var/spool/mail __________      o       o       o                       ____
  2743.   /var/spool/news __________      ooo     ooo     oo                      ____
  2744.   /var/spool/____ __________      ____    ____    ____                    ____
  2745.  
  2746.   /home           __________      oo      oo      oo                      ____
  2747.  
  2748.   /usr            __________                                      500     ____
  2749.   /usr/bin        __________      o       oo      o               250     ____
  2750.   /usr/lib        __________      oo      oo      ooo             200     ____
  2751.   /usr/local      __________                                              ____
  2752.   /usr/local/bin  __________      o       oo      o                       ____
  2753.   /usr/local/lib  __________      oo      oo      ooo                     ____
  2754.   /usr/local/____ __________                                              ____
  2755.   /usr/src        __________      o       oo      o               50      ____
  2756.  
  2757.   DOS             __________      o       o       o                       ____
  2758.   Win             __________      oo      oo      oo                      ____
  2759.   NT              __________      ooo     ooo     ooo                     ____
  2760.  
  2761.   /mnt._________  __________      ____    ____    ____                    ____
  2762.   /mnt._________  __________      ____    ____    ____                    ____
  2763.   /mnt._________  __________      ____    ____    ____                    ____
  2764.   /_____________  __________      ____    ____    ____                    ____
  2765.   /_____________  __________      ____    ____    ____                    ____
  2766.   /_____________  __________      ____    ____    ____                    ____
  2767.  
  2768.   Total capacity:
  2769.  
  2770.   17.  Appendix B: Partitioning layout table: numbering and sizing
  2771.  
  2772.   This table follows the same logical structure as the table above where
  2773.   you decided what disk to use. Here you select the physical tracking,
  2774.   keeping in mind the effect of track positioning mentioned earlier in
  2775.   ``Physical Track Positioning''.
  2776.  
  2777.   The final partition number will come out of the table after this.
  2778.  
  2779.   Directory         sda     sdb     sdc     hda     hdb     hdc     ___
  2780.  
  2781.   SCSI ID         |  __   |  __   |  __   |
  2782.  
  2783.   swap            |       |       |       |       |       |       |
  2784.  
  2785.   /               |       |       |       |       |       |       |
  2786.  
  2787.   /tmp            |       |       |       |       |       |       |
  2788.  
  2789.   /var            :       :       :       :       :       :       :
  2790.   /var/tmp        |       |       |       |       |       |       |
  2791.   /var/spool      :       :       :       :       :       :       :
  2792.   /var/spool/mail |       |       |       |       |       |       |
  2793.   /var/spool/news :       :       :       :       :       :       :
  2794.   /var/spool/____ |       |       |       |       |       |       |
  2795.  
  2796.   /home           |       |       |       |       |       |       |
  2797.  
  2798.   /usr            |       |       |       |       |       |       |
  2799.   /usr/bin        :       :       :       :       :       :       :
  2800.   /usr/lib        |       |       |       |       |       |       |
  2801.   /usr/local      :       :       :       :       :       :       :
  2802.   /usr/local/bin  |       |       |       |       |       |       |
  2803.   /usr/local/lib  :       :       :       :       :       :       :
  2804.   /usr/local/____ |       |       |       |       |       |       |
  2805.   /usr/src        :       :       :       :
  2806.  
  2807.   DOS             |       |       |       |       |       |       |
  2808.   Win             :       :       :       :       :       :       :
  2809.   NT              |       |       |       |       |       |       |
  2810.  
  2811.   /mnt.___/_____  |       |       |       |       |       |       |
  2812.   /mnt.___/_____  :       :       :       :       :       :       :
  2813.   /mnt.___/_____  |       |       |       |       |       |       |
  2814.   /_____________  :       :       :       :       :       :       :
  2815.   /_____________  |       |       |       |       |       |       |
  2816.   /_____________  :       :       :       :       :       :       :
  2817.  
  2818.   Total capacity:
  2819.  
  2820.   18.  Appendix C: Partitioning layout table: partition placement
  2821.  
  2822.   This is just to sort the partition numbers in ascending order ready to
  2823.   input to fdisk or cfdisk. Here you take physical track positioning
  2824.   into account when finalizing your design. These numbers and letters
  2825.   are then used to update the previous tables, all of which you will
  2826.   find very useful in later maintenance.
  2827.  
  2828.           Drive :   sda     sdb     sdc     hda     hdb     hdc     ___
  2829.  
  2830.   Total capacity: |       |       |       |       |       |       |
  2831.  
  2832.   Partition
  2833.  
  2834.   1               |       |       |       |       |       |       |
  2835.   2               :       :       :       :       :       :       :
  2836.   3               |       |       |       |       |       |       |
  2837.   4               :       :       :       :       :       :       :
  2838.   5               |       |       |       |       |       |       |
  2839.   6               :       :       :       :       :       :       :
  2840.   7               |       |       |       |       |       |       |
  2841.   8               :       :       :       :       :       :       :
  2842.   9               |       |       |       |       |       |       |
  2843.   10              :       :       :       :       :       :       :
  2844.   11              |       |       |       |       |       |       |
  2845.   12              :       :       :       :       :       :       :
  2846.   13              |       |       |       |       |       |       |
  2847.   14              :       :       :       :       :       :       :
  2848.   15              |       |       |       |       |       |       |
  2849.   16              :       :       :       :       :       :       :
  2850.  
  2851.   19.  Appendix D: Example: Multipurpose server
  2852.  
  2853.   The following table is from the setup of a medium sized multipurpose
  2854.   server where I work. Aside from being a general Linux machine it will
  2855.   also be a network related server (DNS, mail, FTP, news, printers etc.)
  2856.   X server for various CAD programs, CD ROM burner and many other
  2857.   things.  The files reside on 3 SCSI drives with a capacity of 600,
  2858.   1000 and 1300 MB.
  2859.  
  2860.   Some further speed could possibly be gained by splitting /usr/local
  2861.   from the rest of the /usr system but we deemed the further added
  2862.   complexity would not be worth it. With another couple of drives this
  2863.   could be more worthwhile. In this setup drive sda is old and slow and
  2864.   could just a well be replaced by an IDE drive. The other two drives
  2865.   are both rather fast. Basically we split most of the load between
  2866.   these two. To reduce dangers of imbalance in partition sizing we have
  2867.   decided to keep /usr/bin and /usr/local/bin in one drive and /usr/lib
  2868.   and /usr/local/lib on another separate drive which also affords us
  2869.   some drive parallelizing.
  2870.  
  2871.   Even more could be gained by using RAID but we felt that as a server
  2872.   we needed more reliability than is currently afforded by the md patch
  2873.   and a dedicated RAID controller was out of our reach.
  2874.  
  2875.   20.  Appendix E: Example: mounting and linking
  2876.  
  2877.   Directory       Mount point     speed   seek    transfer        size    SIZE
  2878.  
  2879.   swap            sdb2, sdc2      ooooo   ooooo   ooooo           32      2x64
  2880.  
  2881.   /               sda2            o       o       o               20       100
  2882.  
  2883.   /tmp            sdb3            oooo    oooo    oooo                     300
  2884.  
  2885.   /var            __________      oo      oo      oo                      ____
  2886.   /var/tmp        sdc3            oooo    oooo    oooo                     300
  2887.   /var/spool      sdb1                                                     436
  2888.   /var/spool/mail __________      o       o       o                       ____
  2889.   /var/spool/news __________      ooo     ooo     oo                      ____
  2890.   /var/spool/____ __________      ____    ____    ____                    ____
  2891.  
  2892.   /home           sda3            oo      oo      oo                       400
  2893.  
  2894.   /usr            sdb4                                            230      200
  2895.   /usr/bin        __________      o       oo      o               30      ____
  2896.   /usr/lib        -> libdisk      oo      oo      ooo             70      ____
  2897.   /usr/local      __________                                              ____
  2898.   /usr/local/bin  __________      o       oo      o                       ____
  2899.   /usr/local/lib  -> libdisk      oo      oo      ooo                     ____
  2900.   /usr/local/____ __________                                              ____
  2901.   /usr/src        ->/home/usr.src o       oo      o               10      ____
  2902.  
  2903.   DOS             sda1            o       o       o                        100
  2904.   Win             __________      oo      oo      oo                      ____
  2905.   NT              __________      ooo     ooo     ooo                     ____
  2906.  
  2907.   /mnt.libdisk    sdc4            oo      oo      ooo                      226
  2908.   /mnt.cd         sdc1            o       o       oo                       710
  2909.  
  2910.   Total capacity: 2900 MB
  2911.  
  2912.   21.  Appendix F: Example: numbering and sizing
  2913.  
  2914.   Here we do the adjustment of sizes and positioning.
  2915.  
  2916.   Directory         sda     sdb     sdc
  2917.  
  2918.   swap            |       |   64  |   64  |
  2919.  
  2920.   /               |  100  |       |       |
  2921.  
  2922.   /tmp            |       |  300  |       |
  2923.  
  2924.   /var            :       :       :       :
  2925.   /var/tmp        |       |       |  300  |
  2926.   /var/spool      :       :  436  :       :
  2927.   /var/spool/mail |       |       |       |
  2928.   /var/spool/news :       :       :       :
  2929.   /var/spool/____ |       |       |       |
  2930.  
  2931.   /home           |  400  |       |       |
  2932.  
  2933.   /usr            |       |  200  |       |
  2934.   /usr/bin        :       :       :       :
  2935.   /usr/lib        |       |       |       |
  2936.   /usr/local      :       :       :       :
  2937.   /usr/local/bin  |       |       |       |
  2938.   /usr/local/lib  :       :       :       :
  2939.   /usr/local/____ |       |       |       |
  2940.   /usr/src        :       :       :       :
  2941.  
  2942.   DOS             |  100  |       |       |
  2943.   Win             :       :       :       :
  2944.   NT              |       |       |       |
  2945.  
  2946.   /mnt.libdisk    |       |       |  226  |
  2947.   /mnt.cd         :       :       :  710  :
  2948.   /mnt.___/_____  |       |       |       |
  2949.  
  2950.   Total capacity: |  600  | 1000  | 1300  |
  2951.  
  2952.   22.  Appendix G: Example: partition placement
  2953.  
  2954.   This is just to sort the partition numbers in ascending order ready to
  2955.   input to fdisk or cfdisk.
  2956.  
  2957.                Drive :   sda     sdb     sdc
  2958.  
  2959.        Total capacity: |   600 |  1000 |  1300 |
  2960.  
  2961.        Partition
  2962.  
  2963.        1               |   100 |   436 |   710 |
  2964.        2               :   100 :    64 :    64 :
  2965.        3               |   400 |   300 |   300 |
  2966.        4               :       :   200 :   226 :
  2967.  
  2968.   23.  Appendix H: Example II
  2969.  
  2970.   The following is an example of a server setup in an academic setting,
  2971.   and is contributed by nakano@apm.seikei.ac.jp. I have only done minor
  2972.   editing to this section.
  2973.  
  2974.   /var/spool/delegate is a directory for storing logs and cache files of
  2975.   an WWW proxy server program, "delegated". Since I don't notice it
  2976.   widely, there are 1000--1500 requests/day currently, and average disk
  2977.   usage is 15--30% with expiration of caches each day.
  2978.  
  2979.   /mnt.archive is used for data files which are big and not frequently
  2980.   referenced such a s experimental data (especially graphic ones),
  2981.   various source archives, and Win95 backups (growing very fast...).
  2982.  
  2983.   /mnt.root is backup root file system containing rescue utilities. A
  2984.   boot floppy is also prepared to boot with this partition.
  2985.  
  2986.   =================================================
  2987.   Directory               sda      sdb     hda
  2988.  
  2989.   swap                    |    64 |    64 |       |
  2990.   /                       |       |       |    20 |
  2991.   /tmp                    |       |       |   180 |
  2992.  
  2993.   /var                    :   300 :       :       :
  2994.   /var/tmp                |       |   300 |       |
  2995.   /var/spool/delegate     |   300 |       |       |
  2996.  
  2997.   /home                   |       |       |   850 |
  2998.   /usr                    |   360 |       |       |
  2999.   /usr/lib                -> /mnt.lib/usr.lib
  3000.   /usr/local/lib          -> /mnt.lib/usr.local.lib
  3001.  
  3002.   /mnt.lib                |       |   350 |       |
  3003.   /mnt.archive            :       :  1300 :       :
  3004.   /mnt.root               |       |    20 |       |
  3005.  
  3006.   Total capacity:            1024    2034    1050
  3007.  
  3008.   =================================================
  3009.           Drive :           sda     sdb     hda
  3010.   Total capacity:         |  1024 |  2034 |  1050 |
  3011.  
  3012.   Partition
  3013.   1                       |   300 |    20 |    20 |
  3014.   2                       :    64 :  1300 :   180 :
  3015.   3                       |   300 |    64 |   850 |
  3016.   4                       :   360 :   ext :       :
  3017.   5                       |       |   300 |       |
  3018.   6                       :       :   350 :       :
  3019.  
  3020.   Filesystem         1024-blocks  Used Available Capacity Mounted on
  3021.   /dev/hda1              19485   10534     7945     57%   /
  3022.   /dev/hda2             178598      13   169362      0%   /tmp
  3023.   /dev/hda3             826640  440814   343138     56%   /home
  3024.   /dev/sda1             306088   33580   256700     12%   /var
  3025.   /dev/sda3             297925   47730   234807     17%   /var/spool/delegate
  3026.   /dev/sda4             363272  170872   173640     50%   /usr
  3027.   /dev/sdb5             297598       2   282228      0%   /var/tmp
  3028.   /dev/sdb2            1339248  302564   967520     24%   /mnt.archive
  3029.   /dev/sdb6             323716   78792   228208     26%   /mnt.lib
  3030.  
  3031.   Apparently /tmp and /var/tmp is too big. These directories shall be
  3032.   packed together into one partition when disk space shortage comes.
  3033.  
  3034.   /mnt.lib is also seemed to be, but I plan to install newer TeX and
  3035.   ghostscript archives, so /usr/local/lib may grow about 100M or so
  3036.   (since we must use Japanese fonts!).
  3037.  
  3038.   Whole system is backed up by Seagate Tapestore 8000 (Travan TR-4,
  3039.   4G/8G).
  3040.  
  3041.   24.  Appendix I: Example III: SPARC Solaris
  3042.  
  3043.   The following section is the basic design used at work for a number of
  3044.   Sun SPARC servers running Solaris 2.5.1 in an industrial development
  3045.   environment. It serves a number of database and cad applications in
  3046.   addition to the normal services such as mail.
  3047.  
  3048.   Simplicity is emphasized here so /usr/lib has not been split off from
  3049.   /usr.
  3050.  
  3051.   This is the basic layout, planned for about 100 users.
  3052.  
  3053.           Drive:        SCSI 0                      SCSI 1
  3054.  
  3055.           Partition     Size (MB)   Mount point    Size (MB)   Mount point
  3056.  
  3057.             0           160         swap           160         swap
  3058.             1           100         /tmp           100         /var/tmp
  3059.             2           400         /usr
  3060.             3           100         /
  3061.             4            50         /var
  3062.             5
  3063.             6           remainder   /local0        remainder   /local1
  3064.  
  3065.   Due to specific requirements at this place it is at times necessary to
  3066.   have large partitions available on a short notice. Therefore drive 0
  3067.   is given as many tasks as feasible, leaving a large /local1 partition.
  3068.  
  3069.   This setup has been in use for some time now and found satisfactorily.
  3070.  
  3071.   For a more general system it would be better to swap /tmp and /var/tmp
  3072.   and then more /var to drive 1.
  3073.  
  3074.