SunSolve Internal

Infodoc ID   Synopsis   Date
14622   Advantages of Splitting a Drive into Multiple File Systems   20 Oct 1999

Description Top

Rather than using an entire disk drive for one file system, which may
lead to inefficiencies and other problems, you can
split a single drive into sections. The sections are called slices, as
each is a slice of the disk's capacity.  Once the partition has been
allocated, it becomes the a logical disk drive.

A disk can be split into eight subdisks. The splitting of the disk is
often called partitioning or labeling of the disk drive. Below is an
example:


Current partition table (original):
Total disk cylinders available: 2036 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0 - 1872      921.87MB    (1873/0/0) 1887984
  1 unassigned    wm       0               0         (0/0/0)          0
  2     backup    wm       0 - 2035     1002.09MB    (2036/0/0) 2052288
  3 unassigned    wm    1873 - 2035       80.23MB    (163/0/0)   164304
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6 unassigned    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0               0         (0/0/0)          0

partition> 



Here are some of the reasons for multiple filesystems on one hard
drive.

1. Damage Control:   If the system were to crash due to software error,
		     hardware failure, or power problems, some of the
		     disk blocks might still be in the file system
		     cache and not have been written to disk yet. This
		     can cause damage to the filesystem structure.
		     While the methods used try to reduce this damage,
		     and the FSCK utility can repair most of the
		     damage, spreading the files across multiple
		     filesystems minimizes the possibility of damage,
		     especially to those files that are needed during
		     boot-up.  When the files are split up across
		     the disk slices, critical files end up on slices
		     that rarely change or are mounted read-only and
		     never change. The chances of them being damaged
		     and preventing you from recovering the remainder
		     of the system are greatly reduced.

2. Access Control:   Only complete slices can be marked as read-only or
                     read-write.
		     If you desire to mount the shared Operating System
		     sections as read-only to prevent changes, they
		     have to be on their own slice.

3. Space Management: Files are used from a reserve of free space on a
                     per-file system basis. 
		     If, for example, a user has allocated a large
		     amount of space, depleting the free space, and the
		     entire system disk were a single filesystem, there
		     would be no free space left for critical system
		     files. The entire system would freeze when it ran
		     out of space.

		     Using separate filesystems, especially for user
		     files, allows only that a single user, or group of
		     users, to be inconvenienced when filesystem
		     becomes full. The system will continue to operate,
		     allowing the System Administrator to handle the
		     problem. The exception to the above scenario is
		     the root filesystem.

4. Performance:      The larger the filesystem, the larger the tables
                     that must be managed. 
		     As the disk fragments and space become
		     scarce, the further apart the fragments of a file
		     might be placed on the disk. Using multiple
		     (smaller) partitions reduces the absolute distance
		     and keeps the sizes of the tables manageable.
		     Although the UFS file filesystem does not suffer
		     from table size an fragmentation problems as much
		     as System V file systems, this is still a
		     concern.

5. Backups:          Many of the back-up utilities, such as "ufsdump"
		     work on a complete filesystem basis.  If a
		     filesystem is large, it could take longer than you
		     want to allocate to back-up. Most importantly,
		     multiple smaller backups are easier to handle and
		     recover from.









Below is a listing of slices, some that are required, root and swap,
and the recommended additional slices such as usr, var, opt, home and
tmp.



1.  The root slice: The root slice is mounted at the top of the
		    filesystem hierarchy. It is mounted automatically
		    as the system boots, and cannot be unmounted. All
		    other file systems are mounted below the root.

		    The root filesystem needs to be large enough to
		    hold the following:

		    * The boot information and the bootable kernel
		      (kernel/genunix), and a backup
		      of the kernel just in case the main one gets damaged.

		    * Any local system configuration files, which
		      typically reside in the /etc directory.

		    * Any stand-alone programs, such as diagnostics,
		      that may be run instead
		      of the OS.

		    The root partition typically runs on between 15 and
		    30mb. It is usually placed on the first slice of
		    the disk, or more commonly know as slice 0 or a.

2.  The swap slice: The default rule is that there is twice as much swap
		    space as there is RAM installed on the system. For
		    example, if you have 16mb of ram, the swap space
		    would need to be 32mb.  Although this is just a
		    preliminary template as to how much swap to use,
		    their are other factors to consider, an example
		    would be if a users system is running large
		    applications that use large amounts of data, such
		    as a CAD application. You can monitor the
		    amount of swap space used via the pstat or swap
		    commands. If you did not allow enough swap
		    space during the initial install you can add
		    additional swap with either the swapon or swap
		    commands.

3.  The usr slice:  The usr slice holds the remainder of the operating
		    system utilities. It needs to be large enough to
		    hold all the packages you chose to install when
		    installing the OS. If you are going to install
		    local applications or third-party applications in
		    this slice, it needs to be large enough to hold
		    them. It is generally better if the usr slice
		    contains the operating system and only symbolic
		    links to the applications. The filesystem is often
		    mounted read-only to prevent changes.

4. The var slice:   The var slice holds the spool directories used to
		    queue printer files and mail, as well as log files
		    that my be unique to the system. It also holds the
		    /var/tmp directory, which is used for larger
		    temporary files. It is the read-write counterpart
		    to the usr slice. Every system, even a diskless
		    client, needs it's own var filesystem. It is not a
		    filesystem that can be shared with any other
		    system(s).

5. The opt slice:   In the newer UNIX systems based on System V release
		    4 (Solaris 2.x) many sections are now optional and
		    no longer needed to be loaded on the /usr
		    filesystem. They are now installed onto the /opt
		    filesystem. Additional add on packages are also
		    installed in this filesystem.

6. The home slice:  The home directory is where the user's login
		    directories are placed. Making home its own slice
		    prevents users from hurting anything else if they
		    run this filesystem out of space. A good starting
		    point for the size of this slice is 1mb per
		    application user plus 5mb per power user and 10mb
		    per developer you intend to support.  These are
		    rough estimates and are to be only used as a
		    guideline, you configuration may need more or less
		    space per user. Usually this is /export/home. Don't 
                    put things into /home, as this is a reserved mount
                    point for automounted NFS filesystems. It's fine to
		    use when automounter is turned off, but it is on by
		    default.			

7. The tmp slice:   Large temporary files are placed in the /var/tmp
		    but sufficient temporary files are placed in /tmp.
		    The files in the /tmp directory are very
		    short-lived and are cleared out during a reboot of
		    the system. If users run mostly application based
		    programs 5 to 10mb should be sufficient for this
		    slice. If developers are the primary users of the
		    system 10 to 20mb may be needed. Once again these
		    numbers or only a guideline, your needs may be
		    different.
Product Area Utilities
Product other
OS any
Hardware any

Top

SunWeb Home SunWeb Search SunSolve Home Simple Search

Sun Proprietary/Confidential: Internal Use Only
Feedback to SunSolve Team