home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD1.iso / doc / HOWTO / Multi-Disk-HOWTO < prev    next >
Text File  |  1998-10-14  |  175KB  |  4,423 lines

  1.   HOWTO: Multi Disk System Tuning
  2.   Stein Gjoen, sgjoen@nyx.net
  3.   v0.17, 3 February 1998
  4.  
  5.   This document describes how best to use multiple disks and partitions
  6.   for a Linux system. Although some of this text is Linux specific the
  7.   general approach outlined here can be applied to many other multi
  8.   tasking operating systems.
  9.   ______________________________________________________________________
  10.  
  11.   Table of Contents
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.   1. Introduction
  68.  
  69.      1.1 Copyright
  70.      1.2 Disclaimer
  71.      1.3 News
  72.      1.4 Credits
  73.  
  74.   2. Structure
  75.  
  76.      2.1 Logical structure
  77.      2.2 Document structure
  78.  
  79.   3. Drive technologies
  80.  
  81.      3.1 Drives
  82.      3.2 Geometry
  83.      3.3 Media
  84.         3.3.1 Magnetic Drives
  85.         3.3.2 Optical drives
  86.         3.3.3 Solid State Drives
  87.      3.4 Interfaces
  88.         3.4.1 MFM and RLL
  89.         3.4.2 ESDI
  90.         3.4.3 IDE and ATA
  91.         3.4.4 EIDE, Fast-ATA and ATA-2
  92.         3.4.5 Ultra-ATA
  93.         3.4.6 ATAPI
  94.         3.4.7 SCSI
  95.      3.5 Cabling
  96.      3.6 Host Adapters
  97.      3.7 Multi Channel Systems
  98.      3.8 Multi Board Systems
  99.      3.9 Speed Comparison
  100.         3.9.1 Controllers
  101.         3.9.2 Bus types
  102.      3.10 Benchmarking
  103.      3.11 Comparisons
  104.      3.12 Future Development
  105.      3.13 Recommendations
  106.  
  107.   4. Considerations
  108.  
  109.      4.1 File system features
  110.         4.1.1 Swap
  111.         4.1.2 Temporary storage (
  112.         4.1.3 Spool areas (
  113.         4.1.4 Home directories (
  114.         4.1.5 Main binaries (
  115.         4.1.6 Libraries (
  116.         4.1.7 Root
  117.         4.1.8 DOS etc.
  118.      4.2 Explanation of terms
  119.         4.2.1 Speed
  120.         4.2.2 Reliability
  121.         4.2.3 Files
  122.      4.3 Technologies
  123.         4.3.1 RAID
  124.         4.3.2 AFS, Veritas and Other Volume Management Systems
  125.         4.3.3 Linux
  126.         4.3.4 General File System Consideration
  127.         4.3.5 CD-ROM File Systems
  128.         4.3.6 Compression
  129.         4.3.7 Other filesystems
  130.         4.3.8 Physical Track Positioning
  131.  
  132.   5. Other Operating Systems
  133.      5.1 DOS
  134.      5.2 Windows
  135.      5.3 OS/2
  136.      5.4 NT
  137.      5.5 Sun OS
  138.         5.5.1 Sun OS 4
  139.         5.5.2 Sun OS 5 (aka Solaris)
  140.  
  141.   6. Clusters
  142.  
  143.   7. Mount Points
  144.  
  145.   8. Disk Layout
  146.  
  147.      8.1 Selection for partitioning
  148.      8.2 Mapping partitions to drives
  149.      8.3 Sorting partitions on drives
  150.      8.4 Optimizing
  151.         8.4.1 Optimizing by characteristics
  152.         8.4.2 Optimizing by drive parallelising
  153.      8.5 Usage requirements
  154.      8.6 Servers
  155.         8.6.1 Home directories
  156.         8.6.2 Anonymous FTP
  157.         8.6.3 WWW
  158.         8.6.4 Mail
  159.         8.6.5 News
  160.         8.6.6 Others
  161.      8.7 Pitfalls
  162.      8.8 Compromises
  163.  
  164.   9. Implementation
  165.  
  166.      9.1 Drives and Partitions
  167.      9.2 Partitioning
  168.      9.3 Multiple devices (
  169.      9.4 Formatting
  170.      9.5 Mounting
  171.  
  172.   10. Maintenance
  173.  
  174.      10.1 Backup
  175.      10.2 Defragmentation
  176.      10.3 Deletions
  177.      10.4 Upgrades
  178.  
  179.   11. Advanced Issues
  180.  
  181.      11.1 Hard Disk Tuning
  182.      11.2 File System Tuning
  183.      11.3 Spindle Synchronizing
  184.  
  185.   12. Further Information
  186.  
  187.      12.1 News groups
  188.      12.2 Mailing lists
  189.      12.3 HOWTO
  190.      12.4 Mini-HOWTO
  191.      12.5 Local resources
  192.      12.6 Web pages
  193.      12.7 Search engines
  194.  
  195.   13. Getting Help
  196.  
  197.   14. Concluding Remarks
  198.  
  199.      14.1 Coming Soon
  200.      14.2 Request for Information
  201.      14.3 Suggested Project Work
  202.  
  203.   15. Questions and Answers
  204.  
  205.   16. Bits and Pieces
  206.  
  207.      16.1 Combining
  208.      16.2 Interleaved
  209.      16.3 Swap partition: to use or not to use
  210.      16.4 Mount point and
  211.      16.5 SCSI id numbers and names
  212.      16.6 Power and Heating
  213.      16.7 Dejanews
  214.      16.8 File system structure
  215.      16.9 Track numbering and optimizing schemes
  216.  
  217.   17. Appendix A: Partitioning layout table: mounting and linking
  218.  
  219.   18. Appendix B: Partitioning layout table: numbering and sizing
  220.  
  221.   19. Appendix C: Partitioning layout table: partition placement
  222.  
  223.   20. Appendix D: Example: Multipurpose server
  224.  
  225.   21. Appendix E: Example: mounting and linking
  226.  
  227.   22. Appendix F: Example: numbering and sizing
  228.  
  229.   23. Appendix G: Example: partition placement
  230.  
  231.   24. Appendix H: Example II
  232.  
  233.   25. Appendix I: Example III: SPARC Solaris
  234.  
  235.  
  236.  
  237.   ______________________________________________________________________
  238.  
  239.   1.  Introduction
  240.  
  241.  
  242.   For strange and artistic reasons this brand new release is code named
  243.   the Daybreak release.
  244.  
  245.   New code names will appear as per industry standard guidelines to
  246.   emphasize the state-of-the-art-ness of this document.
  247.  
  248.  
  249.   This document was written for two reasons, mainly because I got hold
  250.   of 3 old SCSI disks to set up my Linux system on and I was pondering
  251.   how best to utilise the inherent possibilities of parallelizing in a
  252.   SCSI system. Secondly I hear there is a prize for people who write
  253.   documents...
  254.  
  255.   This is intended to be read in conjunction with the Linux Filesystem
  256.   Structure Standard (FSSTND). It does not in any way replace it but
  257.   tries to suggest where physically to place directories detailed in the
  258.   FSSTND, in terms of drives, partitions, types, RAID, file system (fs),
  259.   physical sizes and other parameters that should be considered and
  260.   tuned in a Linux system, ranging from single home systems to large
  261.   servers on the Internet.
  262.  
  263.   Even though it is now more than a year since last release of the
  264.   FSSTND work is still continuing, under a new name, and will encompass
  265.   more than Linux, fill in a few blanks hinted at in FSSTND version 1.2
  266.   as well as other general improvements. The development mailing list is
  267.   currently private but a general release is hopefully in the near
  268.   future. The new issue will be named Filesystem Hierarchy Standard
  269.   (FHS) and will cover more than Linux alone. Very recently FHS version
  270.   2.0 was released but there are still a few issues to be dealt with and
  271.   even longer before this new standard will have an impact on actual
  272.   distribusions.
  273.  
  274.   It is also a good idea to read the Linux Installation guides
  275.   thoroughly and if you are using a PC system, which I guess the
  276.   majority still does, you can find much relevant and useful information
  277.   in the FAQs for the newsgroup comp.sys.ibm.pc.hardware especially for
  278.   storage media.
  279.  
  280.   This is also a learning experience for myself and I hope I can start
  281.   the ball rolling with this HOWTO and that it perhaps can evolve into a
  282.   larger more detailed and hopefully even more correct HOWTO.
  283.  
  284.  
  285.   First of all we need a bit of legalese. Recent development shows it is
  286.   quite important.
  287.  
  288.  
  289.   1.1.  Copyright
  290.  
  291.  
  292.   This HOWTO is copyrighted 1996 Stein Gjoen.
  293.  
  294.   Unless otherwise stated, Linux HOWTO documents are copyrighted by
  295.   their respective authors. Linux HOWTO documents may be reproduced and
  296.   distributed in whole or in part, in any medium physical or electronic,
  297.   as long as this copyright notice is retained on all copies. Commercial
  298.   redistribution is allowed and encouraged; however, the author would
  299.   like to be notified of any such distributions.
  300.  
  301.   All translations, derivative works, or aggregate works incorporating
  302.   any Linux HOWTO documents must be covered under this copyright notice.
  303.   That is, you may not produce a derivative work from a HOWTO and impose
  304.   additional restrictions on its distribution. Exceptions to these rules
  305.   may be granted under certain conditions; please contact the Linux
  306.   HOWTO coordinator at the address given below.
  307.  
  308.   In short, we wish to promote dissemination of this information through
  309.   as many channels as possible. However, we do wish to retain copyright
  310.   on the HOWTO documents, and would like to be notified of any plans to
  311.   redistribute the HOWTOs.
  312.  
  313.   If you have questions, please contact Tim Bynum, the Linux HOWTO
  314.   coordinator, at linux-howto@sunsite.unc.edu via email.
  315.  
  316.  
  317.   1.2.  Disclaimer
  318.  
  319.  
  320.   Use the information in this document at your own risk. I disavow any
  321.   potential liability for the contents of this document. Use of the
  322.   concepts, examples, and/or other content of this document is entirely
  323.   at your own risk.
  324.  
  325.   All copyrights are owned by their owners, unless specifically noted
  326.   otherwise.  Use of a term in this document should not be regarded as
  327.   affecting the validity of any trademark or service mark.
  328.  
  329.   Naming of particular products or brands should not be seen as
  330.   endorsements.
  331.   You are strongly recommended to take a backup of your system before
  332.   major installation and backups at regular intervals.
  333.  
  334.  
  335.  
  336.   1.3.  News
  337.  
  338.  
  339.   The most recent news is that FHS version 2.0 is released and the work
  340.   is picing up momentum. No linux distributions using FHS has been
  341.   announced yet but when that happens there will have to be a few
  342.   rewrites to this HOWTO. And speaking of HOWTO, I have now dropped all
  343.   pretenses and removed the 'mini' prefix, as this was becoming
  344.   something of a joke.
  345.  
  346.   A recent addition is a new section on how best to get help should you
  347.   find yourself unable to solve your problems as well as more suggestion
  348.   on maintenance.
  349.  
  350.   Due to an enormous amount of spam I have been forced to mangle all e-
  351.   mail addresses herein in order to fool the e-mail harvesters that scan
  352.   through the net for victims to be put on the lists. Feedbeck tells me
  353.   some damage has already happened, this is very unfortunate.  Mangiling
  354.   is done by replacing the @ character with  (at)
  355.  
  356.   A number of pointers to relevant mailing lists are also added.
  357.  
  358.   Since the 0.14 version was released there have been too many changes
  359.   to list here. I have received much input and a substantial patch from
  360.   kris (at) koentopp.de that adds many new details.  The document has
  361.   grown a lot, actually beyond expectations.
  362.  
  363.  
  364.   I have also upgraded my system to Debian 1.2.6 and have replaced the
  365.   old Slackware values with the Debian values for disk space
  366.   requirements for the various directory. I will use Debian as a base
  367.   for discussions and examples here, though the HOWTO is equally
  368.   applicable to other distributions, even other operating systems. At
  369.   the time of writing this Debian 1.3 is out in beta and will soon be
  370.   used as the test bench for further versions of this document.
  371.  
  372.   More news: there has been a fair bit of interest in new kinds of file
  373.   systems in the comp.os.linux newsgroups, in particular logging,
  374.   journaling and inherited file systems. Watch out for updates. Projects
  375.   on volume management is also under way. The old defragmentation
  376.   program for ext2fs is being updated and there is continuing interests
  377.   for compression.
  378.  
  379.   The latest version number of this document can be gleaned from my plan
  380.   entry if you finger <finger:sgjoen@nox.nyx.net> my Nyx account.
  381.  
  382.   Also, the latest version will be available on my web space on nyx: The
  383.   Multi Disk System Tuning HOWTO Homepage
  384.   <http://www.nyx.net/~sgjoen/disk.html>.
  385.  
  386.   A text-only version as well as the SGML source can also be downloaded
  387.   there.  A nicely formatted postscript version is also available now.
  388.   In order to save disk space and bandwidth it has been compressed using
  389.   gzip.
  390.  
  391.   Also planned is a series of URLs to helpful software referred to in
  392.   this document. A mirror in Europe will be announced soon.
  393.  
  394.   I have very recently changed jobs, address etc so there will be a few
  395.   delays in updates before I get the time for a more systematic updates.
  396.  
  397.   From version 0.15 onward this document is primarily handled as an SGML
  398.   document which means future printouts should look nicer than the old
  399.   text based version. This also means that it has more or less grown
  400.   into a full HOWTO. With respect to size it must be admitted it is a
  401.   long time since there was anything "mini" about it.
  402.  
  403.  
  404.   1.4.  Credits
  405.  
  406.   In this version I have the pleasure of acknowledging even more people
  407.   who have contributed in one way or another:
  408.  
  409.  
  410.  
  411.        ronnej (at ) ucs.orst.edu
  412.        cm (at) kukuruz.ping.at
  413.        armbru (at) pond.sub.org
  414.        R.P.Blake (at) open.ac.uk
  415.        neuffer (at) goofy.zdv.Uni-Mainz.de
  416.        sjmudd (at) redestb.es
  417.        nat (at) nataa.fr.eu.org
  418.        sundbyk (at) horten.geco-prakla.slb.com
  419.        gjoen (at) sn.no
  420.        mike (at) i-Connect.Net
  421.        roth (at) uiuc.edu
  422.        phall (at) ilap.com
  423.        szaka (at) mirror.cc.u-szeged.hu
  424.        CMckeon (at) swcp.com
  425.        kris (at) koentopp.de
  426.        edick (at) idcomm.com
  427.        pot (at) fly.cnuce.cnr.it
  428.        earl (at) sbox.tu-graz.ac.at
  429.        ebacon (at) oanet.com
  430.        vax (at) linkdead.paranoia.com
  431.  
  432.  
  433.  
  434.  
  435.   Special thanks go to nakano (at) apm.seikei.ac.jp for doing the
  436.   Japanese translation <http://jf.linux.or.jp/JF/JF-ftp/other-
  437.   formats/Disk-HOWTO/html/Disk-HOWTO.html>, general contributions as
  438.   well as contributing an example of a computer in an academic setting,
  439.   which is included at the end of this document.
  440.  
  441.   Not many still, so please read through this document, make a
  442.   contribution and join the elite. If I have forgotten anyone, please
  443.   let me know.
  444.  
  445.   New in this version is an appendix with a few tables you can fill in
  446.   for your system in order to simplify the design process.
  447.  
  448.   Any comments or suggestions can be mailed to my mail address on nyx:
  449.   sgjoen@nyx.net.
  450.  
  451.  
  452.   So let's cut to the chase where swap and /tmp are racing along hard
  453.   drive...
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.   2.  Structure
  464.  
  465.   As this type of document is supposed to be as much for learning as a
  466.   technical reference document I have rearranged the structure to this
  467.   end. For the designer of a system it is more useful to have the
  468.   information presented in terms of the goals of this exercise than from
  469.   the point of view of the logical layer structure of the devices
  470.   themselves. Nevertheless this document would not be complete without
  471.   such a layer structure the computer field is so full of, so I will
  472.   include it here as an introduction to how it works.
  473.  
  474.   It is a long time since the mini in mini-HOWTO could be defended as
  475.   proper but I am convinced that this document is as long as it needs to
  476.   be in order to make the right design decisions, and not longer.
  477.  
  478.  
  479.   2.1.  Logical structure
  480.  
  481.   This is based on how each layer access each other, traditionally with
  482.   the application on top and the physical layer on the bottom.  It is
  483.   quite useful to show the interrelationship between each of the layers
  484.   used in controlling drives.
  485.  
  486.  
  487.                ___________________________________________________________
  488.                |__     File structure          ( /usr /tmp etc)        __|
  489.                |__     File system             (ext2fs, vfat etc)      __|
  490.                |__     Volume management       (AFS)                   __|
  491.                |__     RAID, concatenation     (md)                    __|
  492.                |__     Device driver           (SCSI, IDE etc)         __|
  493.                |__     Controller              (chip, card)            __|
  494.                |__     Connection              (cable, network)        __|
  495.                |__     Drive                   (magnetic, optical etc) __|
  496.                -----------------------------------------------------------
  497.  
  498.  
  499.  
  500.  
  501.   In the above diagram both volume management and RAID and concatenation
  502.   are optional layers. The 3 lower layers are in hardware.  All parts
  503.   are discussed at length later on in this document.
  504.  
  505.  
  506.   2.2.  Document structure
  507.  
  508.   Most users start out with a given set of hardware and some plans on
  509.   what they wish to achieve and how big the system should be. This is
  510.   the point of view I will adopt in this document in presenting the
  511.   material, starting out with hardware, continuing with design
  512.   constraints before detailing the design strategy that I have found to
  513.   work well.  I have used this both for my own personal computer at
  514.   home, a multi purpose server at work and found it worked quite well.
  515.   In addition my Japanese co-worker in this project have applied the
  516.   same strategy on a server in an academic setting with similar success.
  517.  
  518.   Finally at the end I have detailed some configuration tables for use
  519.   in your own design. If you have any comments regarding this or notes
  520.   from your own design work I would like to hear from you so this
  521.   document can be upgraded.
  522.  
  523.  
  524.  
  525.   3.  Drive technologies
  526.  
  527.   A far more complete discussion on drive technologies for IBM PCs can
  528.   be found at the home page of The Enhanced IDE/Fast-ATA FAQ
  529.   <http://thef-nym.sci.kun.nl/~pieterh/storage.html> which is also
  530.   regularly posted on Usenet News.  Here I will just present what is
  531.   needed to get an understanding of the technology and get you started
  532.   on your setup.
  533.  
  534.  
  535.   3.1.  Drives
  536.  
  537.   This is the physical device where your data lives and although the
  538.   operating system makes the various types seem rather similar they can
  539.   in actual fact be very different. An understanding of how it works can
  540.   be very useful in your design work. Floppy drives fall outside the
  541.   scope of this document, though should there be a big demand I could
  542.   perhaps be persuaded to add a little here.
  543.  
  544.  
  545.   3.2.  Geometry
  546.  
  547.   Physically disk drives consists of one or more platters containing
  548.   data that is read in and out using sensors mounted on movable heads
  549.   that are fixed with respects to themselves. Data transfers therefore
  550.   happens across all surfaces simultaneously which defines a cylinder of
  551.   tracks. The drive is also divided into sectors containing a number of
  552.   data fields.
  553.  
  554.   Drives are therefore often specified in terms of its geometry: the
  555.   number of Cylinders, Heads and Sectors (CHS).
  556.  
  557.   For various reasons there is now a number of translations between
  558.  
  559.   o  the physical CHS of the drive itself
  560.  
  561.   o  the logical CHS the drive reports to the BIOS or OS
  562.  
  563.   o  the logical CHS used by the OS
  564.  
  565.   Basically it is a mess and a source of much confusion. For more
  566.   information you are strongly recommended to read the Large Disk mini-
  567.   HOWTO
  568.  
  569.  
  570.   3.3.  Media
  571.  
  572.   The media technology determines important parameters such as
  573.   read/write rates, seek times, storage size as well as if it is
  574.   read/write or read only.
  575.  
  576.  
  577.   3.3.1.  Magnetic Drives
  578.  
  579.   This is the typical read-write mass storage medium, and as everything
  580.   else in the computer world, comes in many flavours with different
  581.   properties. Usually this is the fastest technology and offers
  582.   read/write capability. The platter rotates with a constant angular
  583.   velocity (CAV) with a variable physical sector density for more
  584.   efficient magnetic media area utilisation.  In other words, the number
  585.   of bits per unit length is kept roughly constant by increasing the
  586.   number of logical sectors for the outer tracks.
  587.  
  588.   Typical values for rotational speeds are 4500 and 5400 rpm, though
  589.   7200 is also used. Very recently also 10000 rpm has entered the mass
  590.   market.  Seek times are around 10ms, transfer rates quite variable
  591.   from one type to another but typically 4-40 MB/s.  With the extreme
  592.   high performance drives you should remember that performance costs
  593.   more electric power which is dissipated as heat, see the point on
  594.   ``Power and Heating''.
  595.   Note that there are several kinds of transfers going on here, and that
  596.   these are quoted in different units. First of all there is the
  597.   platter-to-drive cache transfer, usually quoted in Mbits/s. Typical
  598.   values here is about 50-250 Mbits/s. The second stage is from the
  599.   built in drive cache to the adapter, and this is typically quoted in
  600.   MB/s, and typical quoted values here is 3-40 MB/s. Note, however, that
  601.   this assumed data is already in the cache and hence for maximum
  602.   readout speed from the drive the effective transfer rate will decrease
  603.   dramatically.
  604.  
  605.  
  606.  
  607.   3.3.2.  Optical drives
  608.  
  609.   Optical read/write drives exist but are slow and not so common. They
  610.   were used in the NeXT machine but the low speed was a source for much
  611.   of the complaints. The low speed is mainly due to the thermal nature
  612.   of the phase change that represents the data storage. Even when using
  613.   relatively powerful lasers to induce the phase changes the effects are
  614.   still slower than the magnetic effect used in magnetic drives.
  615.  
  616.   Today many people use CD-ROM drives which, as the name suggests, is
  617.   read-only. Storage is about 650 MB, transfer speeds are variable,
  618.   depending on the drive but can exceed 1.5 MB/s. Data is stored on a
  619.   spiraling single track so it is not useful to talk about geometry for
  620.   this. Data density is constant so the drive uses constant linear
  621.   velocity (CLV). Seek is also slower, about 100ms, partially due to the
  622.   spiraling track. Recent, high speed drives, use a mix of CLV and CAV
  623.   in order to maximize performance. This also reduces access time caused
  624.   by the need to reach correct rotational speed for readout.
  625.  
  626.   A new type (DVD) is on the horizon, offering up to about 18 GB on a
  627.   single disk.
  628.  
  629.  
  630.   3.3.3.  Solid State Drives
  631.  
  632.   This is a relatively recent addition to the available technology and
  633.   has been made popular especially in portable computers as well as in
  634.   embedded systems. Containing no movable parts they are very fast both
  635.   in terms of access and transfer rates. The most popular type is flash
  636.   RAM, but also other types of RAM is used. A few years ago many had
  637.   great hopes for magnetic bubble memories but it turned out to be
  638.   relatively expensive and is not that common.
  639.  
  640.   In general the use of RAM disks are regarded as a bad idea as it is
  641.   normally more sensible to add more RAM to the motherboard and let the
  642.   operating system divide the memory pool into buffers, cache, program
  643.   and data areas. Only in very special cases, such as real time systems
  644.   with short time margins, can RAM disks be a sensible solution.
  645.  
  646.   Flash RAM is today available in several 10's of megabytes in storage
  647.   and one might be tempted to use it for fast, temporary storage in a
  648.   computer. There is however a huge snag with this: flash RAM has a
  649.   finite life time in terms of the number of times you can rewrite data,
  650.   so putting swap, /tmp or /var/tmp on such a device will certainly
  651.   shorten its lifetime dramatically.  Instead, using flash RAM for
  652.   directories that are read often but rarely written to, will be a big
  653.   performance win.
  654.  
  655.   In order to get the optimum life time out of flash RAM you will need
  656.   to use special drivers that will use the RAM evenly and minimize the
  657.   number of block erases.
  658.  
  659.   This example illustrates the advantages of splitting up your directory
  660.   structure over several devices.
  661.   Solid state drives have no real cylinder/head/sector addressing but
  662.   for compatibility reasons this is simulated by the driver to give a
  663.   uniform interface to the operating system.
  664.  
  665.  
  666.   3.4.  Interfaces
  667.  
  668.   There is a plethora of interfaces to chose from widely ranging in
  669.   price and performance. Most motherboards today include IDE interface
  670.   or better, Intel supports it through the Triton PCI chip set which is
  671.   very popular these days. Many motherboards also include a SCSI
  672.   interface chip made by NCR and that is connected directly to the PCI
  673.   bus.  Check what you have and what BIOS support you have with it.
  674.  
  675.  
  676.   3.4.1.  MFM and RLL
  677.  
  678.   Once upon a time this was the established technology, a time when 20
  679.   MB was awesome, which compared to todays sizes makes you think that
  680.   dinosaurs roamed the Earth with these drives. Like the dinosaurs these
  681.   are outdated and are slow and unreliable compared to what we have
  682.   today. Linux does support this but you are well advised to think twice
  683.   about what you would put on this. One might argue that an emergency
  684.   partition with a suitable vintage of DOS might be fitting.
  685.  
  686.  
  687.   3.4.2.  ESDI
  688.  
  689.   Actually, ESDI was an adaptation of the very widely used SMD interface
  690.   used on "big" computers to the cable set used with the ST506
  691.   interface, which was more convenient to package than the 60-pin +
  692.   26-pin connector pair used with SMD.  The ST506 was a "dumb" interface
  693.   which relied entirely on the controller and host computer to do
  694.   everything from computing head/cylinder/sector locations and keeping
  695.   track of the head location, etc. ST506 required the controller to
  696.   extract clock from the recovered data, and control the physical
  697.   location of detailed track features on the medium, bit by bit. It had
  698.   about a 10-year life if you include the use of MFM, RLL, and ERLL/ARLL
  699.   modulation schemes. ESDI, on the other hand, had intelligence, often
  700.   using three or four separate microprocessors on a single drive, and
  701.   high-level commands to format a track, transfer data, perform seeks,
  702.   and so on. Clock recovery from the data stream was accomplished at the
  703.   drive, which drove the clock line and presented its data in NRZ,
  704.   though error correction was still the task of the controller.  ESDI
  705.   allowed the use of variable bit density recording, or, for that
  706.   matter, any other modulation technique, since it was locally generated
  707.   and resolved at the drive. Though many of the techniques used in ESDI
  708.   were later incorporated in IDE, it was the increased popularity of
  709.   SCSI which led to the demise of ESDI in computers. ESDI had a life of
  710.   about 10 years, though mostly in servers and otherwise "big" systems
  711.   rather than PC's.
  712.  
  713.  
  714.  
  715.   3.4.3.  IDE and ATA
  716.  
  717.   Progress made the drive electronics migrate from the ISA slot card
  718.   over to the drive itself and Integrated Drive Electronics was borne.
  719.   It was simple, cheap and reasonably fast so the BIOS designers
  720.   provided the kind of snag that the computer industry is so full of. A
  721.   combination of an IDE limitation of 16 heads together with the BIOS
  722.   limitation of 1024 cylinders gave us the infamous 504 MB limit.
  723.   Following the computer industry traditions again, the snag was patched
  724.   with a kludge and we got all sorts of translation schemes and BIOS
  725.   bodges. This means that you need to read the installation
  726.   documentation very carefully and check up on what BIOS you have and
  727.   what date it has as the BIOS has to tell Linux what size drive you
  728.   have. Fortunately with Linux you can also tell the kernel directly
  729.   what size drive you have with the drive parameters, check the
  730.   documentation for LILO and Loadlin, thoroughly. Note also that IDE is
  731.   equivalent to ATA, AT Attachment.  IDE uses CPU-intensive Programmed
  732.   Input/Output (PIO) to transfer data to and from the drives and has no
  733.   capability for the more efficient Direct Memory Access (DMA)
  734.   technology. Highest transfer rate is 8.3 MB/s.
  735.  
  736.  
  737.   3.4.4.  EIDE, Fast-ATA and ATA-2
  738.  
  739.   These 3 terms are roughly equivalent, fast-ATA is ATA-2 but EIDE
  740.   additionally includes ATAPI. ATA-2 is what most use these days which
  741.   is faster and with DMA. Highest transfer rate is increased to 16.6
  742.   MB/s.
  743.  
  744.  
  745.  
  746.   3.4.5.  Ultra-ATA
  747.  
  748.   A new, faster DMA mode that is approximately twice the speed of EIDE
  749.   PIO-Mode 4 (33 MB/s). Disks with and without Ultra-ATA can be mixed on
  750.   the same cable without speed penalty for the faster adapters. The
  751.   Ultra-ATA interface is electrically identical with the normal Fast-ATA
  752.   interface, including the maximum cable length.
  753.  
  754.  
  755.   3.4.6.  ATAPI
  756.  
  757.   The ATA Packet Interface was designed to support CD-ROM drives using
  758.   the IDE port and like IDE it is cheap and simple.
  759.  
  760.  
  761.   3.4.7.  SCSI
  762.  
  763.   The Small Computer System Interface is a multi purpose interface that
  764.   can be used to connect to everything from drives, disk arrays,
  765.   printers, scanners and more. The name is a bit of a misnomer as it has
  766.   traditionally been used by the higher end of the market as well as in
  767.   work stations since it is well suited for multi tasking environments.
  768.  
  769.   The standard interface is 8 bits wide and can address 8 devices.
  770.   There is a wide version with 16 bit that is twice as fast on the same
  771.   clock and can address 16 devices. The host adapter always counts as a
  772.   device and is usually number 7.  It is also possible to have 32 bit
  773.   wide busses but this usually requires a double set of cables to carry
  774.   all the lines.
  775.  
  776.   The old standard was 5 MB/s and the newer fast-SCSI increased this to
  777.   10 MB/s. Recently ultra-SCSI, also known as Fast-20, arrived with 20
  778.   MB/s transfer rates for an 8 bit wide bus.
  779.  
  780.   The higher performance comes at a cost that is usually higher than for
  781.   (E)IDE. The importance of correct termination and good quality cables
  782.   cannot be overemphasized. SCSI drives also often tend to be of a
  783.   higher quality than IDE drives. Also adding SCSI devices tend to be
  784.   easier than adding more IDE drives: Often it is only a matter of
  785.   plugging or unplugging the device; some people do this without
  786.   powering down the system. This feature is most convenient when you
  787.   have multiple systems and you can just take the devices from one
  788.   system to the other should one of them fail for some reason.
  789.  
  790.   There is a number of useful documents you should read if you use SCSI,
  791.   the SCSI HOWTO as well as the SCSI FAQ posted on Usenet News.
  792.  
  793.   SCSI also has the advantage you can connect it easily to tape drives
  794.   for backing up your data, as well as some printers and scanners. It is
  795.   even possible to use it as a very fast network between computers while
  796.   simultaneously share SCSI devices on the same bus. Work is under way
  797.   but due to problems with ensuring cache coherency between the
  798.   different computers connected, this is a non trivial task.
  799.  
  800.  
  801.   3.5.  Cabling
  802.  
  803.  
  804.   I do not intend to make too many comments on hardware but I feel I
  805.   should make a little note on cabling. This might seem like a
  806.   remarkably low technological piece of equipment, yet sadly it is the
  807.   source of many frustrating problems. At todays high speeds one should
  808.   think of the cable more of a an RF device with its inherent demands on
  809.   impedance matching. If you do not take your precautions you will get a
  810.   much reduced reliability or total failure. Some SCSI host adapters are
  811.   more sensitive to this than others.
  812.  
  813.   Shielded cables are of course better than unshielded but the price is
  814.   much higher. With a little care you can get good performance from a
  815.   cheap unshielded cable.
  816.  
  817.  
  818.   o  For Fast-ATA and Ultra-ATA, the maximum cable length is specified
  819.      as 45cm (18"). The data lines of both IDE channels are connected on
  820.      many boards, though, so they count as one cable. In any case EIDE
  821.      cables should be as short as possible. If there are mysterious
  822.      crashes or spontaneous changes of data, it is well worth
  823.      investigating your cabling.  Try a lower PIO mode or disconnect the
  824.      second channel and see if the problem still occurs.
  825.  
  826.   o  Use as short cable as possible, but do not forget the 30 cm minimum
  827.      separation for ultra SCSI.
  828.  
  829.   o  Avoid long stubs between the cable and the drive, connect the plug
  830.      on the cable directly to the drive without an extension.
  831.  
  832.   o  Use correct termination for SCSI devices and at the correct
  833.      position: the end of the SCSI chain.
  834.  
  835.   o  Do not mix shielded or unshielded cabling, do not wrap cables
  836.      around metal, try to avoid proximity to metal parts along parts of
  837.      the cabling. Any such discontinuities can cause impedance
  838.      mismatching which in turn can cause reflection of signals which
  839.      increases noise on the cable.  This problems gets even more severe
  840.      in the case of multi channel controllers.  Recently someone
  841.      suggested wrapping bubble plastic around the cables in order to
  842.      avoid too close proximity to metal, a real problem inside crowded
  843.      cabinets.
  844.  
  845.  
  846.   3.6.  Host Adapters
  847.  
  848.  
  849.   This is the other end of the interface from the drive, the part that
  850.   is connected to a computer bus. The speed of the computer bus and that
  851.   of the drives should be roughly similar, otherwise you have a
  852.   bottleneck in your system. Connecting a RAID 0 disk-farm to a ISA card
  853.   is pointless. These days most computers come with 32 bit PCI bus
  854.   capable of 132 MB/s transfers which should not represent a bottleneck
  855.   for most people in the near future.
  856.  
  857.   As the drive electronic migrated to the drives the remaining part that
  858.   became the (E)IDE interface is so small it can easily fit into the PCI
  859.   chip set. The SCSI host adapter is more complex and often includes a
  860.   small CPU of its own and is therefore more expensive and not
  861.   integrated into the PCI chip sets available today. Technological
  862.   evolution might change this.
  863.  
  864.   Some host adapters come with separate caching and intelligence but as
  865.   this is basically second guessing the operating system the gains are
  866.   heavily dependent on which operating system is used. Some of the more
  867.   primitive ones, that shall remain nameless, experience great gains.
  868.   Linux, on the other hand, have so much smarts of its own that the
  869.   gains are much smaller.
  870.  
  871.   Mike Neuffer, who did the drivers for the DPT controllers, states that
  872.   the DPT controllers are intelligent enough that given enough cache
  873.   memory it will give you a big push in performance and suggests that
  874.   people who have experienced little gains with smart controllers just
  875.   have not used a sufficiently intelligent caching controller.
  876.  
  877.  
  878.   3.7.  Multi Channel Systems
  879.  
  880.   In order to increase throughput it is necessary to identify the most
  881.   significant bottlenecks and then eliminate them. In some systems, in
  882.   particular where there are a great number of drives connected, it is
  883.   advantageous to use several controllers working in parallel, both for
  884.   SCSI host adapters as well as IDE controllers which usually have 2
  885.   channels built in. Linux supports this.
  886.  
  887.   Some RAID controllers feature 2 or 3 channels and it pays to spread
  888.   the disk load across all channels. In other words, if you have two
  889.   SCSI drives you want to RAID and a two channel controller, you should
  890.   put each drive on separate channels.
  891.  
  892.  
  893.   3.8.  Multi Board Systems
  894.  
  895.   In addition to having both a SCSI and an IDE in the same machine it is
  896.   also possible to have more than one SCSI controller. Check the SCSI-
  897.   HOWTO on what controllers you can combine. Also you will most likely
  898.   have to tell the kernel it should probe for more than just a single
  899.   SCSI or a single IDE controller. This is done using kernel parameters
  900.   when booting, for instance using LILO.  Check the HOWTOs for SCSI and
  901.   LILO for how to do this.
  902.  
  903.  
  904.   3.9.  Speed Comparison
  905.  
  906.   The following tables are given just to indicate what speeds are
  907.   possible but remember that these are the theoretical maximum speeds.
  908.   All transfer rates are in MB per second and bus widths are measured in
  909.   bits.
  910.  
  911.  
  912.  
  913.   3.9.1.  Controllers
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.   IDE             :       8.3 - 16.7
  926.   Ultra-ATA       :       33
  927.  
  928.   SCSI            :
  929.                           Bus width (bits)
  930.  
  931.   Bus Speed (MHz)         |        8      16      32
  932.   --------------------------------------------------
  933.    5                      |        5      10      20
  934.   10  (fast)              |       10      20      40
  935.   20  (fast-20 / ultra)   |       20      40      80
  936.   40  (fast-40 / ultra-2) |       40      80      --
  937.   --------------------------------------------------
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.   3.9.2.  Bus types
  945.  
  946.  
  947.  
  948.  
  949.        ISA             :       8-12
  950.        EISA            :       33
  951.        VESA            :       40    (Sometimes tuned to 50)
  952.  
  953.        PCI
  954.                                Bus width (bits)
  955.  
  956.        Bus Speed (MHz)         |       32      64
  957.        --------------------------------------------------
  958.        33                      |       132     264
  959.        66                      |       264     528
  960.        --------------------------------------------------
  961.  
  962.  
  963.  
  964.  
  965.  
  966.   3.10.  Benchmarking
  967.  
  968.   This is a very, very difficult topic and I will only make a few
  969.   cautious comments about this minefield. First of all, it is more
  970.   difficult to make comparable benchmarks that have any actual meaning.
  971.   This, however, does not stop people from trying...
  972.  
  973.   Instead one can use benchmarking to diagnose your own system, to check
  974.   it is going as fast as it should, that is, not slowing down.  Also you
  975.   would expect a significant increase when switching from a simple file
  976.   system to RAID, so a lack of performance gain will tell you something
  977.   is wrong.
  978.  
  979.   When you try to benchmark you should not hack up your own, instead
  980.   look up iozone and bonnie and read the documentation very carefully.
  981.   More information about this is coming soon.
  982.  
  983.  
  984.  
  985.   3.11.  Comparisons
  986.  
  987.   SCSI offers more performance than EIDE but at a price.  Termination is
  988.   more complex but expansion not too difficult.  Having more than 4 (or
  989.   in some cases 2) IDE drives can be complicated, with wide SCSI you can
  990.   have up to 15 per adapter.  Some SCSI host adapters have several
  991.   channels thereby multiplying the number of possible drives even
  992.   further.
  993.  
  994.   RLL and MFM is in general too old, slow and unreliable to be of much
  995.   use.
  996.  
  997.  
  998.  
  999.   3.12.  Future Development
  1000.  
  1001.  
  1002.   SCSI-3 is under way and will hopefully be released soon. Faster
  1003.   devices are already being announced, most recently an 80 MB/s monster
  1004.   specification has been proposed.  This is based around the ultra-2
  1005.   standard (which used a 40MHz clock) combined with a 16 bit cable.
  1006.  
  1007.   Some manufacturers already announce SCSI-3 devices but this is
  1008.   currently rather premature as the standard is not yet firm. As the
  1009.   transfer speeds increase the saturation point of the PCI bus is
  1010.   getting closer. Currently the 64 bit version has a limit of 264 MB/s.
  1011.   The PCI transfer rate will in the future be increased from the current
  1012.   33MHz to 66MHz, thereby increasing the limit to 528 MB/s.
  1013.  
  1014.   Another trend is for larger and larger drives. I hear it is possible
  1015.   to get 55 GB on a single drive though this is rather expensive.
  1016.   Currently the optimum storage for your money is about 6.4 GB but also
  1017.   this is continuously increasing. The introduction of DVD will in the
  1018.   near future have a big impact, with nearly 20 GB on a single disk you
  1019.   can have a complete copy of even major FTP sites from around the
  1020.   world. The only thing we can be reasonably sure about the future is
  1021.   that even if it won't get any better, it will definitely be bigger.
  1022.  
  1023.   Addendum: soon after I first wrote this I read that the maximum useful
  1024.   speed for a CD-ROM was 20x as mechanical stability would be too great
  1025.   a problem at these speeds. About one month after that again the first
  1026.   commercial 24x CD-ROMs were available...
  1027.  
  1028.  
  1029.   3.13.  Recommendations
  1030.  
  1031.   My personal view is that EIDE is the best way to start out on your
  1032.   system, especially if you intend to use DOS as well on your machine.
  1033.   If you plan to expand your system over many years or use it as a
  1034.   server I would strongly recommend you get SCSI drives. Currently wide
  1035.   SCSI is a little more expensive. You are generally more likely to get
  1036.   more for your money with standard width SCSI. There is also
  1037.   differential versions of the SCSI bus which increases maximum length
  1038.   of the cable. The price increase is even more substantial and cannot
  1039.   therefore be recommended for normal users.
  1040.  
  1041.   In addition to disk drives you can also connect some types of scanners
  1042.   and printers and even networks to a SCSI bus.
  1043.  
  1044.   Also keep in mind that as you expand your system you will draw ever
  1045.   more power, so make sure your power supply is rated for the job and
  1046.   that you have sufficient cooling. Many SCSI drives offer the option of
  1047.   sequential spin-up which is a good idea for large systems.  See also
  1048.   the point on ``Power and Heating''.
  1049.  
  1050.  
  1051.  
  1052.  
  1053.   4.  Considerations
  1054.  
  1055.   The starting point in this will be to consider where you are and what
  1056.   you want to do. The typical home system starts out with existing
  1057.   hardware and the newly converted Linux user will want to get the most
  1058.   out of existing hardware. Someone setting up a new system for a
  1059.   specific purpose (such as an Internet provider) will instead have to
  1060.   consider what the goal is and buy accordingly. Being ambitious I will
  1061.   try to cover the entire range.
  1062.  
  1063.   Various purposes will also have different requirements regarding file
  1064.   system placement on the drives, a large multiuser machine would
  1065.   probably be best off with the /home directory on a separate disk, just
  1066.   to give an example.
  1067.  
  1068.   In general, for performance it is advantageous to split most things
  1069.   over as many disks as possible but there is a limited number of
  1070.   devices that can live on a SCSI bus and cost is naturally also a
  1071.   factor. Equally important, file system maintenance becomes more
  1072.   complicated as the number of partitions and physical drives increases.
  1073.  
  1074.  
  1075.  
  1076.   4.1.  File system features
  1077.  
  1078.   The various parts of FSSTND have different requirements regarding
  1079.   speed, reliability and size, for instance losing root is a pain but
  1080.   can easily be recovered. Losing /var/spool/mail is a rather different
  1081.   issue. Here is a quick summary of some essential parts and their
  1082.   properties and requirements. Note that this is just a guide, there can
  1083.   be binaries in etc and lib directories, libraries in bin directories
  1084.   and so on.
  1085.  
  1086.  
  1087.  
  1088.   4.1.1.  Swap
  1089.  
  1090.  
  1091.      Speed
  1092.         Maximum! Though if you rely too much on swap you should consider
  1093.         buying some more RAM. Note, however, that on many PC
  1094.         motherboards the cache will not work on RAM above 128 MB.
  1095.  
  1096.  
  1097.      Size
  1098.         Similar as for RAM. Quick and dirty algorithm: just as for tea:
  1099.         16 MB for the machine and 2 MB for each user. Smallest kernel
  1100.         run in 1 MB but is tight, use 4 MB for general work and light
  1101.         applications, 8 MB for X11 or GCC or 16 MB to be comfortable.
  1102.         (The author is known to brew a rather powerful cuppa tea...)
  1103.  
  1104.         Some suggest that swap space should be 1-2 times the size of the
  1105.         RAM, pointing out that the locality of the programs determines
  1106.         how effective your added swap space is. Note that using the same
  1107.         algorithm as for 4BSD is slightly incorrect as Linux does not
  1108.         allocate space for pages in core.
  1109.  
  1110.         Also remember to take into account the type of programs you use.
  1111.         Some programs that have large working sets, such as finite
  1112.         element modeling (FEM) have huge data structures loaded in RAM
  1113.         rather than working explicitly on disk files. Data and computing
  1114.         intensive programs like this will cause excessive swapping if
  1115.         you have less RAM than the requirements.
  1116.  
  1117.         Other types of programs can lock their pages into RAM. This can
  1118.         be for security reasons, preventing copies of data reaching a
  1119.         swap device or for performance reasons such as in a real time
  1120.         module. Either way, locking pages reduces the remaining amount
  1121.         of swappable memory and can cause the system to swap earlier
  1122.         then otherwise expected.
  1123.         In man 8 mkswap it is explained that each swap partition can be
  1124.         a maximum of just under 128 MB in size.
  1125.  
  1126.  
  1127.      Reliability
  1128.         Medium. When it fails you know it pretty quickly and failure
  1129.         will cost you some lost work. You save often, don't you?
  1130.  
  1131.  
  1132.      Note 1
  1133.         Linux offers the possibility of interleaved swapping across
  1134.         multiple devices, a feature that can gain you much. Check out
  1135.         "man 8 swapon" for more details. However, software raiding swap
  1136.         across multiple devices adds more overheads than you gain.
  1137.  
  1138.         Thus the /etc/fstab file might look like this:
  1139.  
  1140.  
  1141.           /dev/sda1       swap            swap    pri=1           0       0
  1142.           /dev/sdc1       swap            swap    pri=1           0       0
  1143.  
  1144.  
  1145.  
  1146.  
  1147.      Remember that the fstab file is very sensitive to the formatting
  1148.      used, read the man page carefully and do not just cut and paste the
  1149.      lines above.
  1150.  
  1151.  
  1152.      Note 2
  1153.         Some people use a RAM disk for swapping or some other file
  1154.         systems. However, unless you have some very unusual requirements
  1155.         or setups you are unlikely to gain much from this as this cuts
  1156.         into the memory available for caching and buffering.
  1157.  
  1158.  
  1159.  
  1160.   4.1.2.  Temporary storage ( /tmp  and /var/tmp )
  1161.  
  1162.  
  1163.      Speed
  1164.         Very high. On a separate disk/partition this will reduce
  1165.         fragmentation generally, though ext2fs handles fragmentation
  1166.         rather well.
  1167.  
  1168.  
  1169.      Size
  1170.         Hard to tell, small systems are easy to run with just a few MB
  1171.         but these are notorious hiding places for stashing files away
  1172.         from prying eyes and quota enforcements and can grow without
  1173.         control on larger machines. Suggested: small home machine: 8 MB,
  1174.         large home machine: 32 MB, small server: 128 MB, and large
  1175.         machines up to 500 MB (The machine used by the author at work
  1176.         has 1100 users and a 300 MB /tmp directory). Keep an eye on
  1177.         these directories, not only for hidden files but also for old
  1178.         files. Also be prepared that these partitions might be the first
  1179.         reason you might have to resize your partitions.
  1180.  
  1181.  
  1182.      Reliability
  1183.         Low. Often programs will warn or fail gracefully when these
  1184.         areas fail or are filled up. Random file errors will of course
  1185.         be more serious, no matter what file area this is.
  1186.  
  1187.  
  1188.  
  1189.      Files
  1190.         Mostly short files but there can be a huge number of them.
  1191.         Normally programs delete their old tmp files but if somehow an
  1192.         interruption occurs they could survive. Many distributions have
  1193.         a policy regarding cleaning out tmp files at boot time, you
  1194.         might want to check out what your setup is.
  1195.  
  1196.  
  1197.      Note
  1198.         In FSSTND there is a note about putting /tmp on RAM disk. This,
  1199.         however, is not recommended for the same reasons as stated for
  1200.         swap. Also, as noted earlier, do not use flash RAM drives for
  1201.         these directories. One should also keep in mind that some
  1202.         systems are set to automatically clean tmp areas on rebooting.
  1203.  
  1204.  
  1205.   (* That was 50 lines, I am home and dry! *)
  1206.  
  1207.  
  1208.   4.1.3.  Spool areas ( /var/spool/news  and /var/spool/mail )
  1209.  
  1210.  
  1211.      Speed
  1212.         High, especially on large news servers. News transfer and
  1213.         expiring are disk intensive and will benefit from fast drives.
  1214.         Print spools: low. Consider RAID0 for news.
  1215.  
  1216.  
  1217.      Size
  1218.         For news/mail servers: whatever you can afford. For single user
  1219.         systems a few MB will be sufficient if you read continuously.
  1220.         Joining a list server and taking a holiday is, on the other
  1221.         hand, not a good idea.  (Again the machine I use at work has 100
  1222.         MB reserved for the entire /var/spool)
  1223.  
  1224.  
  1225.      Reliability
  1226.         Mail: very high, news: medium, print spool: low. If your mail is
  1227.         very important (isn't it always?) consider RAID for reliability.
  1228.  
  1229.  
  1230.      Files
  1231.         Usually a huge number of files that are around a few KB in size.
  1232.         Files in the print spool can on the other hand be few but quite
  1233.         sizable.
  1234.  
  1235.  
  1236.      Note
  1237.         Some of the news documentation suggests putting all the
  1238.         .overview files on a drive separate from the news files, check
  1239.         out all news FAQs for more information.
  1240.  
  1241.  
  1242.   4.1.4.  Home directories ( /home )
  1243.  
  1244.  
  1245.      Speed
  1246.         Medium. Although many programs use /tmp for temporary storage,
  1247.         others such as some news readers frequently update files in the
  1248.         home directory which can be noticeable on large multiuser
  1249.         systems. For small systems this is not a critical issue.
  1250.  
  1251.  
  1252.      Size
  1253.         Tricky! On some systems people pay for storage so this is
  1254.         usually then a question of finance. Large systems such as
  1255.         nyx.net <http://www.nyx.net/> (which is a free Internet service
  1256.         with mail, news and WWW services) run successfully with a
  1257.         suggested limit of 100 KB per user and 300 KB as enforced
  1258.         maximum. Commercial ISPs offer typically about 5 MB in their
  1259.         standard subscription packages.
  1260.  
  1261.         If however you are writing books or are doing design work the
  1262.         requirements balloon quickly.
  1263.  
  1264.  
  1265.      Reliability
  1266.         Variable. Losing /home on a single user machine is annoying but
  1267.         when 2000 users call you to tell you their home directories are
  1268.         gone it is more than just annoying. For some their livelihood
  1269.         relies on what is here. You do regular backups of course?
  1270.  
  1271.  
  1272.      Files
  1273.         Equally tricky. The minimum setup for a single user tends to be
  1274.         a dozen files, 0.5 - 5 KB in size. Project related files can be
  1275.         huge though.
  1276.  
  1277.  
  1278.      Note1
  1279.         You might consider RAID for either speed or reliability. If you
  1280.         want extremely high speed and reliability you might be looking
  1281.         at other operating system and hardware platforms anyway.  (Fault
  1282.         tolerance etc.)
  1283.  
  1284.  
  1285.      Note2
  1286.         Web browsers often use a local cache to speed up browsing and
  1287.         this cache can take up a substantial amount of space and cause
  1288.         much disk activity. There are many ways of avoiding this kind of
  1289.         performance hits, for more information see the sections on
  1290.         ``Home Directories'' and ``WWW''.
  1291.  
  1292.  
  1293.      Note3
  1294.         Users often tend to use up all available space on the /home
  1295.         partition. The Linux Quota subsystem is capable of limiting the
  1296.         number of blocks and the number of inode a single user ID can
  1297.         allocate on a per-filesystem basis. See the Linux Quota mini-
  1298.         HOWTO <http://sunsite.unc.edu/LDP/mini> by Albert M.C. Tam
  1299.         <mailto:bertie (at) scn.org> for details on setup.
  1300.  
  1301.  
  1302.  
  1303.  
  1304.   4.1.5.  Main binaries ( /usr/bin  and /usr/local/bin )
  1305.  
  1306.  
  1307.      Speed
  1308.         Low. Often data is bigger than the programs which are demand
  1309.         loaded anyway so this is not speed critical. Witness the
  1310.         successes of live file systems on CD ROM.
  1311.  
  1312.  
  1313.      Size
  1314.         The sky is the limit but 200 MB should give you most of what you
  1315.         want for a comprehensive system. A big system, for software
  1316.         development or a multi purpose server should perhaps reserve 500
  1317.         MB both for installation and for growth.
  1318.  
  1319.  
  1320.  
  1321.      Reliability
  1322.         Low. This is usually mounted under root where all the essentials
  1323.         are collected. Nevertheless losing all the binaries is a pain...
  1324.  
  1325.  
  1326.      Files
  1327.         Variable but usually of the order of 10 - 100 kB.
  1328.  
  1329.  
  1330.  
  1331.   4.1.6.  Libraries ( /usr/lib  and /usr/local/lib )
  1332.  
  1333.  
  1334.      Speed
  1335.         Medium. These are large chunks of data loaded often, ranging
  1336.         from object files to fonts, all susceptible to bloating. Often
  1337.         these are also loaded in their entirety and speed is of some use
  1338.         here.
  1339.  
  1340.  
  1341.      Size
  1342.         Variable. This is for instance where word processors store their
  1343.         immense font files. The few that have given me feedback on this
  1344.         report about 70 MB in their various lib directories.  A rather
  1345.         complete Debian 1.2 installation can take as much as 250 MB
  1346.         which can be taken as an realistic upper limit.  The following
  1347.         ones are some of the largest disk space consumers: GCC, Emacs,
  1348.         TeX/LaTeX, X11 and perl.
  1349.  
  1350.  
  1351.      Reliability
  1352.         Low. See point ``Main binaries''.
  1353.  
  1354.  
  1355.      Files
  1356.         Usually large with many of the order of 100 kB in size.
  1357.  
  1358.  
  1359.      Note
  1360.         For historical reasons some programs keep executables in the lib
  1361.         areas. One example is GCC which have some huge binaries in the
  1362.         /usr/lib/gcc/lib hierarchy.
  1363.  
  1364.  
  1365.  
  1366.   4.1.7.  Root
  1367.  
  1368.  
  1369.      Speed
  1370.         Quite low: only the bare minimum is here, much of which is only
  1371.         run at startup time.
  1372.  
  1373.  
  1374.      Size
  1375.         Relatively small. However it is a good idea to keep some
  1376.         essential rescue files and utilities on the root partition and
  1377.         some keep several kernel versions. Feedback suggests about 20 MB
  1378.         would be sufficient.
  1379.  
  1380.  
  1381.      Reliability
  1382.         High. A failure here will possibly cause a fair bit of grief and
  1383.         you might end up spending some time rescuing your boot
  1384.         partition. With some practice you can of course do this in an
  1385.         hour or so, but I would think if you have some practice doing
  1386.         this you are also doing something wrong.
  1387.         Naturally you do have a rescue disk? Of course this is updated
  1388.         since you did your initial installation? There are many ready
  1389.         made rescue disks as well as rescue disk creation tools you
  1390.         might find valuable.  Presumably investing some time in this
  1391.         saves you from becoming a root rescue expert.
  1392.  
  1393.  
  1394.      Note 1
  1395.         If you have plenty of drives you might consider putting a spare
  1396.         emergency boot partition on a separate physical drive. It will
  1397.         cost you a little bit of space but if your setup is huge the
  1398.         time saved, should something fail, will be well worth the extra
  1399.         space.
  1400.  
  1401.  
  1402.      Note 2
  1403.         For simplicity and also in case of emergencies it is not
  1404.         advisable to put the root partition on a RAID level 0 system.
  1405.         Also if you use RAID for your boot partition you have to
  1406.         remember to have the md option turned on for your emergency
  1407.         kernel.
  1408.  
  1409.  
  1410.  
  1411.   4.1.8.  DOS etc.
  1412.  
  1413.   At the danger of sounding heretical I have included this little
  1414.   section about something many reading this document have strong
  1415.   feelings about.  Unfortunately many hardware items come with setup and
  1416.   maintenance tools based around those systems, so here goes.
  1417.  
  1418.  
  1419.      Speed
  1420.         Very low. The systems in question are not famed for speed so
  1421.         there is little point in using prime quality drives.
  1422.         Multitasking or multi-threading are not available so the command
  1423.         queueing facility found in SCSI drives will not be taken
  1424.         advantage of. If you have an old IDE drive it should be good
  1425.         enough. The exception is to some degree Win95 and more notably
  1426.         NT which have multi-threading support which should theoretically
  1427.         be able to take advantage of the more advanced features offered
  1428.         by SCSI devices.
  1429.  
  1430.  
  1431.      Size
  1432.         The company behind these operating systems is not famed for
  1433.         writing tight code so you have to be prepared to spend a few
  1434.         tens of MB depending on what version you install of the OS or
  1435.         Windows. With an old version of DOS or Windows you might fit it
  1436.         all in on 50 MB.
  1437.  
  1438.  
  1439.      Reliability
  1440.         Ha-ha. As the chain is no stronger than the weakest link you can
  1441.         use any old drive. Since the OS is more likely to scramble
  1442.         itself than the drive is likely to self destruct you will soon
  1443.         learn the importance of keeping backups here.
  1444.  
  1445.         Put another way: "Your mission, should you choose to accept it,
  1446.         is to keep this partition working. The warranty will self
  1447.         destruct in 10 seconds..."
  1448.  
  1449.         Recently I was asked to justify my claims here. First of all I
  1450.         am not calling DOS and Windows sorry excuses for operating
  1451.         systems. Secondly there are various legal issues to be taken
  1452.         into account. Saying there is a connection between the last two
  1453.         sentences are merely the ravings of the paranoid. Surely.
  1454.         Instead I shall offer the esteemed reader a few key words: DOS
  1455.         4.0, DOS 6.x and various drive compression tools that shall
  1456.         remain nameless.
  1457.  
  1458.  
  1459.  
  1460.  
  1461.   4.2.  Explanation of terms
  1462.  
  1463.   Naturally the faster the better but often the happy installer of Linux
  1464.   has several disks of varying speed and reliability so even though this
  1465.   document describes performance as 'fast' and 'slow' it is just a rough
  1466.   guide since no finer granularity is feasible. Even so there are a few
  1467.   details that should be kept in mind:
  1468.  
  1469.  
  1470.  
  1471.   4.2.1.  Speed
  1472.  
  1473.   This is really a rather woolly mix of several terms: CPU load,
  1474.   transfer setup overhead, disk seek time and transfer rate. It is in
  1475.   the very nature of tuning that there is no fixed optimum, and in most
  1476.   cases price is the dictating factor. CPU load is only significant for
  1477.   IDE systems where the CPU does the transfer itself but is generally
  1478.   low for SCSI, see SCSI documentation for actual numbers. Disk seek
  1479.   time is also small, usually in the millisecond range. This however is
  1480.   not a problem if you use command queueing on SCSI where you then
  1481.   overlap commands keeping the bus busy all the time. News spools are a
  1482.   special case consisting of a huge number of normally small files so in
  1483.   this case seek time can become more significant.
  1484.  
  1485.   There are two main parameters that are of interest here:
  1486.  
  1487.  
  1488.      Seek
  1489.         is usually specified in the average time take for the read/write
  1490.         head to seek from one track to another. This parameter is
  1491.         important when dealing with a large number of small files such
  1492.         as found in spool files.  There is also the extra seek delay
  1493.         before the desired sector rotates into position under the head.
  1494.         This delay is dependent on the angular velocity of the drive
  1495.         which is why this parameter quite often is quoted for a drive.
  1496.         Common values are 4500, 5400 and 7200 rpm (rotations per
  1497.         minute). Higher rpm reduces the seek time but at a substantial
  1498.         cost.  Also drives working at 7200 rpm have been known to be
  1499.         noisy and to generate a lot of heat, a factor that should be
  1500.         kept in mind if you are building a large array or "disk farm".
  1501.         Very recently drives working at 10000 rpm has entered the market
  1502.         and here the cooling requirements are even stricter and minimum
  1503.         figures for air flow are given.
  1504.  
  1505.  
  1506.      Transfer
  1507.         is usually specified in megabytes per second.  This parameter is
  1508.         important when handling large files that have to be transferred.
  1509.         Library files, dictionaries and image files are examples of
  1510.         this. Drives featuring a high rotation speed also normally have
  1511.         fast transfers as transfer speed is proportional to angular
  1512.         velocity for the same sector density.
  1513.  
  1514.   It is therefore important to read the specifications for the drives
  1515.   very carefully, and note that the maximum transfer speed quite often
  1516.   is quoted for transfers out of the on board cache (burst speed) and
  1517.   not directly from the platter (sustained speed).  See also section on
  1518.   ``Power and Heating''.
  1519.   4.2.2.  Reliability
  1520.  
  1521.   Naturally no-one would want low reliability disks but one might be
  1522.   better off regarding old disks as unreliable. Also for RAID purposes
  1523.   (See the relevant information) it is suggested to use a mixed set of
  1524.   disks so that simultaneous disk crashes become less likely.
  1525.  
  1526.   So far I have had only one report of total file system failure but
  1527.   here unstable hardware seemed to be the cause of the problems.
  1528.  
  1529.  
  1530.   4.2.3.  Files
  1531.  
  1532.   The average file size is important in order to decide the most
  1533.   suitable drive parameters. A large number of small files makes the
  1534.   average seek time important whereas for big files the transfer speed
  1535.   is more important.  The command queueing in SCSI devices is very handy
  1536.   for handling large numbers of small files, but for transfer EIDE is
  1537.   not too far behind SCSI and normally much cheaper than SCSI.
  1538.  
  1539.  
  1540.  
  1541.   4.3.  Technologies
  1542.  
  1543.   In order to decide how to get the most of your devices you need to
  1544.   know what technologies are available and their implications. As always
  1545.   there can be some tradeoffs with respect to speed, reliability, power,
  1546.   flexibility, ease of use and complexity.
  1547.  
  1548.  
  1549.  
  1550.   4.3.1.  RAID
  1551.  
  1552.   This is a method of increasing reliability, speed or both by using
  1553.   multiple disks in parallel thereby decreasing access time and
  1554.   increasing transfer speed. A checksum or mirroring system can be used
  1555.   to increase reliability.  Large servers can take advantage of such a
  1556.   setup but it might be overkill for a single user system unless you
  1557.   already have a large number of disks available. See other documents
  1558.   and FAQs for more information.
  1559.  
  1560.   For Linux one can set up a RAID system using either software (the md
  1561.   module in the kernel), a Linux compatible controller card (PCI-to-
  1562.   SCSI) or a SCSI-to-SCSI controller. Check the documentation for what
  1563.   controllers can be used. A hardware solution is usually faster, and
  1564.   perhaps also safer, but comes at a significant cost.
  1565.  
  1566.   SCSI-to-SCSI controllers are usually implemented as complete cabinets
  1567.   with drives and a controller that connects to the computer with a
  1568.   second SCSI bus. This makes the entire cabinet of drives look like a
  1569.   single large, fast SCSI drive and requires no special RAID driver. The
  1570.   disadvantage is that the SCSI bus connecting the cabinet to the
  1571.   computer becomes a bottleneck.
  1572.  
  1573.   PCI-to-SCSI are as the name suggests, connected to the high speed PCI
  1574.   bus and is therefore not suffering from the same bottleneck as the
  1575.   SCSI-to-SCSI controllers. These controllers require special drivers
  1576.   but you also get the means of controlling the RAID configuration over
  1577.   the network which simplifies management.
  1578.  
  1579.   Currently the only supported SCSI RAID controller cards are the
  1580.   SmartCache I/III/IV and SmartRAID I/III/IV controller families from
  1581.   DPT. These controllers are supported by the EATA-DMA driver in the
  1582.   standard kernel. This company also has an informative home page
  1583.   <http://www.dpt.com> which also describes various general aspects of
  1584.   RAID and SCSI in addition to the product related information.
  1585.   More information from  the author of the DPT controller drivers (EATA*
  1586.   drivers) can be found at his pages on SCSI <http://www.uni-
  1587.   mainz.de/~neuffer/scsi> and DPT <http://www.uni-
  1588.   mainz.de/~neuffer/scsi/dpt>.
  1589.  
  1590.   SCSI-to-SCSI-controllers are small computers themselves, often with a
  1591.   substantial amount of cache RAM. To the host system they mask
  1592.   themselves as a gigantic, fast and reliable SCSI disk whereas to their
  1593.   disks they look like the computer's SCSI host adapter. Some of these
  1594.   controllers have the option to talk to multiple hosts simultaneously.
  1595.   Since these controllers look to the host as a normal, albeit large
  1596.   SCSI drive they need no special support from the host system. Usually
  1597.   they are configured via the front panel or with a vt100 terminal
  1598.   emulator connected to their on-board serial interface.
  1599.  
  1600.   Very recently I have heard that Syred also makes SCSI-to-SCSI
  1601.   controllers that are supported under Linux. I have no more information
  1602.   about this yet but will come back with more information soon. In the
  1603.   mean time check out their home <http://www.syred.com> pages for more
  1604.   information.
  1605.  
  1606.   RAID comes in many levels and flavours which I will give a brief
  1607.   overview of this here. Much has been written about it and the
  1608.   interested reader is recommended to read more about this in the RAID
  1609.   FAQ.
  1610.  
  1611.  
  1612.   o  RAID 0 is not redundant at all but offers the best throughput of
  1613.      all levels here. Data is striped across a number of drives so read
  1614.      and write operations take place in parallel across all drives. On
  1615.      the other hand if a single drive fail then everything is lost. Did
  1616.      I mention backups?
  1617.  
  1618.   o  RAID 1 is the most primitive method of obtaining redundancy by
  1619.      duplicating data across all drives. Naturally this is massively
  1620.      wasteful but you get one substantial advantage which is fast
  1621.      access.  The drive that access the data first wins. Transfers are
  1622.      not any faster than for a single drive, even though you might get
  1623.      some faster read transfers by using one track reading per drive.
  1624.  
  1625.      Also if you have only 2 drives this is the only method of achieving
  1626.      redundancy.
  1627.  
  1628.   o  RAID 2 and 4 are not so common and are not covered here.
  1629.  
  1630.   o  RAID 3 uses a number of disks (at least 2) to store data in a
  1631.      striped RAID 0 fashion. It also uses an additional redundancy disk
  1632.      to store the XOR sum of the data from the data disks. Should the
  1633.      redundancy disk fail, the system can continue to operate as if
  1634.      nothing happened. Should any single data disk fail the system can
  1635.      compute the data on this disk from the information on the
  1636.      redundancy disk and all remaining disks. Any double fault will
  1637.      bring the whole RAID set off-line.
  1638.  
  1639.      RAID 3 makes sense only with at least 2 data disks (3 disks
  1640.      including the redundancy disk). Theoretically there is no limit for
  1641.      the number of disks in the set, but the probability of a fault
  1642.      increases with the number of disks in the RAID set. Usually the
  1643.      upper limit is 5 to 7 disks in a single RAID set.
  1644.  
  1645.      Since RAID 3 stores all redundancy information on a dedicated disk
  1646.      and since this information has to be updated whenever a write to
  1647.      any data disk occurs, the overall write speed of a RAID 3 set is
  1648.      limited by the write speed of the redundancy disk. This, too, is a
  1649.      limit for the number of disks in a RAID set. The overall read speed
  1650.      of a RAID 3 set with all data disks up and running is that of a
  1651.      RAID 0 set with that number of data disks. If the set has to
  1652.      reconstruct data stored on a failed disk from redundant
  1653.      information, the performance will be severely limited: All disks in
  1654.      the set have to be read and XOR-ed to compute the missing
  1655.      information.
  1656.  
  1657.   o  RAID 5 is just like RAID 3, but the redundancy information is
  1658.      spread on all disks of the RAID set. This improves write
  1659.      performance, because load is distributed more evenly between all
  1660.      available disks.
  1661.  
  1662.   There are also hybrids available based on RAID 1 and one other level.
  1663.   Many combinations are possible but I have only seen a few referred to.
  1664.   These are more complex than the above mentioned RAID levels.
  1665.  
  1666.   RAID 0/1 combines striping with duplication which gives very high
  1667.   transfers combined with fast seeks as well as redundancy. The
  1668.   disadvantage is high disk consumption as well as the above mentioned
  1669.   complexity.
  1670.  
  1671.   RAID 1/5 combines the speed and redundancy benefits of RAID5 with the
  1672.   fast seek of RAID1. Redundancy is improved compared to RAID 0/1 but
  1673.   disk consumption is still substantial. Implementing such a system
  1674.   would involve typically more than 6 drives, perhaps even several
  1675.   controllers or SCSI channels.
  1676.  
  1677.  
  1678.   4.3.2.  AFS, Veritas and Other Volume Management Systems
  1679.  
  1680.   Although multiple partitions and disks have the advantage of making
  1681.   for more space and higher speed and reliability there is a significant
  1682.   snag: if for instance the /tmp partition is full you are in trouble
  1683.   even if the news spool is empty, as it is not easy to retransfer
  1684.   quotas across partitions. Volume management is a system that does just
  1685.   this and AFS and Veritas are two of the best known examples. Some also
  1686.   offer other file systems like log file systems and others optimised
  1687.   for reliability or speed. Note that Veritas is not available (yet) for
  1688.   Linux and it is not certain they can sell kernel modules without
  1689.   providing source for their proprietary code, this is just mentioned
  1690.   for information on what is out there. Still, you can check their home
  1691.   page <http://www.veritas.com> to see how such systems function.
  1692.  
  1693.   Derek Atkins, of MIT, ported AFS to Linux and has also set up the
  1694.   Linux AFS mailing List for this which is open to the public.  Requests
  1695.   to join the list should go to Request and finally bug reports should
  1696.   be directed to Bug Reports.
  1697.  
  1698.   Important: as AFS uses encryption it is restricted software and cannot
  1699.   easily be exported from the US. AFS is now sold by Transarc and they
  1700.   have set up a www site. The directory structure there has been
  1701.   reorganized recently so I cannot give a more accurate URL than just
  1702.   the Transarc Home Page <http://www.transarc.com> which lands you in
  1703.   the root of the web site. There you can also find much general
  1704.   information as well as a FAQ.
  1705.  
  1706.   The is now also development based on the last free sources of AFS.
  1707.  
  1708.   Volume management is for the time being an area where Linux is
  1709.   lacking.  Someone has recently started a virtual partition system
  1710.   project that will reimplement many of the volume management functions
  1711.   found in IBM's AIX system.
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.   4.3.3.  Linux md  Kernel Patch
  1718.  
  1719.   There is however one kernel project that attempts to do some of this,
  1720.   md, which has been part of the kernel distributions since 1.3.69.
  1721.   Currently providing spanning and RAID it is still in early development
  1722.   and people are reporting varying degrees of success as well as total
  1723.   wipe out. Use with caution.
  1724.  
  1725.   Currently it offers linear mode and RAID levels 0,1,4,5; all in
  1726.   various stages of development and reliability with linear mode and
  1727.   RAID levels 0 and 1 being the most stable.  It is also possible to
  1728.   stack some levels, for instance mirroring (RAID 1) two pairs of
  1729.   drives, each pair set up as striped disks (RAID 0), which offers the
  1730.   speed of RAID 0 combined with the reliability of RAID 1.
  1731.  
  1732.   Think very carefully what drives you combine so you can operate all
  1733.   drives in parallel, which gives you better performance and less wear.
  1734.   Read more about this in the documentation that comes with md.
  1735.  
  1736.  
  1737.   4.3.4.  General File System Consideration
  1738.  
  1739.   In the Linux world ext2fs is well established as a general purpose
  1740.   system.  Still for some purposes others can be a better choice. News
  1741.   spools lend themselves to a log file based system whereas high
  1742.   reliability data might need other formats. This is a hotly debated
  1743.   topic and there are currently few choices available but work is
  1744.   underway. Log file systems also have the advantage of very fast file
  1745.   checking. Mail servers in the 100 GB class can suffer file checks
  1746.   taking several days before becoming operational after rebooting.
  1747.  
  1748.   The Minix file system is the oldest one, used in some rescue disk
  1749.   systems but otherwise very little used these days. At one time the
  1750.   Xiafs was a strong contender to the standard for Linux but seems to
  1751.   have fallen behind these days.
  1752.  
  1753.   Adam Richter from Yggdrasil posted recently that they have been
  1754.   working on a compressed log file based system but that this project is
  1755.   currently on hold. Nevertheless a non-working version is available on
  1756.   their FTP server. Check out the Yggdrasil ftp server
  1757.   <ftp://ftp.yggdrasil.com/private/adam> where special patched versions
  1758.   of the kernel can be found.  Hopefully this will be rolled into the
  1759.   mainstream kernel in the near future.
  1760.  
  1761.   As of July, 23th 1997 Hans Reiser <mailto:reiser (at) RICOCHET.NET>
  1762.   has put up the source to his tree based reiserfs
  1763.   <http://idiom.com/~beverly/reiserfs.html> on the web. While his
  1764.   filesystem has some very interesting features and is much faster than
  1765.   ext2fs, it is still very experimental and difficult to integrate with
  1766.   the standard kernel. Expect some interesting developments in the
  1767.   future - this is different from your "average log based file system
  1768.   for Linux" project, because Hans already has working code.
  1769.  
  1770.   There is room for access control lists (ACL) and other unimplemented
  1771.   features in the existing ext2fs, stay tuned for future updates.
  1772.  
  1773.   There is also an encrypted file system available but again as this is
  1774.   under export control from the US, make sure you get it from a legal
  1775.   place.
  1776.  
  1777.   File systems is an active field of academic and industrial research
  1778.   and development, the results of which are quite often freely
  1779.   available. Linux has in many cases been a development tool in such
  1780.   activities so you can expect a lot of continuous work in this field,
  1781.   stay tuned for the latest development.
  1782.  
  1783.   4.3.5.  CD-ROM File Systems
  1784.  
  1785.   There has been a number of file systems available for use on CD-ROM
  1786.   systems and one of the earliest one was the High Sierra format,
  1787.   supposedly named after the hotel where the final agreement took place.
  1788.   This was the precursor to the ISO 9660 format which is supported by
  1789.   Linux.  Later there were the Rock Ridge extensions which added file
  1790.   system features such as long filenames, permissions and more.
  1791.  
  1792.   The Linux iso9660 file system supports both High Sierra as well as
  1793.   Rock Ridge extensions.
  1794.  
  1795.   However, once again Microsoft decided it should create another
  1796.   standard and their latest effort here is called Joliet and offers some
  1797.   internationalisation features. This is at the time of writing not yet
  1798.   available in the standard kernel releases but exists in beta versions.
  1799.   Hopefully this should soon work its way into the standard kernel.
  1800.  
  1801.   In a recent Usenet News posting hpa (at) transmeta.com (H. Peter
  1802.   Anvin) writes the following the following interesting piece of trivia:
  1803.  
  1804.  
  1805.        Actually, Joliet is a city outside Chicago; best known for being the
  1806.        site of the prison where Elwood was locked up in the movie "Blues
  1807.        Brothers."  Rock Ridge (the UNIX extensions to ISO 9660) is named
  1808.        after the (fictional) town in the movie "Blazing Saddles."
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.   4.3.6.  Compression
  1816.  
  1817.   Disk versus file compression is a hotly debated topic especially
  1818.   regarding the added danger of file corruption. Nevertheless there are
  1819.   several options available for the adventurous administrators. These
  1820.   take on many forms, from kernel modules and patches to extra libraries
  1821.   but note that most suffer various forms of limitations such as being
  1822.   read-only. As development takes place at neck breaking speed the specs
  1823.   have undoubtedly changed by the time you read this. As always: check
  1824.   the latest updates yourself. Here only a few references are given.
  1825.  
  1826.  
  1827.   o  DouBle features file compression with some limitations.
  1828.  
  1829.   o  Zlibc adds transparent on-the-fly decompression of files as they
  1830.      load.
  1831.  
  1832.   o  there are many modules available for reading compressed files or
  1833.      partitions that are native to various other operating systems
  1834.      though currently most of these are read-only.
  1835.  
  1836.   o  dmsdos (currently in version 0.8.0a) offer many of the compression
  1837.      options available for DOS and Windows. It is not yet complete but
  1838.      work is ongoing and new features added regularly.
  1839.  
  1840.   o  e2compr is a package that extends ext2fs with compression
  1841.      capabilities. It is still under testing and will therefore mainly
  1842.      be of interest for kernel hackers but should soon gain stability
  1843.      for wider use.  Check the e2compr homepage
  1844.      <http://netspace.net.au/~reiter/e2compr.html> for more information.
  1845.      I have reports of speed and good stability which is why it is
  1846.      mentioned here.
  1847.  
  1848.  
  1849.   4.3.7.  Other filesystems
  1850.  
  1851.   Also there is the user file system (userfs) that allows FTP based file
  1852.   system and some compression (arcfs) plus fast prototyping and many
  1853.   other features. The docfs is based on this filesystem.
  1854.  
  1855.   Recent kernels feature the loop or loopback device which can be used
  1856.   to put a complete file system within a file. There are some
  1857.   possibilities for using this for making new file systems with
  1858.   compression, tarring, encryption etc.
  1859.  
  1860.   Note that this device is unrelated to the network loopback device.
  1861.  
  1862.  
  1863.   There is a number of other ongoing file system projects, but these are
  1864.   in the experimental stage and fall outside the scope of this HOWTO.
  1865.  
  1866.  
  1867.   4.3.8.  Physical Track Positioning
  1868.  
  1869.   This trick used to be very important when drives were slow and small,
  1870.   and some file systems used to take the varying characteristics into
  1871.   account when placing files. Although higher overall speed, on board
  1872.   drive and controller caches and intelligence has reduced the effect of
  1873.   this.
  1874.  
  1875.   Nevertheless there is still a little to be gained even today.  As we
  1876.   know, "world dominance" is soon within reach but to achieve this
  1877.   "fast" we need to employ all the tricks we can use .
  1878.  
  1879.   To understand the strategy we need to recall this near ancient piece
  1880.   of knowledge and the properties of the various track locations.  This
  1881.   is based on the fact that transfer speeds generally increase for
  1882.   tracks further away from the spindle, as well as the fact that it is
  1883.   faster to seek to or from the central tracks than to or from the inner
  1884.   or outer tracks.
  1885.  
  1886.   Most drives use disks running at constant angular velocity but use
  1887.   (fairly) constant data density across all tracks. This means that you
  1888.   will get much higher transfer rates on the outer tracks than on the
  1889.   inner tracks; a characteristics which fits the requirements for large
  1890.   libraries well.
  1891.  
  1892.   Newer disks use a logical geometry mapping which differs from the
  1893.   actual physical mapping which is transparently mapped by the drive
  1894.   itself.  This makes the estimation of the "middle" tracks a little
  1895.   harder.
  1896.  
  1897.   In most cases track 0 is at the outermost track and this is the
  1898.   general assumption most people use. Still, it should be kept in mind
  1899.   that there are no guarantees this is so.
  1900.  
  1901.  
  1902.  
  1903.      Inner
  1904.         tracks are usually slow in transfer, and lying at one end of the
  1905.         seeking position it is also slow to seek to.
  1906.  
  1907.         This is more suitable to the low end directories such as DOS,
  1908.         root and print spools.
  1909.  
  1910.  
  1911.      Middle
  1912.         tracks are on average faster with respect to transfers than
  1913.         inner tracks and being in the middle also on average faster to
  1914.         seek to.
  1915.         This characteristics is ideal for the most demanding parts such
  1916.         as swap, /tmp and /var/tmp.
  1917.  
  1918.  
  1919.      Outer
  1920.         tracks have on average even faster transfer characteristics but
  1921.         like the inner tracks are at the end of the seek so
  1922.         statistically it is equally slow to seek to as the inner tracks.
  1923.  
  1924.         Large files such as libraries would benefit from a place here.
  1925.  
  1926.  
  1927.   Hence seek time reduction can be achieved by positioning frequently
  1928.   accessed tracks in the middle so that the average seek distance and
  1929.   therefore the seek time is short. This can be done either by using
  1930.   fdisk or cfdisk to make a partition on the middle tracks or by first
  1931.   making a file (using dd) equal to half the size of the entire disk
  1932.   before creating the files that are frequently accessed, after which
  1933.   the dummy file can be deleted. Both cases assume starting from an
  1934.   empty disk.
  1935.  
  1936.   The latter trick is suitable for news spools where the empty directory
  1937.   structure can be placed in the middle before putting in the data
  1938.   files.  This also helps reducing fragmentation a little.
  1939.  
  1940.   This little trick can be used both on ordinary drives as well as RAID
  1941.   systems. In the latter case the calculation for centring the tracks
  1942.   will be different, if possible. Consult the latest RAID manual.
  1943.  
  1944.  
  1945.  
  1946.   5.  Other Operating Systems
  1947.  
  1948.   Many Linux users have several operating systems installed, often
  1949.   necessitated by hardware setup systems that run under other operating
  1950.   systems, typically DOS or some flavour of Windows. A small section on
  1951.   how best to deal with this is therefore included here.
  1952.  
  1953.  
  1954.   5.1.  DOS
  1955.  
  1956.   Leaving aside the debate on weather or not DOS qualifies as an
  1957.   operating system one can in general say that it has little
  1958.   sophistication with respect to disk operations. The more important
  1959.   result of this is that there can be severe difficulties in running
  1960.   various versions of DOS on large drives, and you are therefore
  1961.   strongly recommended in reading the Large Drives mini-HOWTO. One
  1962.   effect is that you are often better off placing DOS on low track
  1963.   numbers.
  1964.  
  1965.   Having been designed for small drives it has a rather unsophisticated
  1966.   file system (FAT) which when used on large drives will allocate
  1967.   enormous block sizes. It is also prone to block fragmentation which
  1968.   will after a while cause excessive seeks and slow effective transfers.
  1969.  
  1970.   One solution to this is to use a defragmentation program regularly but
  1971.   it is strongly recommended to back up data and verify the disk before
  1972.   defragmenting. All versions of DOS have chkdsk that can do some disk
  1973.   checking, newer versions also have scandisk which is somewhat better.
  1974.   There are many defragmentation programs available, some versions have
  1975.   one called defrag. Norton Utilities have a large suite of disk tools
  1976.   and there are many others available too.
  1977.  
  1978.   As always there are snags, and this particular snake in our drive
  1979.   paradise is called hidden files. Some vendors started to use these for
  1980.   copy protection schemes and would not take kindly to being moved to a
  1981.   different place on the drive, even if it remained in the same place in
  1982.   the directory structure. The result of this was that newer
  1983.   defragmentation programs will not touch any hidden file, which in turn
  1984.   reduces the effect of defragmentation.
  1985.  
  1986.   Being a single tasking, single threading and single most other things
  1987.   operating system there is very little gains in using multiple drives
  1988.   unless you use a drive controller with built in RAID support of some
  1989.   kind.
  1990.  
  1991.   There are a few utilities called join and subst which can do some
  1992.   multiple drive configuration but there is very little gains for a lot
  1993.   of work. Some of these commands have been removed in newer versions.
  1994.  
  1995.   In the end there is very little you can do, but not all hope is lost.
  1996.   Many programs need fast, temporary storage, and the better behaved
  1997.   ones will look for environment variables called TMPDIR or TEMPDIR
  1998.   which you can set to point to another drive. This is often best done
  1999.   in autoexec.bat.
  2000.  
  2001.  
  2002.   ______________________________________________________________________
  2003.   SET TMPDIR=E:/TMP
  2004.   ______________________________________________________________________
  2005.  
  2006.  
  2007.  
  2008.   Not only will this possibly gain you some speed but also it can reduce
  2009.   fragmentation.
  2010.  
  2011.   There have been reports about difficulties in removing multiple
  2012.   primary partitions using the fdisk program that comes with DOS. Should
  2013.   this happen you can instead use a Linux rescue disk with Linux fdisk
  2014.   to repair the system.
  2015.  
  2016.  
  2017.   5.2.  Windows
  2018.  
  2019.   Most of the above points are valid for Windows too, with the exception
  2020.   of Windows95 which apparently has better disk handling, which will get
  2021.   better performance out of SCSI drives.
  2022.  
  2023.   A useful thing is the introduction of long filenames, to read these
  2024.   from Linux you will need the vfat file system for mounting these
  2025.   partitions.
  2026.  
  2027.   The most important thing is the introduction of the new file system
  2028.   FAT32 which is better suited to large drives. The snag is that there
  2029.   is very little support for this today, not even in NT 4.0 or many
  2030.   drive utility systems. A stable driver for Linux is coming soon but is
  2031.   not yet ready for prime time. Stay tuned for updates.
  2032.  
  2033.   Disk fragmentation is still a problem. Some of this can be avoided by
  2034.   doing a defragmentation immediately before and immediately after
  2035.   installing large programs or systems. I use this scheme at work and
  2036.   have found it to work quite well. Purging unused files and emptying
  2037.   the waste basket first can improve defragmentation further.
  2038.  
  2039.   Windows also use swap drives, redirecting this to another drive can
  2040.   give you some performance gains. There are several mini-HOWTOs telling
  2041.   you how best to share swap space between various operating systems.
  2042.  
  2043.   Very recently someone started a project supporting ext2fs support for
  2044.   Win95 which you can read about at this web site
  2045.   <http://www.globalxs.nl/home/p/pvs/>.
  2046.  
  2047.   The trick of setting TEMPDIR can still be used but not all programs
  2048.   will honour this setting. Some do, though. To get a good overview of
  2049.   the settings in the control files you can run sysedit which will open
  2050.   a number of files for editing, one of which is the autoexec file where
  2051.   you can add the TEMPDIR settings.
  2052.  
  2053.   Much of the temporary files are located in the /windows/temp directory
  2054.   and changing this is more tricky. To achieve this you can use regedit
  2055.   which is rather powerful and quite capable of rendering your system in
  2056.   a state you will not enjoy, or more precisely, in a state much les
  2057.   enjoyable than windows in general.  Registry database error is a
  2058.   message that means seriously bad news.  Also you will see that many
  2059.   programs have their own private temporary directories scattered around
  2060.   the system.
  2061.  
  2062.   Setting the swap file to a separate partition is a better idea and
  2063.   much less risky. Keep in mind that this partition cannot be used for
  2064.   anything else, even if there should appear to be space left there.
  2065.  
  2066.  
  2067.   5.3.  OS/2
  2068.  
  2069.   The only special note here is that you can get a file system driver
  2070.   for OS/2 that can read an ext2fs partition.
  2071.  
  2072.  
  2073.   5.4.  NT
  2074.  
  2075.   This is a more serious system featuring most buzzwords known to
  2076.   marketing.  It is well worth noting that it features software striping
  2077.   and other more sophisticated setups. Check out the drive manager in
  2078.   the control panel.  I do not have easy access to NT, more details on
  2079.   this can take a bit of time.
  2080.  
  2081.   One important snag was recently reported by acahalan at cs.uml.edu :
  2082.   (reformatted from a Usenet News posting)
  2083.  
  2084.   NT DiskManager has a serious bug that can corrupt your disk when you
  2085.   have several (more than one?) extended partitions.  Microsoft provides
  2086.   an emergency fix program at their web site. See the knowledge base
  2087.   <http://www.microsoft.com/kb/> for more.  (This affects Linux users,
  2088.   because Linux users have extra partitions)
  2089.  
  2090.  
  2091.  
  2092.   5.5.  Sun OS
  2093.  
  2094.   There is a little bit of confusion in this area between Sun OS vs.
  2095.   Solaris.  Strictly speaking Solaris is just Sun OS 5.x packaged with
  2096.   Openwindows and a few other things. If you run Solaris, just type
  2097.   uname -a to see your version. Parts of the reason for this confusion
  2098.   is that Sun Microsystems used to use an OS from the BSD family,
  2099.   albeight with a few bits and pieces from elsewhere as well as things
  2100.   made by themselves. This was the situation up to Sun OS 4.x.y when
  2101.   they did a "strategic roadmap decision" and decided to switch over to
  2102.   the official Unix, System V, Release 4 (aka SVR5), and Sun OS 5 was
  2103.   created.  This made a lot of people unhappy. Also this was bundled
  2104.   with other things and marketed under the name Solaris, which currently
  2105.   stands at release 2.6 .
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.   5.5.1.  Sun OS 4
  2114.  
  2115.   This is quite familiar to most Linux users. Note however that the file
  2116.   system structure is quite different and does not conform to FSSTND so
  2117.   any planning must be based on the traditional structure. You can get
  2118.   some information by the man page on this: man hier. This is, like most
  2119.   manpages, rather brief but should give you a good start. If you are
  2120.   still confused by the structure it will at least be at a higher level.
  2121.  
  2122.  
  2123.   5.5.2.  Sun OS 5 (aka Solaris)
  2124.  
  2125.   This comes with a snazzy installation system that runs under
  2126.   Openwindows, it will help you in partitioning and formatting the
  2127.   drives before installing the system from CD-ROM. It will also fail if
  2128.   your drive setup is too far out, and as it takes a complete
  2129.   installation run from a full CD-ROM in a 1x only drive this failure
  2130.   will dawn on you after too long time. That is the experience we had
  2131.   where I used to work. Instead we installed everything onto one drive
  2132.   and then moved directories across.
  2133.  
  2134.   The default settings are sensible for most things, yet there remains a
  2135.   little oddity: swap drives. Even though the official manual recommends
  2136.   multiple swap drives (which are used in a similar fashion as on Linux)
  2137.   the default is to use only a single drive. It is recommended to change
  2138.   this as soon as possible.
  2139.  
  2140.   Sun OS 5 offers also a file system especially designed for temporary
  2141.   files, tmpfs. This is a kind of souped up RAM disk, and like ordinary
  2142.   RAM disks the contents is lost when the power goes. If space is scarce
  2143.   parts of the pseudo drive is swapped out, so in effect you store
  2144.   temporary files on the swap partition. Linux does not have such a file
  2145.   system; it has been discussed in the past but opinions were mixed. I
  2146.   would be interested in hearing comments on this.
  2147.  
  2148.   The only comment so far is: don't! Under Solaris 2.0 it seem that
  2149.   creating too big files in /tmp can cause a out of swap space kernel
  2150.   panic trap. As the evidence of what has happened is as lost as any
  2151.   data on a RAMdisk after powering down it can be hard to find out what
  2152.   has happened. What is worse, it seems that user space processes can
  2153.   cause this kernel panic and unless this problem is taken care of it is
  2154.   best not to use tmpfs.
  2155.  
  2156.   Also see the note on ``Combining swap and /tmp''.
  2157.  
  2158.   Trivia: There is a movie also called Solaris, a science fiction movie
  2159.   that is very, very long, slow and incomprehensible. This was often
  2160.   pointed out at the time Solaris (the OS) appeared...
  2161.  
  2162.  
  2163.   6.  Clusters
  2164.  
  2165.   In this section I will briefly touch on the ways machines can be
  2166.   connected together but this is so big a topic it could be a separate
  2167.   HOWTO in its own right, hint, hint. Also, strictly speaking, this
  2168.   section lies outside the scope of this HOWTO, so if you feel like
  2169.   getting fame etc. you could contact me and take over this part and
  2170.   turn it into a new document.
  2171.  
  2172.   These days computers gets outdated at an incredible rate. There is
  2173.   however no reason why old hardware could not be put to good use with
  2174.   Linux. Using an old and otherwise outdated computer as a network
  2175.   server can be both useful in its own right as well as a valuable
  2176.   educational exercise. Such a local networked cluster of computers can
  2177.   take on many forms but to remain within the charter of this HOWTO I
  2178.   will limit myself to the disk strategies.  Nevertheless I would hope
  2179.   someone else could take on this topic and turn it into a document on
  2180.   its own.
  2181.  
  2182.   This is an exciting area of activity today, and many forms of
  2183.   clustering is available today, ranging from automatic workload
  2184.   balancing over local network to more exotic hardware such as Scalable
  2185.   Coherent Interface (SCI) which gives a tight integration of machines,
  2186.   effectively turning them into a single machine. Various kinds of
  2187.   clustering has been available for larger machines for some time and
  2188.   the VAXcluster is perhaps a well known example of this. Clustering is
  2189.   done usually in order to share resources such as disk drives, printers
  2190.   and terminals etc, but also processing resources equally transparently
  2191.   between the computational nodes.
  2192.  
  2193.   There is no universal definition of clustering, in here it is taken to
  2194.   mean a network of machines that combine their resources to serve
  2195.   users. Admittedly this is a rather loose definition but this will
  2196.   change later.
  2197.  
  2198.   These days also Linux offers some clustering features but for a
  2199.   starter I will just describe a simple local network. It is a good way
  2200.   of putting old and otherwise unusable hardware to good use, as long as
  2201.   they can run Linux or something similar.
  2202.  
  2203.   One of the best ways of using an old machine is as a network server in
  2204.   which case the effective speed is more likely to be limited by network
  2205.   bandwidth rather than pure computational performance. For home use you
  2206.   can move the following functionality off to an older machine used as a
  2207.   server:
  2208.  
  2209.   o  news
  2210.  
  2211.   o  mail
  2212.  
  2213.   o  web proxy
  2214.  
  2215.   o  printer server
  2216.  
  2217.   o  modem server (PPP, SLIP, FAX, Voice mail)
  2218.  
  2219.   You can also NFS mount drives from the server onto your workstation
  2220.   thereby reducing drive space requirements. Still read the FSSTND to
  2221.   see what directories should not be exported. The best candidates for
  2222.   exporting to all machines are /usr and /var/spool and possibly
  2223.   /usr/local but probably not /var/spool/lpd.
  2224.  
  2225.   Most of the time even slow disks will deliver sufficient performance.
  2226.   On the other hand, if you do processing directly on the disks on the
  2227.   server or have very fast networking, you might want to rethink your
  2228.   strategy and use faster drives. Searching features on a web server or
  2229.   news database searches are two examples of this.
  2230.  
  2231.   Such a network can be an excellent way of learning system
  2232.   administration and building up your own toaster network, as it often
  2233.   is called. You can get more information on this in other HOWTOs but
  2234.   there are two important things you should keep in mind:
  2235.  
  2236.   o  Do not pull IP numbers out of thin air. Configure your inside net
  2237.      using IP numbers reserved for private use, and use your network
  2238.      server as a router that handles this IP masquerading.
  2239.  
  2240.   o  Remember that if you additionally configure the router as a
  2241.      firewall you might not be able to get to your own data from the
  2242.      outside, depending on the firewall configuration.
  2243.  
  2244.  
  2245.   The nyx network provides an example of a cluster in the sense defined
  2246.   here.  It consists of the following machines:
  2247.  
  2248.      nyx
  2249.         is one of the two user login machines and also provides some of
  2250.         the networking services.
  2251.  
  2252.      nox
  2253.         (aka nyx10) is the main user login machine and is also the mail
  2254.         server.
  2255.  
  2256.      noc
  2257.         is a dedicated news server. The news spool is made accessible
  2258.         through NFS mounting to nyx and nox.
  2259.  
  2260.      arachne
  2261.         (aka www) is the web server. Web pages are written by NFS
  2262.         mounting onto nox.
  2263.  
  2264.   There are also some more advanced clustering projects going, notably
  2265.  
  2266.   o  The Beowolf Project
  2267.      <http://cesdis.gsfc.nasa.gov/linux/beowulf/beowulf.html>
  2268.  
  2269.   o  The Genoa Active Message Machine (GAMMA)
  2270.      <http://www.disi.unige.it/project/gamma/>
  2271.  
  2272.  
  2273.   High-tech clustering requires high-tech interconnect, and SCI is one
  2274.   of them.  To find out more you can either look up the home page of
  2275.   Dolphin Interconnect Solutions <http://www.dolphinics.no/> which is
  2276.   one of the main actors in this field, or you can have a look at scizzl
  2277.   <http://www.scizzl.com/>.
  2278.  
  2279.  
  2280.  
  2281.   7.  Mount Points
  2282.  
  2283.   In designing the disk layout it is important not to split off the
  2284.   directory tree structure at the wrong points, hence this section.  As
  2285.   it is highly dependent on the FSSTND it has been put aside in a
  2286.   separate section, and will most likely have to be totally rewritten
  2287.   when FHS is released. Nobody knows when that will happen, and at the
  2288.   time of writing this a debate of near-religious qualities is taking
  2289.   place on the mailing list. In the meanwhile this will do.
  2290.  
  2291.   Remember that this is a list of where a separation can take place, not
  2292.   where it has to be. As always, good judgement is always required.
  2293.  
  2294.   Again only a rough indication can be given here. The values indicate
  2295.  
  2296.  
  2297.  
  2298.        0=don't separate here
  2299.        1=not recommended
  2300.         ...
  2301.        4=useful
  2302.        5=recommended
  2303.  
  2304.  
  2305.  
  2306.  
  2307.   In order to keep the list short, the uninteresting parts are removed.
  2308.  
  2309.  
  2310.  
  2311.   Directory   Suitability
  2312.   /
  2313.   |
  2314.   +-bin       0
  2315.   +-boot      0
  2316.   +-dev       0
  2317.   +-etc       0
  2318.   +-home      5
  2319.   +-lib       0
  2320.   +-mnt       0
  2321.   +-proc      0
  2322.   +-root      0
  2323.   +-sbin      0
  2324.   +-tmp       5
  2325.   +-usr       5
  2326.   | \
  2327.   | +-X11R6     3
  2328.   | +-bin       3
  2329.   | +-lib       4
  2330.   | +-local     4
  2331.   | | \
  2332.   | | +bin        2
  2333.   | | +lib        4
  2334.   | +-src       3
  2335.   |
  2336.   +-var       5
  2337.     \
  2338.     +-adm       0
  2339.     +-lib       2
  2340.     +-lock      1
  2341.     +-log       1
  2342.     +-preserve  1
  2343.     +-run       1
  2344.     +-spool     4
  2345.     | \
  2346.     | +-mail      3
  2347.     | +-mqueue    3
  2348.     | +-news      5
  2349.     | +-smail     3
  2350.     | +-uucp      3
  2351.     +-tmp       5
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.   There is of course plenty of adjustments possible, for instance a home
  2358.   user would not bother with splitting off the /var/spool hierarchy but
  2359.   a serious ISP should. The key here is usage.
  2360.  
  2361.  
  2362.   8.  Disk Layout
  2363.  
  2364.   With all this in mind we are now ready to embark on the layout. I have
  2365.   based this on my own method developed when I got hold of 3 old SCSI
  2366.   disks and boggled over the possibilities.
  2367.  
  2368.   The tables in the appendices are designed to simplify the mapping
  2369.   process. They have been designed to help you go through the process of
  2370.   optimizations as well as making an useful log in case of system
  2371.   repair. A few examples are also given.
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.   8.1.  Selection for partitioning
  2378.  
  2379.   Determine your needs and set up a list of all the parts of the file
  2380.   system you want to be on separate partitions and sort them in
  2381.   descending order of speed requirement and how much space you want to
  2382.   give each partition.
  2383.  
  2384.   The table in Appendix A (section `` '') is a useful tool to select
  2385.   what directories you should put on different partitions. It is sorted
  2386.   in a logical order with space for your own additions and notes about
  2387.   mounting points and additional systems. It is therefore NOT sorted in
  2388.   order of speed, instead the speed requirements are indicated by
  2389.   bullets ('o').
  2390.  
  2391.   If you plan to RAID make a note of the disks you want to use and what
  2392.   partitions you want to RAID. Remember various RAID solutions offers
  2393.   different speeds and degrees of reliability.
  2394.  
  2395.   (Just to make it simple I'll assume we have a set of identical SCSI
  2396.   disks and no RAID)
  2397.  
  2398.  
  2399.  
  2400.   8.2.  Mapping partitions to drives
  2401.  
  2402.   Then we want to place the partitions onto physical disks. The point of
  2403.   the following algorithm is to maximise parallelizing and bus capacity.
  2404.   In this example the drives are A, B and C and the partitions are
  2405.   987654321 where 9 is the partition with the highest speed requirement.
  2406.   Starting at one drive we 'meander' the partition line over and over
  2407.   the drives in this way:
  2408.  
  2409.  
  2410.  
  2411.                A : 9 4 3
  2412.                B : 8 5 2
  2413.                C : 7 6 1
  2414.  
  2415.  
  2416.  
  2417.  
  2418.   This makes the 'sum of speed requirements' the most equal across each
  2419.   drive.
  2420.  
  2421.   Use the table in Appendix B (section `` '') to select what drives to
  2422.   use for each partition in order to optimize for parallelicity.
  2423.  
  2424.   Note the speed characteristics of your drives and note each directory
  2425.   under the appropriate column. Be prepared to shuffle directories,
  2426.   partitions and drives around a few times before you are satisfied.
  2427.  
  2428.  
  2429.   8.3.  Sorting partitions on drives
  2430.  
  2431.   After that it is recommended to select partition numbering for each
  2432.   drive.
  2433.  
  2434.   Use the table in Appendix C (section `` '') to select partition
  2435.   numbers in order to optimize for track characteristics.  At the end of
  2436.   this you should have a table sorted in ascending partition number.
  2437.   Fill these numbers back into the tables in appendix A and B.
  2438.  
  2439.   You will find these tables useful when running the partitioning
  2440.   program (fdisk or cfdisk) and when doing the installation.
  2441.  
  2442.  
  2443.   8.4.  Optimizing
  2444.  
  2445.   After this there are usually a few partitions that have to be
  2446.   'shuffled' over the drives either to make them fit or if there are
  2447.   special considerations regarding speed, reliability, special file
  2448.   systems etc. Nevertheless this gives what this author believes is a
  2449.   good starting point for the complete setup of the drives and the
  2450.   partitions. In the end it is actual use that will determine the real
  2451.   needs after we have made so many assumptions. After commencing
  2452.   operations one should assume a time comes when a repartitioning will
  2453.   be beneficial.
  2454.  
  2455.   For instance if one of the 3 drives in the above mentioned example is
  2456.   very slow compared to the two others a better plan would be as
  2457.   follows:
  2458.  
  2459.  
  2460.  
  2461.                A : 9 6 5
  2462.                B : 8 7 4
  2463.                C : 3 2 1
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.   8.4.1.  Optimizing by characteristics
  2471.  
  2472.   Often drives can be similar in apparent overall speed but some
  2473.   advantage can be gained by matching drives to the file size
  2474.   distribution and frequency of access. Thus binaries are suited to
  2475.   drives with fast access that offer command queueing, and libraries are
  2476.   better suited to drives with larger transfer speeds where IDE offers
  2477.   good performance for the money.
  2478.  
  2479.  
  2480.  
  2481.   8.4.2.  Optimizing by drive parallelising
  2482.  
  2483.   Avoid drive contention by looking at tasks: for instance if you are
  2484.   accessing /usr/local/bin chances are you will soon also need files
  2485.   from /usr/local/lib so placing these at separate drives allows less
  2486.   seeking and possible parallel operation and drive caching. It is quite
  2487.   possible that choosing what may appear less than ideal drive
  2488.   characteristics will still be advantageous if you can gain parallel
  2489.   operations. Identify common tasks, what partitions they use and try to
  2490.   keep these on separate physical drives.
  2491.  
  2492.   Just to illustrate my point I will give a few examples of task
  2493.   analysis here.
  2494.  
  2495.  
  2496.  
  2497.      Office software
  2498.         such as editing, word processing and spreadsheets are typical
  2499.         examples of low intensity software both in terms of CPU and disk
  2500.         intensity. However, should you have a single server for a huge
  2501.         number of users you should not forget that most such software
  2502.         have auto save facilities which cause extra traffic, usually on
  2503.         the home directories. Splitting users over several drives would
  2504.         reduce contention.
  2505.  
  2506.  
  2507.      News
  2508.         readers also feature auto save features on home directories so
  2509.         ISPs should consider separating home directories
  2510.  
  2511.         News spools are notorious for their deeply nested directories
  2512.         and their large number of very small files. Loss of a news spool
  2513.         partition is not a big problem for most people, too, so they are
  2514.         good candidates for a RAID 0 setup with many small disks to
  2515.         distribute the many seeks among multiple spindles. It is
  2516.         recommended in the manuals and FAQs for the INN news server to
  2517.         put news spool and .overview files on separate drives for larger
  2518.         installations.
  2519.  
  2520.         There is also a web page dedicated to INN optimising
  2521.         <http://www.spinne.com/usenet/inn-perf.html> well worth reading.
  2522.  
  2523.  
  2524.  
  2525.      Database
  2526.         applications can be demanding both in terms of drive usage and
  2527.         speed requirements. The details are naturally application
  2528.         specific, read the documentation carefully with disk
  2529.         requirements in mind. Also consider RAID both for performance
  2530.         and reliability.
  2531.  
  2532.  
  2533.      E-mail
  2534.         reading and sending involves home directories as well as in- and
  2535.         outgoing spool files. If possible keep home directories and
  2536.         spool files on separate drives. If you are a mail server or a
  2537.         mail hub consider putting in- and outgoing spool directories on
  2538.         separate drives.
  2539.  
  2540.         Losing mail is an extremely bad thing, if you are and ISP or
  2541.         major hub. Think about RAIDing your mail spool and consider
  2542.         frequent backups.
  2543.  
  2544.  
  2545.      Software development
  2546.         can require a large number of directories for binaries,
  2547.         libraries, include files as well as source and project files. If
  2548.         possible split as much as possible across separate drives. On
  2549.         small systems you can place /usr/src and project files on the
  2550.         same drive as the home directories.
  2551.  
  2552.  
  2553.      Web browsing
  2554.         is becoming more and more popular. Many browsers have a local
  2555.         cache which can expand to rather large volumes. As this is used
  2556.         when reloading pages or returning to the previous page, speed is
  2557.         quite important here. If however you are connected via a well
  2558.         configured proxy server you do not need more than typically a
  2559.         few megabytes per user for a session.  See also the sections on
  2560.         ``Home Directories'' and ``WWW''.
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.   8.5.  Usage requirements
  2567.  
  2568.   When you get a box of 10 or so CD-ROMs with a Linux distribution and
  2569.   the entire contents of the big FTP sites it can be tempting to install
  2570.   as much as your drives can take. Soon, however, one would find that
  2571.   this leaves little room to grow and that it is easy to bite over more
  2572.   than can be chewed, at least in polite company. Therefore I will make
  2573.   a few comments on a few points to keep in mind when you plan out your
  2574.   system. Comments here are actively sought.
  2575.      Testing
  2576.         Linux is simple and you don't even need a hard disk to try it
  2577.         out, if you can get the boot floppies to work you are likely to
  2578.         get it to work on your hardware. If the standard kernel does not
  2579.         work for you, do not forget that often there can be special boot
  2580.         disk versions available for unusual hardware combinations that
  2581.         can solve your initial problems until you can compile your own
  2582.         kernel.
  2583.  
  2584.  
  2585.      Learning
  2586.         about operating system is something Linux excels in, there is
  2587.         plenty of documentation and the source is available. A single
  2588.         drive with 50 MB is enough to get you started with a shell, a
  2589.         few of the most frequently used commands and utilities.
  2590.  
  2591.  
  2592.      Hobby
  2593.         use or more serious learning requires more commands and
  2594.         utilities but a single drive is still all it takes, 500 MB
  2595.         should give you plenty of room, also for sources and
  2596.         documentation.
  2597.  
  2598.  
  2599.      Serious
  2600.         software development or just serious hobby work requires even
  2601.         more space. At this stage you have probably a mail and news feed
  2602.         that requires spool files and plenty of space. Separate drives
  2603.         for various tasks will begin to show a benefit. At this stage
  2604.         you have probably already gotten hold of a few drives too. Drive
  2605.         requirements gets harder to estimate but I would expect 2-4 GB
  2606.         to be plenty, even for a small server.
  2607.  
  2608.  
  2609.      Servers
  2610.         come in many flavours, ranging from mail servers to full sized
  2611.         ISP servers. A base of 2 GB for the main system should be
  2612.         sufficient, then add space and perhaps also drives for separate
  2613.         features you will offer. Cost is the main limiting factor here
  2614.         but be prepared to spend a bit if you wish to justify the "S" in
  2615.         ISP. Admittedly, not all do it.
  2616.  
  2617.  
  2618.  
  2619.  
  2620.   8.6.  Servers
  2621.  
  2622.   Big tasks require big drives and a separate section here. If possible
  2623.   keep as much as possible on separate drives. Some of the appendices
  2624.   detail the setup of a small departmental server for 10-100 users. Here
  2625.   I will present a few consideration for the higher end servers. In
  2626.   general you should not be afraid of using RAID, not only because it is
  2627.   fast and safe but also because it can make growth a little less
  2628.   painful. All the notes below come as additions to the points mentioned
  2629.   earlier.
  2630.  
  2631.   Popular servers rarely just happens, rather they grow over time and
  2632.   this demands both generous amounts of disk space as well as a good net
  2633.   connection.  In many of these cases it might be a good idea to reserve
  2634.   entire SCSI drives, in singles or as arrays, for each task. This way
  2635.   you can move the data should the computer fail. Note that transferring
  2636.   drives across computers is not simple and might not always work,
  2637.   especially in the case of IDE drives. Drive arrays require careful
  2638.   setup in order to reconstruct the data correctly, so you might want to
  2639.   keep a paper copy of your fstab file as well as a note of SCSI IDs.
  2640.  
  2641.   8.6.1.  Home directories
  2642.  
  2643.   Estimate how many drives you will need, if this is more than 2 I would
  2644.   recommend RAID, strongly. If not you should separate users across your
  2645.   drives dedicated to users based on some kind of simple hashing
  2646.   algorithm.  For instance you could use the first 2 letters in the user
  2647.   name, so jbloggs is put on /u/j/b/jbloggs where /u/j is a symbolic
  2648.   link to a physical drive so you can get a balanced load on your
  2649.   drives.
  2650.  
  2651.  
  2652.   8.6.2.  Anonymous FTP
  2653.  
  2654.   This is an essential service if you are serious about service. Good
  2655.   servers are well maintained, documented, kept up to date, and
  2656.   immensely popular no matter where in the world they are located. The
  2657.   big server ftp.funet.fi is an excellent example of this.
  2658.  
  2659.   In general this is not a question of CPU but of network bandwidth.
  2660.   Size is hard to estimate, mainly it is a question of ambition and
  2661.   service attitudes. I believe the big archive at ftp.cdrom.com is a
  2662.   *BSD machine with 50 GB disk. Also memory is important for a dedicated
  2663.   FTP server, about 256 MB RAM would be sufficient for a very big
  2664.   server, whereas smaller servers can get the job done well with 64 MB
  2665.   RAM.  Network connections would still be the most important factor.
  2666.  
  2667.  
  2668.   8.6.3.  WWW
  2669.  
  2670.   For many this is the main reason to get onto the Internet, in fact
  2671.   many now seem to equate the two. In addition to being network
  2672.   intensive there is also a fair bit of drive activity related to this,
  2673.   mainly regarding the caches. Keeping the cache on a separate, fast
  2674.   drive would be beneficial. Even better would be installing a caching
  2675.   proxy server. This way you can reduce the cache size for each user and
  2676.   speed up the service while at the same time cut down on the bandwidth
  2677.   requirements.
  2678.  
  2679.   With a caching proxy server you need a fast set of drives, RAID0 would
  2680.   be ideal as reliability is not important here. Higher capacity is
  2681.   better but about 2 GB should be sufficient for most. Remember to match
  2682.   the cache period to the capacity and demand. Too long periods would on
  2683.   the other hand be a disadvantage, if possible try to adjust based on
  2684.   the URL. For more information check up on the most used servers such
  2685.   as Harvest, Squid <http://www.nlanr.net/Squid> and the one from
  2686.   Netscape.
  2687.  
  2688.  
  2689.   8.6.4.  Mail
  2690.  
  2691.   Handling mail is something most machines do to some extent. The big
  2692.   mail servers, however, come into a class of their own. This is a
  2693.   demanding task and a big server can be slow even when connected to
  2694.   fast drives and a good net feed. In the Linux world the big server at
  2695.   vger.rutgers.edu is a well known example. Unlike a news service which
  2696.   is distributed and which can partially reconstruct the spool using
  2697.   other machines as a feed, the mail servers are centralised. This makes
  2698.   safety much more important, so for a major server you should consider
  2699.   a RAID solution with emphasize on reliability. Size is hard to
  2700.   estimate, it all depends on how many lists you run as well as how many
  2701.   subscribers you have.
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.   8.6.5.  News
  2708.  
  2709.   This is definitely a high volume task, and very dependent on what news
  2710.   groups you subscribe to. On Nyx there is a fairly complete feed and
  2711.   the spool files consume about 17 GB. The biggest groups are no doubt
  2712.   in the alt.binary.* hierarchy, so if you for some reason decide not to
  2713.   get these you can get a good service with perhaps 12 GB. Still others,
  2714.   that shall remain nameless, feel 2 GB is sufficient to claim ISP
  2715.   status.  In this case news expires so fast I feel the spelling IsP is
  2716.   barely justified. A full newsfeed means a traffic of a few GB every
  2717.   day and this is an ever growing number.
  2718.  
  2719.  
  2720.   8.6.6.  Others
  2721.  
  2722.   There are many services available on the net and even though many have
  2723.   been put somewhat in the shadows by the web. Nevertheless, services
  2724.   like archie, gopher and wais just to name a few, still exist and
  2725.   remain valuable tools on the net. If you are serious about starting a
  2726.   major server you should also consider these services. Determining the
  2727.   required volumes is hard, it all depends on popularity and demand.
  2728.   Providing good service inevitably has its costs, disk space is just
  2729.   one of them.
  2730.  
  2731.  
  2732.   8.7.  Pitfalls
  2733.  
  2734.   The dangers of splitting up everything into separate partitions are
  2735.   briefly mentioned in the section about volume management. Still,
  2736.   several people have asked me to emphasize this point more strongly:
  2737.   when one partition fills up it cannot grow any further, no matter if
  2738.   there is plenty of space in other partitions.
  2739.  
  2740.   In particular look out for explosive growth in the news spool
  2741.   (/var/spool/news). For multi user machines with quotas keep an eye on
  2742.   /tmp and /var/tmp as some people try to hide their files there, just
  2743.   look out for filenames ending in gif or jpeg...
  2744.  
  2745.   In fact, for single physical drives this scheme offers very little
  2746.   gains at all, other than making file growth monitoring easier (using
  2747.   'df') and physical track positioning. Most importantly there is no
  2748.   scope for parallel disk access. A freely available volume management
  2749.   system would solve this but this is still some time in the future.
  2750.   However, when more specialised file systems become available even a
  2751.   single disk could benefit from being divided into several partitions.
  2752.  
  2753.  
  2754.  
  2755.   8.8.  Compromises
  2756.  
  2757.   One way to avoid the aforementioned pitfalls is to only set off fixed
  2758.   partitions to directories with a fairly well known size such as swap,
  2759.   /tmp and /var/tmp and group together the remainders into the remaining
  2760.   partitions using symbolic links.
  2761.  
  2762.   Example: a slow disk (slowdisk), a fast disk (fastdisk) and an
  2763.   assortment of files. Having set up swap and tmp on fastdisk; and /home
  2764.   and root on slowdisk we have (the fictitious) directories /a/slow,
  2765.   /a/fast, /b/slow and /b/fast left to allocate on the partitions
  2766.   /mnt.slowdisk and /mnt.fastdisk which represents the remaining
  2767.   partitions of the two drives.
  2768.  
  2769.   Putting /a or /b directly on either drive gives the same properties to
  2770.   the subdirectories. We could make all 4 directories separate
  2771.   partitions but would lose some flexibility in managing the size of
  2772.   each directory. A better solution is to make these 4 directories
  2773.   symbolic links to appropriate directories on the respective drives.
  2774.  
  2775.   Thus we make
  2776.  
  2777.  
  2778.  
  2779.        /a/fast point to /mnt.fastdisk/a/fast   or   /mnt.fastdisk/a.fast
  2780.        /a/slow point to /mnt.slowdisk/a/slow   or   /mnt.slowdisk/a.slow
  2781.        /b/fast point to /mnt.fastdisk/b/fast   or   /mnt.fastdisk/b.fast
  2782.        /b/slow point to /mnt.slowdisk/b/slow   or   /mnt.slowdisk/b.slow
  2783.  
  2784.  
  2785.  
  2786.  
  2787.   and we get all fast directories on the fast drive without having to
  2788.   set up a partition for all 4 directories. The second (right hand)
  2789.   alternative gives us a flatter files system which in this case can
  2790.   make it simpler to keep an overview of the structure.
  2791.  
  2792.   The disadvantage is that it is a complicated scheme to set up and plan
  2793.   in the first place and that all mount point and partitions have to be
  2794.   defined before the system installation.
  2795.  
  2796.  
  2797.  
  2798.  
  2799.   9.  Implementation
  2800.  
  2801.   Having done the layout you should now have a detailled description on
  2802.   what goes where. Most likely this will be on paper but hopefully
  2803.   someone will make a more automated system that can deal with
  2804.   everything from the design, through partitioning to formatting and
  2805.   installation. This is the route one will have to take to realise the
  2806.   design.
  2807.  
  2808.   Modern distributions come with installation tools that will guide you
  2809.   through partitioning and formatting and also set up /etc/fstab for you
  2810.   automatically. For later modifications, however, you will need to
  2811.   understand the underlying mechanisms.
  2812.  
  2813.  
  2814.   9.1.  Drives and Partitions
  2815.  
  2816.   When you start DOS or the like you will find all partitions labeled C:
  2817.   and onwards, with no differentiation on IDE, SCSI, network or whatever
  2818.   type of media you have. In the world of Linux this is rather
  2819.   different. During booting you will see partitions described like this:
  2820.  
  2821.   ______________________________________________________________________
  2822.   Dec  6 23:45:18 demos kernel: Partition check:
  2823.   Dec  6 23:45:18 demos kernel:  sda: sda1
  2824.   Dec  6 23:45:18 demos kernel:  hda: hda1 hda2
  2825.   ______________________________________________________________________
  2826.  
  2827.  
  2828.  
  2829.   SCSI drives are labelled sda, sdb, sdc etc, and (E)IDE drives are
  2830.   labelled hda, hdb, hdc etc.  There are also standard names for all
  2831.   devices, full information can be found in /dev/MAKEDEV and
  2832.   /usr/src/linux/Documentation/devices.txt.
  2833.  
  2834.   Partitions are labelled numerically for each drive hda1, hda2 and so
  2835.   on.  On SCSI drives there can be 15 partitions per drive, on EIDE
  2836.   drives there can be 63 partitions per drive. Both limits exceed what
  2837.   is currently useful for most disks.
  2838.  
  2839.   These are then mounted according to the file /etc/fstab before they
  2840.   appear as a part of the file system.
  2841.  
  2842.  
  2843.   9.2.  Partitioning
  2844.  
  2845.   First you have to partition each drive into a number of separate
  2846.   partitions.  Under Linux there are two main methods, fdisk and the
  2847.   more screen oriented cfdisk. These are complex programs, read the
  2848.   manual very carefully. Under DOS there are other choices, mainly the
  2849.   version of fdisk that is bundled with for instance DOS, or fips. The
  2850.   latter has the unique advantage here that it can repartition a drive
  2851.   without necessarily damaging existing data, unlike all the other
  2852.   partitioning programs.
  2853.  
  2854.   In order to get the most out of fips you should first defragment your
  2855.   drive. This way you can allocate more space to other partitions.
  2856.  
  2857.   Nevertheless, it is important you do a full backup of all your valued
  2858.   data before partitioning.
  2859.  
  2860.   Partitions come in 3 flavours, primary, extended and logical.  You
  2861.   have to use primary partitions for booting, but there is a maximum of
  2862.   4 primary partitions. If you want more you have to define an extended
  2863.   partition within which you define your logical partitions.
  2864.  
  2865.   Each partition has an identifier number which tells the operating
  2866.   system what it is, for Linux the types swap and ext2fs are the ones
  2867.   you will need to know.
  2868.  
  2869.   There is a readme file that comes with fdisk that gives more in-depth
  2870.   information on partitioning.
  2871.  
  2872.   Someone has just made a Partitioning HOWTO which contains excellent,
  2873.   in depth information on the nitty-gritty of partitioning. Rather than
  2874.   repeating it here and bloating this document further, I will instead
  2875.   refer you to it instead.
  2876.  
  2877.  
  2878.   9.3.  Multiple devices ( md )
  2879.  
  2880.   Being in a state of flux you should make sure to read the latest
  2881.   documentation on this kernel feature. It is not yet stable, beware.
  2882.  
  2883.   Briefly explained it works by adding partitions together into new
  2884.   devices md0, md1 etc. using mdadd before you activate them using
  2885.   mdrun. This process can be automated using the file /etc/mdtab.
  2886.  
  2887.   Then you then treat these like any other partition on a drive. Proceed
  2888.   with formatting etc. as described below using these new devices.
  2889.  
  2890.   There is now also a HOWTO in development for RAID using md you should
  2891.   read.
  2892.  
  2893.  
  2894.   9.4.  Formatting
  2895.  
  2896.   Next comes partition formatting, putting down the data structures that
  2897.   will describe the files and where they are located. If this is the
  2898.   first time it is recommended you use formatting with verify. Strictly
  2899.   speaking it should not be necessary but this exercises the I/O hard
  2900.   enough that it can uncover potential problems, such as incorrect
  2901.   termination, before you store your precious data. Look up the command
  2902.   mkfs for more details.
  2903.  
  2904.  
  2905.   Linux can support a great number of file systems, rather than
  2906.   repeating the details you can read the manpage for fs which describes
  2907.   them in some details. Note that your kernel has to have the drivers
  2908.   compiled in or made as modules in order to be able to use these
  2909.   features. When the time comes for kernel compiling you should read
  2910.   carefully through the file system feature list. If you use make
  2911.   menuconfig you can get online help for each file system type.
  2912.  
  2913.   Note that some rescue disk systems require minix, msdos and ext2fs to
  2914.   be compiled into the kernel.
  2915.  
  2916.   Also swap partitions have to be prepared, and for this you use mkswap.
  2917.  
  2918.  
  2919.   9.5.  Mounting
  2920.  
  2921.   Data on a partition is not available to the file system until it is
  2922.   mounted on a mount point. This can be done manually using mount or
  2923.   automatically during booting by adding appropriate lines to
  2924.   /etc/fstab. Read the manual for mount and pay close attention to the
  2925.   tabulation.
  2926.  
  2927.  
  2928.   10.  Maintenance
  2929.  
  2930.   It is the duty of the system manager to keep an eye on the drives and
  2931.   partitions. Should any of the partitions overflow, the system is
  2932.   likely to stop working properly, no matter how much space is available
  2933.   on other partitions, until space is reclaimed.
  2934.  
  2935.   Partitions and disks are easily monitored using df and should be done
  2936.   frequently, perhaps using a cron job or some other general system
  2937.   management tool.
  2938.  
  2939.   Do not forget the swap partitions, these are best monitored using one
  2940.   of the memory statistics programs such as free, procinfo or top.
  2941.  
  2942.   Drive usage monitoring is more difficult but it is important for the
  2943.   sake of performance to avoid contention - placing too much demand on a
  2944.   single drive if others are available and idle.
  2945.  
  2946.   It is important when installing software packages to have a clear idea
  2947.   where the various files go. As previously mentioned GCC keeps binaries
  2948.   in a library directory and there are also other programs that for
  2949.   historical reasons are hard to figure out, X11 for instance has an
  2950.   unusually complex structure.
  2951.  
  2952.   When your system is about to fill up it is about time to check and
  2953.   prune old logging messages as well as hunt down core files. Proper use
  2954.   of ulimit in global shell settings can help saving you from having
  2955.   core files littered around the system.
  2956.  
  2957.  
  2958.   10.1.  Backup
  2959.  
  2960.   The observant reader might have noticed a few hints about the
  2961.   usefulness of making backups. Horror stories are legio about accidents
  2962.   and what happened to the person responsible when the backup turned out
  2963.   to be non-functional or even non existent. You might find it simpler
  2964.   to invest in proper backups than a second, secret identity.
  2965.  
  2966.   There are many options and also a mini-HOWTO ( Backup-With-MSDOS )
  2967.   detailling what you need to know. In addition to the DOS specifics it
  2968.   also contains general information and further leads.
  2969.  
  2970.  
  2971.   In addition to making these backups you should also make sure you can
  2972.   restore the data. Not all systems verify that the data written is
  2973.   correct and many administrators have started restoring the system
  2974.   after an accident happy in the belief that everything is working, only
  2975.   to discover to their horror that the backups were useless. Be careful.
  2976.  
  2977.  
  2978.   10.2.  Defragmentation
  2979.  
  2980.   This is very dependent on the file system design, some suffer fast and
  2981.   nearly debilitating fragmentation. Fortunately for us, ext2fs does not
  2982.   belong to this group and therefore there has been very little talk
  2983.   about making a defragmentation tool.
  2984.  
  2985.   If for some reason you feel this is necessary, the quick and easy
  2986.   solution is to do a backup and a restore. If only a small area is
  2987.   affected, for instance the home directories, you could tar it over to
  2988.   a temporary area on another partition, verify the archive, delete the
  2989.   original and then untar it back again.
  2990.  
  2991.  
  2992.   10.3.  Deletions
  2993.  
  2994.   Quite often disk space shortages can be remedied simply by deleting
  2995.   unnecessary files that accumulate around the system. Quite often
  2996.   programs that terminate abnormally cause all kinds of mess lying
  2997.   around the oddest places. Normally a core dump results after such an
  2998.   incident and unless you are going to debug it you can simply delete
  2999.   it. These can be found everywhere so you are advised to do a global
  3000.   search for them now and then.
  3001.  
  3002.   Unexpected termination can also cause all sorts of temporary files
  3003.   remaining in places like /tmp or /var/tmp, files that are
  3004.   automatically removed when the program ends normally. Rebooting cleans
  3005.   up some of these areas but not necessary all and if you have a long
  3006.   uptime you could end up with a lot of old junk. If space is short you
  3007.   have to delete with care, make sure the file is not in active use
  3008.   first. Utilities like file can often tell you what kind of file you
  3009.   are looking at.
  3010.  
  3011.   Many things are logged when the system is running, mostly to files in
  3012.   the /var/log area. In particular the file /var/log/messages tends to
  3013.   grow until deleted. It is a good idea to keep a small archive of old
  3014.   log files around for comparison should the system start to behave
  3015.   oddly.
  3016.  
  3017.   If the mail or news system is not working properly you could have
  3018.   excessive growth in their spool areas, /var/spool/mail and
  3019.   /var/spool/news respectively. Beware of the overview files as these
  3020.   have a leading dot which makes them invisible to ls -l, it is always
  3021.   better to use ls -Al which will reveal them.
  3022.  
  3023.   User space overflow is a particularly tricky topic. Wars have been
  3024.   waged between system administrators and users. Tact, diplomacy and a
  3025.   generous budget for new drives is what is needed. Make use of the
  3026.   message-of-the-day feature, information displayed during login from
  3027.   the /etc/motd file to tell users when space is short.  Setting the
  3028.   default shell settings to prevent core files being dumped can save you
  3029.   a lot of work too.
  3030.  
  3031.   Certain kinds of people try to hide files around the system, usually
  3032.   trying to take advantage of the fact that files with a leading dot in
  3033.   the name are invisible to the ls command.  One common example are
  3034.   files that look like ... that normally either are not seen, or, when
  3035.   using ls -al disappear in the noise of normal files like . or .. that
  3036.   are in every directory.  There is however a countermeasure to this,
  3037.   use ls -Al that suppresses . or .. but shows all other dot-files.
  3038.  
  3039.  
  3040.   10.4.  Upgrades
  3041.  
  3042.   No matter how large your drives, time will come when you will find you
  3043.   need more. As technology progresses you can get ever more for your
  3044.   money. At the time of writing this, it appears that 6.4 GB drives
  3045.   gives you the most bang for your bucks.
  3046.  
  3047.   Note that with IDE drives you might have to remove an old drive, as
  3048.   the maximum number supported on your mother board is normally only 2
  3049.   or some times 4. With SCSI you can have up to 7 for narrow (8-bit)
  3050.   SCSI or up to 15 for wide (15 bit) SCSI, per channel. Some host
  3051.   adapters can support more than a single channel and in any case you
  3052.   can have more than one host adapter per system. My personal
  3053.   recommendation is that you will most likely be better off with SCSI in
  3054.   the long run.
  3055.  
  3056.   The question comes, where should you put this new drive? In many cases
  3057.   the reason for expansion is that you want a larger spool area, and in
  3058.   that case the fast, simple solution is to mount the drive somewhere
  3059.   under /var/spool. On the other hand newer drives are likely to be
  3060.   faster than older ones so in the long run you might find it worth your
  3061.   time to do a full reorganizing, possibly using your old design sheets.
  3062.  
  3063.   If the upgrade is forced by running out of space in partitions used
  3064.   for things like /usr or /var the upgrade is a little more involved.
  3065.   You might consider the option of a full re-installation from your
  3066.   favourite (and hopefully upgraded) distribution. In this case you will
  3067.   have to be careful not to overwrite your essential setups. Usually
  3068.   these things are in the /etc directory. Proceed with care, fresh
  3069.   backups and working rescue disks. The other possibility is to simply
  3070.   copy the old directory over to the new directory which is mounted on a
  3071.   temporary mount point, edit your /etc/fstab file, reboot with your new
  3072.   partition in place and check that it works.  Should it fail you can
  3073.   reboot with your rescue disk, re-edit /etc/fstab and try again.
  3074.  
  3075.   Until volume management becomes available to Linux this is both
  3076.   complicated and dangerous. Do not get too surprised if you discover
  3077.   you need to restore your system from a backup.
  3078.  
  3079.   The Tips-HOWTO gives the following example on how to move an entire
  3080.   directory structure across:
  3081.  
  3082.   ______________________________________________________________________
  3083.   (cd /source/directory; tar cf - . ) | (cd /dest/directory; tar xvfp -)
  3084.   ______________________________________________________________________
  3085.  
  3086.  
  3087.  
  3088.   While this approach to moving directory trees is portable among many
  3089.   Unix systems, it is inconvenient to remember. Also, it fails for
  3090.   deeply nested directory trees when pathnames become to long to handle
  3091.   for tar (GNU tar has special provisions to deal with long pathnames).
  3092.  
  3093.   If you have access to GNU cp (which is always the case on Linux
  3094.   systems), you could as well use
  3095.  
  3096.  
  3097.   ______________________________________________________________________
  3098.   cp -av /source/directory /dest/directory
  3099.   ______________________________________________________________________
  3100.  
  3101.  
  3102.  
  3103.   GNU cp knows specifically about symbolic links, FIFOs and device files
  3104.   and will copy them correctly.
  3105.  
  3106.  
  3107.   11.  Advanced Issues
  3108.  
  3109.   Linux and related systems offer plenty of possibilities for fast,
  3110.   efficient and devastating destruction. This document is no exception.
  3111.   With power comes dangers and the following sections describe a few
  3112.   more esoteric issues that should not be attempted before reading and
  3113.   understanding the documentation, the issues and the dangers. You
  3114.   should also make a backup. Also remember to try to restore the system
  3115.   from scratch from your backup at least once.  Otherwise you might not
  3116.   be the first to be found with a perfect backup of your system and no
  3117.   tools available to reinstall it (or, even more embarrassing, some
  3118.   critical files missing on tape).
  3119.  
  3120.   The techniques described here are rarely necessary but can be used for
  3121.   very specific setups. Think very clearly through what you wish to
  3122.   accomplish before playing around with this.
  3123.  
  3124.  
  3125.   11.1.  Hard Disk Tuning
  3126.  
  3127.   The hard drive parameters can be tuned using the hdparms utility. Here
  3128.   the most interesting parameter is probably the read-ahead parameter
  3129.   which determines how much prefetch should be done in sequential
  3130.   reading.
  3131.  
  3132.   If you want to try this out it makes most sense to tune for the
  3133.   characteristic file size on your drive but remember that this tuning
  3134.   is for the entire drive which makes it a bit more difficult. Probably
  3135.   this is only of use on large servers using dedicated news drives etc.
  3136.  
  3137.   For safety the default hdparm settings are rather conservative. The
  3138.   disadvantage is that this mean you can get lost interrupts if you have
  3139.   a high frequency of IRQs as you would when using the serial port and
  3140.   an IDE disk as IRQs from the latter would mask other IRQs. THis would
  3141.   be noticable as less then ideal performance when downloading data from
  3142.   the net to disk. Setting hdparm -u1 device would prevent this masking
  3143.   and either improve your performance or, depending on hardware, corrupt
  3144.   the data on your disk. Experiment with caution and fresh backups.
  3145.  
  3146.  
  3147.   11.2.  File System Tuning
  3148.  
  3149.   Most file systems come with a tuning utility and for ext2fs there is
  3150.   the tune2fs utility. Several parameters can be modified but perhaps
  3151.   the most useful parameter here is what size should be reserved and who
  3152.   should be able to take advantage of this which could help you getting
  3153.   more useful space out of your drives, possibly at the cost of less
  3154.   room for repairing a system should it crash.
  3155.  
  3156.  
  3157.   11.3.  Spindle Synchronizing
  3158.  
  3159.   This should not in itself be dangerous, other than the peculiar fact
  3160.   that the exact details of the connections remain unclear for many
  3161.   drives. The theory is simple: keeping a fixed phase difference between
  3162.   the different drives in a RAID setup makes for less waiting for the
  3163.   right track to come into position for the read/write head. In practice
  3164.   it now seems that with large read-ahead buffers in the drives the
  3165.   effect is negligible.
  3166.  
  3167.   Spindle synchronisation should not be used on RAID0 or RAID 0/1 as you
  3168.   would then lose the benefit of having the read heads over different
  3169.   areas of the mirrored sectors.
  3170.  
  3171.  
  3172.  
  3173.   12.  Further Information
  3174.  
  3175.   There is wealth of information one should go through when setting up a
  3176.   major system, for instance for a news or general Internet service
  3177.   provider.  The FAQs in the following groups are useful:
  3178.  
  3179.  
  3180.   12.1.  News groups
  3181.  
  3182.   Some of the most interesting news groups are:
  3183.  
  3184.   o  Storage <news:comp.arch.storage>.
  3185.  
  3186.   o  PC storage <news:comp.sys.ibm.pc.hardware.storage>.
  3187.  
  3188.   o  AFS <news:alt.filesystems.afs>.
  3189.  
  3190.   o  SCSI <news:comp.periphs.scsi>.
  3191.  
  3192.   o  Linux setup <news:comp.os.linux.setup>.
  3193.  
  3194.   Most newsgroups have their own FAQ that are designed to answer most of
  3195.   your questions, as the name Frequently Asked Questions indicate. Fresh
  3196.   versions should be posted regularly to the relevant newsgroups. If you
  3197.   cannot find it in your news spool you could go directly to the FAQ
  3198.   main archive FTP site <ftp://rtfm.mit.edu>. The WWW versions can be
  3199.   browsed at FAQ main archive WWW site <http://www.cis.ohio-
  3200.   state.edu/hypertext/faq/usenet/FAQ-List.html>.
  3201.  
  3202.   Some FAQs have their own home site, of particular interest here are
  3203.  
  3204.   o  SCSI FAQ <http://www.paranoia.com/~filipg/HTML/LINK/F_SCSI.html>
  3205.      and
  3206.  
  3207.   o  comp.arch.storage FAQ
  3208.      <http://alumni.caltech.edu/~rdv/comp_arch_storage/FAQ-1.html>.
  3209.  
  3210.  
  3211.  
  3212.   12.2.  Mailing lists
  3213.  
  3214.   These are low noise channels mainly for developers. Think twice before
  3215.   asking questions there as noise delays the development.  Some relevant
  3216.   lists are linux-raid, linux-scsi and linux-ext2fs.  Many of the most
  3217.   useful mailing lists run on the vger.rutgers.edu server but this is
  3218.   notoriously overloaded, so try to find a mirror. There are some lists
  3219.   mirrored at The Redhat Home Page <http://www.redhat.com>.  Many lists
  3220.   are also accessible at linuxhq <http://www.linuxhq.com/lnxlists>, and
  3221.   the rest of the web site is a gold mine of useful information.
  3222.  
  3223.   If you want to find out more about the lists available you can send a
  3224.   message with the line lists to the list server at vger.rutgers.edu
  3225.   <mailto:majordomo@vger.rutgers.edu>.  If you need help on how to use
  3226.   the mail server just send the line help to the same address.  Due to
  3227.   the popularity of this server it is likely it takes a bit to time
  3228.   before you get a reply or even get messages after you send a subscribe
  3229.   command.
  3230.  
  3231.   There is also a number of other majordomo list servers that can be of
  3232.   interest such as the EATA driver list <mailto:linux-eata@mail.uni-
  3233.   mainz.de> and the Intelligent IO list <mailto:linux-i2o@dpt.com>.
  3234.  
  3235.   Mailing lists are in a state of flux but you can find links to a
  3236.   number of interesting lists from the Linux Documentation Homepage
  3237.   <http://sunsite.unc.edu/LDP>.
  3238.  
  3239.  
  3240.  
  3241.   12.3.  HOWTO
  3242.  
  3243.   These are intended as the primary starting points to get the
  3244.   background information as well as show you how to solve a specific
  3245.   problem.  Some relevant HOWTOs are Bootdisk, Installation,  SCSI and
  3246.   UMSDOS.  The main site for these is the LDP archive
  3247.   <http://sunsite.unc.edu/LDP> at Sunsite.
  3248.  
  3249.   There is a a new HOWTO out that deals with setting up a DPT RAID
  3250.   system, check out the DPT RAID HOWTO homepage
  3251.   <http://www.ram.org/computing/linux/dpt_raid.html>.
  3252.  
  3253.  
  3254.  
  3255.  
  3256.   12.4.  Mini-HOWTO
  3257.  
  3258.   These are the smaller free text relatives to the HOWTOs.  Some
  3259.   relevant mini-HOWTOs are Backup-With-MSDOS, Diskless, LILO,
  3260.   Linux+DOS+Win95+OS2, Linux+OS2+DOS, Linux+Win95, NFS-Root,
  3261.   Win95+Win+Linux, ZIP Drive .  You can find these at the same place as
  3262.   the HOWTOs, usually in a sub directory called mini. Note that these
  3263.   are scheduled to be converted into SGML and become proper HOWTOs in
  3264.   the near future.
  3265.  
  3266.   The old Linux Large IDE mini-HOWTO is no longer valid, instead read
  3267.   /usr/src/linux/drivers/block/README.ide or
  3268.   /usr/src/linux/Documentation/ide.txt.
  3269.  
  3270.  
  3271.   12.5.  Local resources
  3272.  
  3273.   In most distributions of Linux there is already a document directory
  3274.   already, have a look in the document archive <file:///usr/doc> where
  3275.   most packages store their main documentation and README files etc.
  3276.   Also you will here find the HOWTO archive <file:///usr/doc/HOWTO> of
  3277.   ready formatted HOWTOs and also the mini-HOWTO archive
  3278.   <file:///usr/doc/HOWTO/mini> of plain text documents.
  3279.  
  3280.   Many of the configuration files mentioned earlier can be found in the
  3281.   etc <file:///etc> directory. In particular you will want to work with
  3282.   the fstab <file:///etc/fstab> file that sets up the mounting of
  3283.   partitions and possibly also mdtab <file:///etc/mdtab> file that is
  3284.   used for the md system to set up RAID.
  3285.  
  3286.   The kernel source <file:///usr/src/linux> is, of course, the ultimate
  3287.   documentation. In other words, use the source, Luke.  It should also
  3288.   be pointed out that the kernel comes not only with source code which
  3289.   is even commented (well, partially at least) but also an informative
  3290.   documentation directory <file:///usr/src/linux/Documentation>.  If you
  3291.   are about to ask any questions about the kernel you should read this
  3292.   first, it will save you and many others a lot of time and possibly
  3293.   embarrassment.
  3294.  
  3295.   Also have a look in your system log file <file:///var/log/messages> to
  3296.   see what is going on and in particular how the booting went if too
  3297.   much scrolled off your screen. Using tail -f /var/log/messages in a
  3298.   separate window or screen will give you a continuous update of what is
  3299.   going on in your system.
  3300.  
  3301.   You can also take advantage of the /proc <file:///proc> file system
  3302.   that is a window into the inner workings of your system.  Use cat
  3303.   rather than more to view the files as they are reported as being zero
  3304.   length.
  3305.  
  3306.   Much of the work here is based on the Filesystem Structure Standard
  3307.   (FSSTND).  It has changed name to File Hierarchy Standard (FHS) and is
  3308.   less Linux specific.  The maintainer has set up a home page
  3309.   <http://www.pathname.com/fhs> which tells you how to join the
  3310.   currently private mailing list, where the development takes place.
  3311.  
  3312.  
  3313.  
  3314.   12.6.  Web pages
  3315.  
  3316.   There is a huge number of informative web pages out there and by their
  3317.   very nature they change quickly so don't be too surprised if these
  3318.   links become quickly outdated.
  3319.  
  3320.   A good starting point is of course the Sunsite LDP archive
  3321.   <http://sunsite.unc.edu/LDP/> that is a information central for
  3322.   documentation, project pages and much, much more.
  3323.  
  3324.  
  3325.  
  3326.   o  Mike Neuffer, the author of the DPT caching RAID controller
  3327.      drivers, has some interesting pages on SCSI <http://www.uni-
  3328.      mainz.de/~neuffer/scsi> and DPT <http://www.uni-
  3329.      mainz.de/~neuffer/scsi/dpt>.
  3330.  
  3331.   o  Software RAID 1 development information can be found at RAID 1
  3332.      development page <http://www.nuclecu.unam.mx/~miguel/raid>.
  3333.  
  3334.   o  Disk related information on benchmarking, RAID, reliability and
  3335.      much, much more can be found at Linas Vepstas <http://linas.org>
  3336.      project page.
  3337.  
  3338.   o  There is also information available on how to RAID the root
  3339.      partition <ftp://ftp.bizsystems.com/pub/raid/Root-RAID-HOWTO.html>
  3340.      and what software packages are needed to achieve this.
  3341.  
  3342.   o  In depth documentation on ext2fs
  3343.      <http://step.polymtl.ca/~ldd/ext2fs/ext2fs_toc.html> is also
  3344.      available.
  3345.  
  3346.   o  Mark D. Roth has information on VPS
  3347.      <http://www.uiuc.edu/ph/www/roth>
  3348.  
  3349.   o  A similar kind of project on an Enhanced File System
  3350.      <http://www.virtual.net.au/~rjh/enh-fs.html>
  3351.  
  3352.   o  People who are awaiting support for VFAT32 and Joliet could have a
  3353.      look at the development page
  3354.      <http://bmrc.berkeley.edu/people/chaffee/index.html> for a preview.
  3355.      These drivers are now entering the 2.1.x kernel development series.
  3356.  
  3357.   o  There is an ongoing compression project that integrates in ext2fs
  3358.      and is called e2compr. For more information check out the e2compr
  3359.      homepage <http://netspace.net.au/~reiter/e2compr.html>.
  3360.  
  3361.   o  For more information on booting and also some BSD information have
  3362.      a look at booting information
  3363.      <http://www.paranoia.com/~vax/boot.html> page.
  3364.  
  3365.   For diagrams and information on all sorts of disk drives, controllers
  3366.   etc. both for current and discontinued lines The Ref
  3367.   <http://theref.c3d.rl.af.mil> is the site you need. There is a lot of
  3368.   useful information here, a real treasure trove.  You can also download
  3369.   the database using FTP <ftp://theref.c3d.rl.af.mil/public>.
  3370.  
  3371.   Please let me know if you have any other leads that can be of
  3372.   interest.
  3373.  
  3374.  
  3375.  
  3376.  
  3377.   12.7.  Search engines
  3378.  
  3379.   Remember you can also use the web search engines and that some, like
  3380.  
  3381.   o  Altavista <http://www.altavista.digital.com>
  3382.  
  3383.   o  Excite <http://www.excite.com>
  3384.  
  3385.   o  Hotbot <http://www.hotbot.com>
  3386.  
  3387.      can also search usenet news.
  3388.  
  3389.   Also remember that Dejanews <http://www.dejanews.com> is a dedicated
  3390.   news searcher that keeps a news spool from early 1995 and onwards.
  3391.  
  3392.  
  3393.   If you have to ask for help you are most likely to get help in the
  3394.   comp.os.linux.setup news group. Due to large workload and a slow
  3395.   network connection I am not able to follow that newsgroup so if you
  3396.   want to contact me you have to do so by e-mail.
  3397.  
  3398.  
  3399.  
  3400.   13.  Getting Help
  3401.  
  3402.  
  3403.   In the end you might find yourself unable to solve your problems and
  3404.   need help from someone else. The most efficient way is either to ask
  3405.   someone local or in your nearest Linux user group, search the web for
  3406.   the nearest one.
  3407.  
  3408.   Another possibility is to ask on Usenet News in one of the many, many
  3409.   newsgroups available. The problem is that these have such a high
  3410.   volume and noise (called low signal-to-noise ratio) that your question
  3411.   can easily fall through unanswered.
  3412.  
  3413.   No matter where you ask it is important to ask well or you will not be
  3414.   taken seriously. Saying just my disk does not work is not going to
  3415.   help you and instead the noise level is increased even further and if
  3416.   you are lucky someone will ask you to clarify.
  3417.  
  3418.   Instead you are recommended to describe your problems in some detail
  3419.   that will enable people to help you. The problem could lie somewhere
  3420.   you did not expect. Therefore you are advised to list up the following
  3421.   information on your system:
  3422.  
  3423.  
  3424.      Hardware
  3425.  
  3426.      o  Processor
  3427.  
  3428.      o  Chip set (Triton, Saturn etc)
  3429.  
  3430.      o  Bus (ISA, VESA, PCI etc)
  3431.  
  3432.  
  3433.      o  Expansion cards used (Disk controllers, video, io etc)
  3434.  
  3435.  
  3436.      Software
  3437.  
  3438.      o  BIOS (On motherboard and possibly SCSI host adapters)
  3439.  
  3440.      o  LILO, if used
  3441.  
  3442.      o  Linux kernel version as well as possible modifications and
  3443.         patches
  3444.  
  3445.      o  Kernel parameters, if any
  3446.  
  3447.      o  Software that shows the error (with version number or date)
  3448.  
  3449.  
  3450.      Peripherals
  3451.  
  3452.      o  Type of disk drives with manufacturer name, version and type
  3453.  
  3454.      o  Other relevant peripherals connected to the same busses
  3455.  
  3456.  
  3457.   As an example of how interrelated these problems are: an old chip set
  3458.   caused problems with a certain combination of video controller and
  3459.   SCSI host adapter.
  3460.  
  3461.   Remember that booting text is logged to /var/log/messages which can
  3462.   answer most of the questions above. Obviously if the drives fail you
  3463.   might not be able to get  the log saved to disk but you can at least
  3464.   scroll back up the screen using the SHIFT and PAGE UP keys. It may
  3465.   also be useful to include part of this in you request for help but do
  3466.   not go overboard, keep it brief as a complete log file dumped to
  3467.   Usenet News is more than a little annoying.
  3468.  
  3469.  
  3470.  
  3471.   14.  Concluding Remarks
  3472.  
  3473.   Disk tuning and partition decisions are difficult to make, and there
  3474.   are no hard rules here. Nevertheless it is a good idea to work more on
  3475.   this as the payoffs can be considerable. Maximizing usage on one drive
  3476.   only while the others are idle is unlikely to be optimal, watch the
  3477.   drive light, they are not there just for decoration. For a properly
  3478.   set up system the lights should look like Christmas in a disco. Linux
  3479.   offers software RAID but also support for some hardware base SCSI RAID
  3480.   controllers. Check what is available. As your system and experiences
  3481.   evolve you are likely to repartition and you might look on this
  3482.   document again. Additions are always welcome.
  3483.  
  3484.  
  3485.  
  3486.   14.1.  Coming Soon
  3487.  
  3488.   There are a few more important things that are about to appear here.
  3489.   In particular I will add more example tables as I am about to set up
  3490.   two fairly large and general systems, one at work and one at home.
  3491.   These should give some general feeling on how a system can be set up
  3492.   for either of these two purposes. Examples of smooth running existing
  3493.   systems are also welcome.
  3494.  
  3495.   There is also a fair bit of work left to do on the various kinds of
  3496.   file systems and utilities.
  3497.  
  3498.  
  3499.   There will be a big addition on drive technologies coming soon as well
  3500.   as a more in depth description on using fdisk or cfdisk.  The file
  3501.   systems will be beefed up as more features become available as well as
  3502.   more on RAID and what directories can benefit from what RAID level.
  3503.  
  3504.   Recently I received an information pack from DPT, who made the first
  3505.   hardware RAID supported by Linux. Their leaflets now carry the
  3506.   familiar penguin logo to show they support Linux. More in-depth
  3507.   information will come soon.
  3508.  
  3509.   There is some minor overlapping with the Linux Filesystem Structure
  3510.   Standard that I hope to integrate better soon, which will probably
  3511.   mean a big reworking of all the tables at the end of this document.
  3512.   When the new version is released there will be a substantial rewrite
  3513.   of some of the sections in this HOWTO but no release date has been
  3514.   announced yet.
  3515.  
  3516.   When the new standard appear various details such as directory names,
  3517.   sizes and file placements will be changed.
  3518.  
  3519.   I have made the assumption that the first partition starts at track 0
  3520.   and that this track is the innermost track. That, however, is looking
  3521.   more and more like an unwarranted assumption, and not only because of
  3522.   the logical re-mapping that takes place. More on this when information
  3523.   becomes available.
  3524.  
  3525.   As more people start reading this I should get some more comments and
  3526.   feedback. I am also thinking of making a program that can automate a
  3527.   fair bit of this decision making process and although it is unlikely
  3528.   to be optimum it should provide a simpler, more complete starting
  3529.   point.
  3530.  
  3531.  
  3532.   14.2.  Request for Information
  3533.  
  3534.   It has taken a fair bit of time to write this document and although
  3535.   most pieces are beginning to come together there are still some
  3536.   information needed before we are out of the beta stage.
  3537.  
  3538.  
  3539.   o  More information on swap sizing policies is needed as well as
  3540.      information on the largest swap size possible under the various
  3541.      kernel versions.
  3542.  
  3543.   o  How common is drive or file system corruption? So far I have only
  3544.      heard of problems caused by flaky hardware.
  3545.  
  3546.   o  References to speed and drives is needed.
  3547.  
  3548.   o  Are any other Linux compatible RAID controllers available?
  3549.  
  3550.   o  Leads to file system, volume management and other related software
  3551.      is welcome.
  3552.  
  3553.   o  What relevant monitoring, management and maintenance tools are
  3554.      available?
  3555.  
  3556.   o  General references to information sources are needed, perhaps this
  3557.      should be a separate document?
  3558.  
  3559.   o  Usage of /tmp and /var/tmp has been hard to determine, in fact what
  3560.      programs use which directory is not well defined and more
  3561.      information here is required. Still, it seems at least clear that
  3562.      these should reside on different physical drives in order to
  3563.      increase parallelicity.
  3564.  
  3565.   14.3.  Suggested Project Work
  3566.  
  3567.   Now and then people post on comp.os.linux.*, looking for good project
  3568.   ideas. Here I will list a few that comes to mind that are relevant to
  3569.   this document. Plans about big projects such as new file systems
  3570.   should still be posted in order to either find co-workers or see if
  3571.   someone is already working on it.
  3572.  
  3573.  
  3574.  
  3575.      Planning tools
  3576.         that can automate the design process outlines earlier would
  3577.         probably make a medium sized project, perhaps as an exercise in
  3578.         constraint based programming.
  3579.  
  3580.  
  3581.      Partitioning tools
  3582.         that take the output of the previously mentioned program and
  3583.         format drives in parallel and apply the appropriate symbolic
  3584.         links to the directory structure. It would probably be best if
  3585.         this were integrated in existing system installation software.
  3586.         The drive partitioning setup used in Solaris is an example of
  3587.         what it can look like.
  3588.  
  3589.  
  3590.      Surveillance tools
  3591.         that keep an eye on the partition sizes and warn before a
  3592.         partition overflows.
  3593.  
  3594.  
  3595.      Migration tools
  3596.         that safely lets you move old structures to new (for instance
  3597.         RAID) systems. This could probably be done as a shell script
  3598.         controlling a back up program and would be rather simple. Still,
  3599.         be sure it is safe and that the changes can be undone.
  3600.  
  3601.  
  3602.  
  3603.   15.  Questions and Answers
  3604.  
  3605.   This is just a collection of what I believe are the most common
  3606.   questions people might have. Give me more feedback and I will turn
  3607.   this section into a proper FAQ.
  3608.  
  3609.  
  3610.   o  Q:How many physical disk drives (spindles) does a Linux system
  3611.      need?
  3612.  
  3613.      A: Linux can run just fine on one drive (spindle).  Having enough
  3614.      RAM (around 32 MB, and up to 64 MB) to support swapping is a better
  3615.      price/performance choice than getting a second disk.  (E)IDE disk
  3616.      is usually cheaper (but a little slower) than SCSI.
  3617.  
  3618.  
  3619.   o  Q: I have a single drive, will this HOWTO help me?
  3620.  
  3621.      A: Yes, although only to a minor degree. Still, the section on
  3622.      ``Physical Track Positioning'' will offer you some gains.
  3623.  
  3624.  
  3625.   o  Q: Are there any disadvantages in this scheme?
  3626.  
  3627.      A: There is only a minor snag: if even a single partition overflows
  3628.      the system might stop working properly. The severity depends of
  3629.      course on what partition is affected. Still this is not hard to
  3630.      monitor, the command df gives you a good overview of the situation.
  3631.      Also check the swap partition(s) using free to make sure you are
  3632.      not about to run out of virtual memory.
  3633.  
  3634.  
  3635.   o  Q: OK, so should I split the system into as many partitions as
  3636.      possible for a single drive?
  3637.  
  3638.      A: No, there are several disadvantages to that. First of all
  3639.      maintenance becomes needlessly complex and you gain very little in
  3640.      this. In fact if your partitions are too big you will seek across
  3641.      larger areas than needed.  This is a balance and dependent on the
  3642.      number of physical drives you have.
  3643.  
  3644.  
  3645.   o  Q: Does that mean more drives allows more partitions?
  3646.  
  3647.      A: To some degree, yes. Still, some directories should not be split
  3648.      off from root, check out the file system standard (soon released
  3649.      under the name File Hierarchy Standard) for more details.
  3650.  
  3651.  
  3652.   o  Q: What if I have many drives I want to use?
  3653.  
  3654.      A: If you have more than 3-4 drives you should consider using RAID
  3655.      of some form. Still, it is a good idea to keep your root partition
  3656.      on a simple partition without RAID, see the section on ``RAID'' for
  3657.      more details.
  3658.  
  3659.  
  3660.   o  Q: I have installed the latest Windows95 but cannot access this
  3661.      partition from within the Linux system, what is wrong?
  3662.  
  3663.      A: Most likely you are using FAT32 in your windows partition. It
  3664.      seems that Microsoft decided we needed yet another format, and this
  3665.      was introduced in their latest version of Windows95, called OSR2.
  3666.      The advantage is that this format is better suited to large drives.
  3667.      Unfortunately there is no stable driver for Linux out yet . A test
  3668.      version is out but not yet in the standard kernel.
  3669.  
  3670.      You might also be interested to hear that Microsoft NT 4.0 does not
  3671.      support it yet either.
  3672.  
  3673.      Until a stable version is available you can avoid this problem by
  3674.      installing Windows95 over an existing FAT16 partition, made for
  3675.      instance by an older installation of DOS. This forces the Windows95
  3676.      to use FAT16 which is supported by Linux.
  3677.  
  3678.  
  3679.   o  Q: I cannot get the disk size and partition sizes to match,
  3680.      something is missing. What has happened?
  3681.  
  3682.      A:It is possible you have mounted a partition onto a mount point
  3683.      that was not an empty directory. Mount points are directories and
  3684.      if it is not empty the mounting will mask the contents. If you do
  3685.      the sums you will see the amount of disk space used in this
  3686.      directory is missing from the observed total.
  3687.  
  3688.      To solve this you can boot from a rescue disk and see what is
  3689.      hiding behind your mount points and remove or transfer the contents
  3690.      by mounting th offending partition on a temporary mounting point.
  3691.      You might find it useful to have "spare" emergency mounting points
  3692.      ready made.
  3693.  
  3694.  
  3695.   o  Q: What is this nyx that is mentioned several times here?
  3696.  
  3697.      A: It is a large free Unix system with currently about 10000 users.
  3698.      I use it for my web pages for this HOWTO as well as a source of
  3699.      ideas for a setup of large Unix systems. It has been running for
  3700.      many years and has a quite stable setup. For more information you
  3701.      can view the Nyx homepage <http://www.nyx.net> which also gives you
  3702.      information on how to get your own free account.
  3703.  
  3704.  
  3705.  
  3706.  
  3707.   16.  Bits and Pieces
  3708.  
  3709.   This is basically a section where I stuff all the bits I have not yet
  3710.   decided where should go, yet that I feel is worth knowing about. It is
  3711.   a kind of transient area.
  3712.  
  3713.  
  3714.   16.1.  Combining swap  and /tmp
  3715.  
  3716.   Recently there have been discussions in the various linux related news
  3717.   groups about specialized file systems for temporary storage.  This is
  3718.   partly inspired by the tmpfs on *BSD* and Solaris, as well as swapfs
  3719.   on the NeXT machines.
  3720.  
  3721.   The rationale is that these are temporary storage that normally does
  3722.   not require much space, yet in normal systems you need to reserve a
  3723.   certain amount of space for these. Elementary statistical knowledge
  3724.   tells you (very simplified) that when you sum a number of variables
  3725.   the relative statistical uncertainty decreases. So combining swap and
  3726.   /tmp you do not need to reserve as much space as you otherwise would
  3727.   need.
  3728.  
  3729.   This specialized file system is nothing more than a swappable RAM disk
  3730.   that are swapped out to disk when and only when space is limited, thus
  3731.   effectively putting temporary files on the swap partition.
  3732.  
  3733.   There is, however, a snag. This scheme prevents you from getting
  3734.   parallel activity on swap and /tmp drives so under heavy activity the
  3735.   system takes a bigger performance hit. Put another way, you trade
  3736.   speed to get space. Interleaving across multiple drives reduces this
  3737.   somewhat.
  3738.  
  3739.  
  3740.   16.2.  Interleaved swap  drives.
  3741.  
  3742.   This is not striping across several drives, instead drives are
  3743.   accessed in a round robin fashion in order to spread the load in a
  3744.   crude fashion.  In Linux you additionally have a priority parameter
  3745.   you can adjust for tuning your system, especially useful if your disks
  3746.   differs  significantly in speed. Check man 8 swapon as well as man 2
  3747.   swapon for more information.
  3748.  
  3749.  
  3750.   16.3.  Swap partition: to use or not to use
  3751.  
  3752.   In many cases you do not need a swap partition, for instance if you
  3753.   have plenty of RAM, say, more than 64 MB, and you are the sole user of
  3754.   the machine. In this case you can experiment running without a swap
  3755.   partition and check the system logs to see if you ran out of virtual
  3756.   memory at any point.
  3757.  
  3758.   Removing swap partitions have two advantages:
  3759.  
  3760.   o  you save disk space (rather obvious really)
  3761.  
  3762.  
  3763.   o  you save seek time as swap partitions otherwise would lie in the
  3764.      middle of your disk space.
  3765.  
  3766.   In the end, having a swap partition is like having a heated toilet:
  3767.   you do not use it very often, but you sure appreciate it when you
  3768.   require it.
  3769.  
  3770.  
  3771.   16.4.  Mount point and /mnt
  3772.  
  3773.   In an earlier version of this document I proposed to put all
  3774.   permanently mounted partitions under /mnt. That, however, is not such
  3775.   a good idea as this itself can be used as a mount point, which leads
  3776.   to all mounted partitions becoming unavailable. Instead I will propose
  3777.   mounting straight from root using a meaningful name like
  3778.   /mnt.descriptive-name.
  3779.  
  3780.   Lately I have become aware that some Linux distributions use mount
  3781.   points at subdirectories under /mnt, such as /mnt/floppy and
  3782.   /mnt/cdrom, which just shows how confused the whole issue is.
  3783.   Hopefully FHS should clarify this.
  3784.  
  3785.  
  3786.   16.5.  SCSI id numbers and names
  3787.  
  3788.   Partitions are labeled in the order they are found, not depending on
  3789.   the SCSI id number. This means that if you add a drive with an id
  3790.   number inserted in the previous order of numbers, or change id number
  3791.   in any other way, the partition names will be messed up. This is
  3792.   important if you use removable media. In order to save yourself from
  3793.   some unpleasant experiences, you are recommended to use low numbers
  3794.   for fixed media and reserve the last number(s) for removable media
  3795.   drives.
  3796.  
  3797.   Many have been bitten by this misfeature and there is a strong call
  3798.   for something to be done about it. Nobody knows how soon this will be
  3799.   fixed so in the meantime it is wise to take this into consideration
  3800.   when you design your system. For instance it may be a good idea to use
  3801.   the lowest SCSI id number for you root disk so that it has the least
  3802.   probability of being renumbered should one drive fail.
  3803.  
  3804.  
  3805.   16.6.  Power and Heating
  3806.  
  3807.   Not many years ago a machine with the equivalent power of a modern PC
  3808.   required 3-phase power and cooling, usually by air conditioning the
  3809.   machine room but some times also by water cooling. Technology has
  3810.   progressed very quickly giving not only high speed but also low power
  3811.   components. Still, there is a definite limit to the technology,
  3812.   something one should keep in mind as the system is expanded with yet
  3813.   another disk drive or PCI card. When the power supply is running at
  3814.   full rated power, keep in mind that all this energy is going
  3815.   somewhere, mostly into heat. Unless this is dissipated using fans you
  3816.   will get a serious heating inside the cabinet followed by a reduced
  3817.   reliability and also life time of the electronics.  Manufacturers
  3818.   state minimum cooling requirements for their drives, usually in terms
  3819.   of cubic feet per minute (CFM). You are well advised to take this
  3820.   serious.
  3821.  
  3822.   Keep air flow passages open, clean out dust and check the temperature
  3823.   of your system running. If it is too hot to touch it is probably
  3824.   running too hot.
  3825.  
  3826.   If possible use sequential spin up for the drives. It is during spin
  3827.   up, when the drive platters accelerate up to normal speed, that a
  3828.   drive consumes maximum power and if all drives start up simultaneously
  3829.   you could go beyond the rated power maximum of your power supply.
  3830.  
  3831.  
  3832.   16.7.  Dejanews
  3833.  
  3834.   This is an Internet system that no doubt most of you are familiar
  3835.   with.  It searches and serves Usenet News articles from 1995 and to
  3836.   the latest postings and also offers a web based reading and posting
  3837.   interface.  There is a lot more, check out Dejanews
  3838.   <http://www.dejanews.com> for more information.
  3839.  
  3840.   What perhaps is less known, is that they use about 20 Linux SMP
  3841.   computers each of which uses the md module to manage between 4 and 24
  3842.   Gig of disk space (over 150 Gig altogether) for this service.  The
  3843.   system is continuously growing but at the time of writing they use
  3844.   mostly dual Pentium Pro 200MHz systems with 256 MB RAM.
  3845.  
  3846.   A production machine normally has 1 disk for the operating system and
  3847.   between 4 and 6 disks managed by the md module where the articles are
  3848.   archived.  The drives are connected to BusLogic Model BT-946C PCI SCSI
  3849.   adapters, usually two to a machine.
  3850.  
  3851.   Just in case: this is not an advertisement, it is stated as an example
  3852.   of how much is required for what is a major Internet service.
  3853.  
  3854.  
  3855.   16.8.  File system structure
  3856.  
  3857.   There are many file system structures in existence, differing with
  3858.   FSSTND (and soon FHS) to varying degree both in terms of philosophy,
  3859.   strategy and implementation. It is not possible to detail all here,
  3860.   instead the interested reader should read the relevant manual page,
  3861.   man hier which is available on many platforms and implementations.
  3862.  
  3863.  
  3864.   16.9.  Track numbering and optimizing schemes
  3865.  
  3866.   In the old days the file system used to take advantage of knowing the
  3867.   physical drive parameters in order to optimize transfers, for instance
  3868.   by endeavouring to keep a file within a single track if possible which
  3869.   saves track-to-track seek time. These days with logical drive
  3870.   parameters, drive cache and schemes to map out bad sectors, such
  3871.   optimizations become meaningless and might even cost more than it
  3872.   would gain. As most Linux installations use modern file systems these
  3873.   schemes are not used, however, some other operating systems have
  3874.   retained such schemes.
  3875.  
  3876.  
  3877.  
  3878.  
  3879.   17.  Appendix A: Partitioning layout table: mounting and linking
  3880.  
  3881.   The following table is designed to make layout a simpler paper and
  3882.   pencil exercise. It is probably best to print it out (using NON
  3883.   PROPORTIONAL fonts) and adjust the numbers until you are happy with
  3884.   them.
  3885.  
  3886.   Mount point is what directory you wish to mount a partition on or the
  3887.   actual device. This is also a good place to note how you plan to use
  3888.   symbolic links.
  3889.  
  3890.   The size given corresponds to a fairly big Debian 1.2.6 installation.
  3891.   Other examples are coming later.
  3892.  
  3893.   Mainly you use this table to select what structure and drives you will
  3894.   use, the partition numbers and letters will come from the next two
  3895.   tables.
  3896.  
  3897.  
  3898.  
  3899.        Directory       Mount point     speed   seek    transfer        size    SIZE
  3900.  
  3901.  
  3902.        swap            __________      ooooo   ooooo   ooooo           32      ____
  3903.  
  3904.        /               __________      o       o       o               20      ____
  3905.  
  3906.        /tmp            __________      oooo    oooo    oooo                    ____
  3907.  
  3908.        /var            __________      oo      oo      oo              25      ____
  3909.        /var/tmp        __________      oooo    oooo    oooo                    ____
  3910.        /var/spool      __________                                              ____
  3911.        /var/spool/mail __________      o       o       o                       ____
  3912.        /var/spool/news __________      ooo     ooo     oo                      ____
  3913.        /var/spool/____ __________      ____    ____    ____                    ____
  3914.  
  3915.        /home           __________      oo      oo      oo                      ____
  3916.  
  3917.        /usr            __________                                      500     ____
  3918.        /usr/bin        __________      o       oo      o               250     ____
  3919.        /usr/lib        __________      oo      oo      ooo             200     ____
  3920.        /usr/local      __________                                              ____
  3921.        /usr/local/bin  __________      o       oo      o                       ____
  3922.        /usr/local/lib  __________      oo      oo      ooo                     ____
  3923.        /usr/local/____ __________                                              ____
  3924.        /usr/src        __________      o       oo      o               50      ____
  3925.  
  3926.        DOS             __________      o       o       o                       ____
  3927.        Win             __________      oo      oo      oo                      ____
  3928.        NT              __________      ooo     ooo     ooo                     ____
  3929.  
  3930.        /mnt._________  __________      ____    ____    ____                    ____
  3931.        /mnt._________  __________      ____    ____    ____                    ____
  3932.        /mnt._________  __________      ____    ____    ____                    ____
  3933.        /_____________  __________      ____    ____    ____                    ____
  3934.        /_____________  __________      ____    ____    ____                    ____
  3935.        /_____________  __________      ____    ____    ____                    ____
  3936.  
  3937.  
  3938.  
  3939.        Total capacity:
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.   18.  Appendix B: Partitioning layout table: numbering and sizing
  3947.  
  3948.   This table follows the same logical structure as the table above where
  3949.   you decided what disk to use. Here you select the physical tracking,
  3950.   keeping in mind the effect of track positioning mentioned earlier in
  3951.   ``Physical Track Positioning''.
  3952.  
  3953.   The final partition number will come out of the table after this.
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.     Drive           sda     sdb     sdc     hda     hdb     hdc     ___
  3962.  
  3963.   SCSI ID         |  __   |  __   |  __   |
  3964.  
  3965.   Directory
  3966.   swap            |       |       |       |       |       |       |
  3967.  
  3968.   /               |       |       |       |       |       |       |
  3969.  
  3970.   /tmp            |       |       |       |       |       |       |
  3971.  
  3972.   /var            :       :       :       :       :       :       :
  3973.   /var/tmp        |       |       |       |       |       |       |
  3974.   /var/spool      :       :       :       :       :       :       :
  3975.   /var/spool/mail |       |       |       |       |       |       |
  3976.   /var/spool/news :       :       :       :       :       :       :
  3977.   /var/spool/____ |       |       |       |       |       |       |
  3978.  
  3979.   /home           |       |       |       |       |       |       |
  3980.  
  3981.   /usr            |       |       |       |       |       |       |
  3982.   /usr/bin        :       :       :       :       :       :       :
  3983.   /usr/lib        |       |       |       |       |       |       |
  3984.   /usr/local      :       :       :       :       :       :       :
  3985.   /usr/local/bin  |       |       |       |       |       |       |
  3986.   /usr/local/lib  :       :       :       :       :       :       :
  3987.   /usr/local/____ |       |       |       |       |       |       |
  3988.   /usr/src        :       :       :       :
  3989.  
  3990.   DOS             |       |       |       |       |       |       |
  3991.   Win             :       :       :       :       :       :       :
  3992.   NT              |       |       |       |       |       |       |
  3993.  
  3994.   /mnt.___/_____  |       |       |       |       |       |       |
  3995.   /mnt.___/_____  :       :       :       :       :       :       :
  3996.   /mnt.___/_____  |       |       |       |       |       |       |
  3997.   /_____________  :       :       :       :       :       :       :
  3998.   /_____________  |       |       |       |       |       |       |
  3999.   /_____________  :       :       :       :       :       :       :
  4000.  
  4001.  
  4002.   Total capacity:
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.   19.  Appendix C: Partitioning layout table: partition placement
  4010.  
  4011.   This is just to sort the partition numbers in ascending order ready to
  4012.   input to fdisk or cfdisk. Here you take physical track positioning
  4013.   into account when finalizing your design. Unless you get specific
  4014.   information otherwise, you can assume track 0 is the outermost track.
  4015.  
  4016.   These numbers and letters are then used to update the previous tables,
  4017.   all of which you will find very useful in later maintenance.
  4018.  
  4019.   In case of disk crash you might find it handy to know what SCSI id
  4020.   belongs to which drive, consider keeping a paper copy of this.
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.           Drive :   sda     sdb     sdc     hda     hdb     hdc     ___
  4028.  
  4029.   Total capacity: |  ___  |  ___  |  ___  |  ___  |  ___  |  ___  |  ___
  4030.   SCSI ID         |  __   |  __   |  __   |
  4031.  
  4032.   Partition
  4033.  
  4034.   1               |       |       |       |       |       |       |
  4035.   2               :       :       :       :       :       :       :
  4036.   3               |       |       |       |       |       |       |
  4037.   4               :       :       :       :       :       :       :
  4038.   5               |       |       |       |       |       |       |
  4039.   6               :       :       :       :       :       :       :
  4040.   7               |       |       |       |       |       |       |
  4041.   8               :       :       :       :       :       :       :
  4042.   9               |       |       |       |       |       |       |
  4043.   10              :       :       :       :       :       :       :
  4044.   11              |       |       |       |       |       |       |
  4045.   12              :       :       :       :       :       :       :
  4046.   13              |       |       |       |       |       |       |
  4047.   14              :       :       :       :       :       :       :
  4048.   15              |       |       |       |       |       |       |
  4049.   16              :       :       :       :       :       :       :
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.   20.  Appendix D: Example: Multipurpose server
  4057.  
  4058.   The following table is from the setup of a medium sized multipurpose
  4059.   server where I work. Aside from being a general Linux machine it will
  4060.   also be a network related server (DNS, mail, FTP, news, printers etc.)
  4061.   X server for various CAD programs, CD ROM burner and many other
  4062.   things.  The files reside on 3 SCSI drives with a capacity of 600,
  4063.   1000 and 1300 MB.
  4064.  
  4065.   Some further speed could possibly be gained by splitting /usr/local
  4066.   from the rest of the /usr system but we deemed the further added
  4067.   complexity would not be worth it. With another couple of drives this
  4068.   could be more worthwhile. In this setup drive sda is old and slow and
  4069.   could just a well be replaced by an IDE drive. The other two drives
  4070.   are both rather fast. Basically we split most of the load between
  4071.   these two. To reduce dangers of imbalance in partition sizing we have
  4072.   decided to keep /usr/bin and /usr/local/bin in one drive and /usr/lib
  4073.   and /usr/local/lib on another separate drive which also affords us
  4074.   some drive parallelizing.
  4075.  
  4076.   Even more could be gained by using RAID but we felt that as a server
  4077.   we needed more reliability than was then afforded by the md patch and
  4078.   a dedicated RAID controller was out of our reach.
  4079.  
  4080.  
  4081.   21.  Appendix E: Example: mounting and linking
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.   Directory       Mount point     speed   seek    transfer        size    SIZE
  4094.  
  4095.  
  4096.   swap            sdb2, sdc2      ooooo   ooooo   ooooo           32      2x64
  4097.  
  4098.   /               sda2            o       o       o               20       100
  4099.  
  4100.   /tmp            sdb3            oooo    oooo    oooo                     300
  4101.  
  4102.   /var            __________      oo      oo      oo                      ____
  4103.   /var/tmp        sdc3            oooo    oooo    oooo                     300
  4104.   /var/spool      sdb1                                                     436
  4105.   /var/spool/mail __________      o       o       o                       ____
  4106.   /var/spool/news __________      ooo     ooo     oo                      ____
  4107.   /var/spool/____ __________      ____    ____    ____                    ____
  4108.  
  4109.   /home           sda3            oo      oo      oo                       400
  4110.  
  4111.   /usr            sdb4                                            230      200
  4112.   /usr/bin        __________      o       oo      o               30      ____
  4113.   /usr/lib        -> libdisk      oo      oo      ooo             70      ____
  4114.   /usr/local      __________                                              ____
  4115.   /usr/local/bin  __________      o       oo      o                       ____
  4116.   /usr/local/lib  -> libdisk      oo      oo      ooo                     ____
  4117.   /usr/local/____ __________                                              ____
  4118.   /usr/src        ->/home/usr.src o       oo      o               10      ____
  4119.  
  4120.   DOS             sda1            o       o       o                        100
  4121.   Win             __________      oo      oo      oo                      ____
  4122.   NT              __________      ooo     ooo     ooo                     ____
  4123.  
  4124.   /mnt.libdisk    sdc4            oo      oo      ooo                      226
  4125.   /mnt.cd         sdc1            o       o       oo                       710
  4126.  
  4127.  
  4128.   Total capacity: 2900 MB
  4129.  
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.   22.  Appendix F: Example: numbering and sizing
  4136.  
  4137.   Here we do the adjustment of sizes and positioning.
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.   Directory         sda     sdb     sdc
  4160.  
  4161.  
  4162.   swap            |       |   64  |   64  |
  4163.  
  4164.   /               |  100  |       |       |
  4165.  
  4166.   /tmp            |       |  300  |       |
  4167.  
  4168.   /var            :       :       :       :
  4169.   /var/tmp        |       |       |  300  |
  4170.   /var/spool      :       :  436  :       :
  4171.   /var/spool/mail |       |       |       |
  4172.   /var/spool/news :       :       :       :
  4173.   /var/spool/____ |       |       |       |
  4174.  
  4175.   /home           |  400  |       |       |
  4176.  
  4177.   /usr            |       |  200  |       |
  4178.   /usr/bin        :       :       :       :
  4179.   /usr/lib        |       |       |       |
  4180.   /usr/local      :       :       :       :
  4181.   /usr/local/bin  |       |       |       |
  4182.   /usr/local/lib  :       :       :       :
  4183.   /usr/local/____ |       |       |       |
  4184.   /usr/src        :       :       :       :
  4185.  
  4186.   DOS             |  100  |       |       |
  4187.   Win             :       :       :       :
  4188.   NT              |       |       |       |
  4189.  
  4190.   /mnt.libdisk    |       |       |  226  |
  4191.   /mnt.cd         :       :       :  710  :
  4192.   /mnt.___/_____  |       |       |       |
  4193.  
  4194.  
  4195.   Total capacity: |  600  | 1000  | 1300  |
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.   23.  Appendix G: Example: partition placement
  4203.  
  4204.   This is just to sort the partition numbers in ascending order ready to
  4205.   input to fdisk or cfdisk. Remember to optimize for physical track
  4206.   positioning (not done here).
  4207.  
  4208.  
  4209.  
  4210.                Drive :   sda     sdb     sdc
  4211.  
  4212.        Total capacity: |   600 |  1000 |  1300 |
  4213.  
  4214.        Partition
  4215.  
  4216.        1               |   100 |   436 |   710 |
  4217.        2               :   100 :    64 :    64 :
  4218.        3               |   400 |   300 |   300 |
  4219.        4               :       :   200 :   226 :
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.   24.  Appendix H: Example II
  4226.  
  4227.  
  4228.   The following is an example of a server setup in an academic setting,
  4229.   and is contributed by nakano (at) apm.seikei.ac.jp. I have only done
  4230.   minor editing to this section.
  4231.  
  4232.   /var/spool/delegate is a directory for storing logs and cache files of
  4233.   an WWW proxy server program, "delegated". Since I don't notice it
  4234.   widely, there are 1000--1500 requests/day currently, and average disk
  4235.   usage is 15--30% with expiration of caches each day.
  4236.  
  4237.   /mnt.archive is used for data files which are big and not frequently
  4238.   referenced such a s experimental data (especially graphic ones),
  4239.   various source archives, and Win95 backups (growing very fast...).
  4240.  
  4241.   /mnt.root is backup root file system containing rescue utilities. A
  4242.   boot floppy is also prepared to boot with this partition.
  4243.  
  4244.  
  4245.  
  4246.  
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.   =================================================
  4292.   Directory               sda      sdb     hda
  4293.  
  4294.   swap                    |    64 |    64 |       |
  4295.   /                       |       |       |    20 |
  4296.   /tmp                    |       |       |   180 |
  4297.  
  4298.   /var                    :   300 :       :       :
  4299.   /var/tmp                |       |   300 |       |
  4300.   /var/spool/delegate     |   300 |       |       |
  4301.  
  4302.   /home                   |       |       |   850 |
  4303.   /usr                    |   360 |       |       |
  4304.   /usr/lib                -> /mnt.lib/usr.lib
  4305.   /usr/local/lib          -> /mnt.lib/usr.local.lib
  4306.  
  4307.   /mnt.lib                |       |   350 |       |
  4308.   /mnt.archive            :       :  1300 :       :
  4309.   /mnt.root               |       |    20 |       |
  4310.  
  4311.   Total capacity:            1024    2034    1050
  4312.  
  4313.  
  4314.   =================================================
  4315.           Drive :           sda     sdb     hda
  4316.   Total capacity:         |  1024 |  2034 |  1050 |
  4317.  
  4318.   Partition
  4319.   1                       |   300 |    20 |    20 |
  4320.   2                       :    64 :  1300 :   180 :
  4321.   3                       |   300 |    64 |   850 |
  4322.   4                       :   360 :   ext :       :
  4323.   5                       |       |   300 |       |
  4324.   6                       :       :   350 :       :
  4325.  
  4326.  
  4327.   Filesystem         1024-blocks  Used Available Capacity Mounted on
  4328.   /dev/hda1              19485   10534     7945     57%   /
  4329.   /dev/hda2             178598      13   169362      0%   /tmp
  4330.   /dev/hda3             826640  440814   343138     56%   /home
  4331.   /dev/sda1             306088   33580   256700     12%   /var
  4332.   /dev/sda3             297925   47730   234807     17%   /var/spool/delegate
  4333.   /dev/sda4             363272  170872   173640     50%   /usr
  4334.   /dev/sdb5             297598       2   282228      0%   /var/tmp
  4335.   /dev/sdb2            1339248  302564   967520     24%   /mnt.archive
  4336.   /dev/sdb6             323716   78792   228208     26%   /mnt.lib
  4337.  
  4338.  
  4339.  
  4340.  
  4341.   Apparently /tmp and /var/tmp is too big. These directories shall be
  4342.   packed together into one partition when disk space shortage comes.
  4343.  
  4344.   /mnt.lib is also seemed to be, but I plan to install newer TeX and
  4345.   ghostscript archives, so /usr/local/lib may grow about 100 MB or so
  4346.   (since we must use Japanese fonts!).
  4347.  
  4348.   Whole system is backed up by Seagate Tapestore 8000 (Travan TR-4,
  4349.   4G/8G).
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.   25.  Appendix I: Example III: SPARC Solaris
  4358.  
  4359.  
  4360.   The following section is the basic design used at work for a number of
  4361.   Sun SPARC servers running Solaris 2.5.1 in an industrial development
  4362.   environment. It serves a number of database and cad applications in
  4363.   addition to the normal services such as mail.
  4364.  
  4365.   Simplicity is emphasized here so /usr/lib has not been split off from
  4366.   /usr.
  4367.  
  4368.   This is the basic layout, planned for about 100 users.
  4369.  
  4370.  
  4371.  
  4372.           Drive:        SCSI 0                      SCSI 1
  4373.  
  4374.           Partition     Size (MB)   Mount point    Size (MB)   Mount point
  4375.  
  4376.             0           160         swap           160         swap
  4377.             1           100         /tmp           100         /var/tmp
  4378.             2           400         /usr
  4379.             3           100         /
  4380.             4            50         /var
  4381.             5
  4382.             6           remainder   /local0        remainder   /local1
  4383.  
  4384.  
  4385.  
  4386.  
  4387.   Due to specific requirements at this place it is at times necessary to
  4388.   have large partitions available on a short notice. Therefore drive 0
  4389.   is given as many tasks as feasible, leaving a large /local1 partition.
  4390.  
  4391.   This setup has been in use for some time now and found satisfactorily.
  4392.  
  4393.   For a more general and balanced system it would be better to swap /tmp
  4394.   and /var/tmp and then move /var to drive 1.
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.