Learning the fstab structure

fstab.gif
Column 1
This column lists partiion names. All partitions on the system are not necessarily listed, and they do not have to be-especially if they are formatted for another operating system. However, that is up to the administrator to decide. If you want to check to see the available partitions, run the command fdisk -I [hard drive] as root. On single hard drive systems, fdisk -I /dev/hda will list all available partitions.

To help programs run more efficiently, partitions should be listed in fstab starting with the first partition of the first hard drive on your system. Other partitions on the first hard drive should be listed in order. The process then repeats itself on any other hard drives on the system.

Different than Windows, where partitions are labeled with letters, Linux gives partitions a three-part name. Partitions (as well as devices and ports) are defined in the /dev directory, so each partition name starts with /dev. Note: the first (and often only) partition on a system is usually /dev/hda1. A network partition is given in the form, [hostname]: directory name.

Column 2
This column gives the mount point or directory that the partition is mounted on. A mount point is often a directory directly below the root partitions (/) hierarchy. /backup, /dvd, /mp3, etc. are all examples of mount points for partitions. /home, /usr, /var and /proc are all directories that are often used as mount points. These are directories that frequently require extra space because of the large amount of data being placed in them. Also, if all of these directories are on a different partition from the root filesystem, then third party programs may not need to be reinstalled if the root partition (/) should crash-or so the reasoning goes. As always, there are exceptions to this rule!

Other partitions are usually mounted as a sub-directory of /mnt. Partitions on a floppy or a CD are generally mounted on directories of those names. However, you could delete the /mnt directory and create directories for devices on your root partition. For example, /dvd or /cd-r. This will save time and help avoid typing in long mount commands. How and where you put your mount points is up to you.

If you notice the /proc in your fstab, it's wise to leave it alone. It is a filesystem used to gather information for commands such as pr, which reports on active processes. Once again, it is wise to leave it alone.

Column 3
This column lists how the partition is formatted. Most modern Linux distributions ship standard with support for the following listings already enabled:

Setting/ Format

ext2 or ext3: The standard Linux file system.
sworswap: The standard Linux swap system.
msdos: FAT16, the format used by DOS and the first version of Windows 95, characterized by a limit of eight characters and a three-character extension for all names.
vfat: FAT32, the format used by Windows 98 and the second version of Windows 95, with support for file names longer than FAT16's eight-character limit.
iso9660: The format used by most CDs. Used only to mount a CD drive.
nfs: The Network file system.
auto: The system tries to detect the format type. For auto to work, the kernel must be compiled to support the format for the filesystem to be mounted.
ignore: The system does not try to mount. This option is useful if you want to list all partitions on you system in fstab for later reference, but don't want to mount a partition right then.

Note: Check how to recompile your kernel if you want support for another filesystem.