Classnotes | UNIX02 | RecentChanges | Preferences /etc/fstab (think filesystem table) contains descriptive information about the various file systems on your computer. Many programs (such as mount) use refer to this table when they need information about what partition is supposed to be mounted where, what filesystem is on it, etc., so it is imperative that this file is properly maintained. In addition to containing information about the partitions (and mount points) on your hard drive, it also contains information used when mounting other devices, such as a CD-ROM or floppy disk.
As you can see, this file has six fields (columns). The first field defines the device or partition to be mounted (/dev/cdrom = first CD-ROM device, /dev/hda1 = 1st partition on primary master IDE device, etc.) The second field defines the mount point (where, in your filesystem layout, the contents of the device or partition will be located). The third field lists the filesystem type. The fourth field describes the mount options (for details, see the mount man page). Finally, the fifth and sixth fields contain information used by certain filesystem utilities.
/etc/fstab is referenced by the mount command when performing any operations, such as mounting the filesystems at bootup. mount can also be used to mount and unmount (using umount) filesystems while the computer is being used. When a mount command is issued, it first refers to /etc/fstab to see if operation is defined - if so, it uses the information there. If the operation is not already defined in /etc/fstab, then the user must specify the necessary information from the command line, such as the device to be mounted, where to mount it, etc.
Although users can be allowed to mount devices, they can only do so if it's specified in /etc/fstab. In order to have mount use the information in /etc/fstab, issue the mount command with only the physical device as a parameter. Adding any additional parameters to the command, such as specifying the mount point, the filesystem type, etc., will override the /etc/fstab entry will therefore be denied.