Monday, July 11, 2011

The Filesystem Table (fstab) File

Many of the configuration options for your servers filesystem are contained in a single text file, /etc/fstab

fstab, which is an abbreviation of "filesystem table", provides instruction to the operating system as to where devices should me mounted.

Each line of the fstab file contains five fields which, together, specify the configuration of a single device. Lets have a look;
  1. Specifies the device
  2. The mount point
  3. What filesystem Linux should expect
  4. Mounting options
    • auto
      • mounted automatically
    • noauto
      • not mounted automatically
    • owner
      • may only be mounted by owner
    • kudzu
      • will be checked for changes by Redhat kudzu system
    • rw
      • The filesystem will provide read and write access
    • ro
      • The filesystem will provide read only access
    • There are many more options but these are the one that we are interested in. In Fedora Default is equivalent to auto, owner, kudzu, rw.
  5. The fifth colum is used by the dump backup utility to determine if this filesystem should be included in its backups the 0 value tells dump to ignore this filesystem for backup purposes
  6. The final column indicates whether the filesystem should be checked with the fsck (filesystem check) utility ex3 filesystems very rarely benifit from such a check if you want to perform such a check you should number the filesystems in the order which you´d like them checked, 1 for first, 2 for second, and so on.
With a correctly formatted fstab file, using the mount command becomes much easier;

$ su
# mount /media/flobby

Here we've specified only the mount point mount is able to look in fstab to identify the device to which this mount point relates

No comments:

Post a Comment