home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / multdsks.txt < prev    next >
Text File  |  1997-07-07  |  133KB  |  3,060 lines

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