|
The following article is an explanation of the /etc/fstab file and its function on the RedHat system.
Fstab is a configuration file that contains information on all the partitions and storage devices on your server. Many problems mounting partitions on boot or accessing partitions or CD's are due to a misconfiguration in the /etc/fstab file.
To view the fstab file, simply cat the file out.
#cat /etc/fstab
/dev/hda2 / ext2 defaults 1 1 /dev/hdb1 /home ext2 defaults 1 2 /dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0 /dev/fd0 /media/floppy auto rw,noauto,user,sync 0 0 proc /proc proc defaults 0 0 /dev/hda1 swap swap pri=42 0 0
As you can see, each line contains information on one device or partition. The first colum contains the device name (or lable, though not in this example). The second is the mount point, the third is the filesystem type, the fourth is the mount options, the fifth is dump options, the sixth is filesystem check options.
The first and second colums are fairly straightforward. They list what device is being mounted, and where it is being mounted to. The mount point described in /etc/fstab is the default mount point that the device will be mounted to if no other mount point is listed when mounting a partition or device manually. The mount points can be changed in /etc/fstab, so long as the mount point is an existing directory.
The third colum in /etc/fstab defines the filesystem type of the partition or device. The most common filesystems found here are:
ext2 and ext3 - Most often used for linux partitions. Ext3 differs from Ext2 in that it is a journaled filesystem. This means that if the server is improperly shut down, the chance of data loss is lower and the recovery time is faster.
swap - Only used for swap partitions. ntfs and vfat/fat32 - Windows filesystems.
auto - Filesystem type is detected automatically. Most often used for removeable media devices such as floppy drives or Cd roms, as the filesystem may change depending on the media used.
The fourth colum defines the mount options. Some of the most common mount options are:
auto/noauto - auto will mount the device automatically at boot, similar to issuing a 'mount -a' command. noauto forces the device to be mounted manually.
user/nouser - user lets normal users mount decvices. nouser allows only the root user to mount devices.
exec/noexec - exec allows the execution of binaries on the device or partition. noexec disallows this.
ro/rw - ro mounts the device as read only. rw mounts the device as read/write.
sync and async - These options define how the input and output of the device is handled. synch sets the device I/O to be written synchronously (data is written at the time of the command). asynch sets the device to asynchronously write data. (data may not be physically written until the device is unmounted).
defaults - uses the default options rw, suid, dev, exec, auto, nouser, and async
|
Add to Favourites
Print this Article
|