Fstab is a static file with descriptive information that allows for easy mounting/un-mounting of filesystems and devices. No program writes to the file so it is up to the system administrator to keep it up to date. With configuration in fstab, filesystems and devices can be mounted with a command that gives the device name or the mount point.
Mounting Paritions/Devices not in Fstab
Example fstab file
Example of an fstab file for a system with SCSI drives running Debian. The CD-ROM commonly has a symlink that links /dev/hdb to /dev/cdrom if the system has only one hard drive. It specifies the root system, swap, proc, floppy and the the CD-ROM.
# /etc/fstab: static file system information.
#
#
/dev/sda2
/
ext2
errors=remount-ro
0
1
/dev/sdb2
none
swap
sw
0
0
proc
/proc
proc
defaults
0
0
/dev/fd0
/floppy
auto
user,noauto
0
0
/dev/cdrom
/cdrom
iso9660
ro,user,noauto
0
0
Col:
1
2
3
4
5
6
For descriptions of specific columns, click on a column number.
Column 1 - block special device or remote file system
/dev/hd* denotes IDE devices including - hard drives, CD-ROMS and ZIP drives. the * can be a,b,...
- hda - master drive - primary controller
- hdb - slave or CD-ROM - primary controller
- hdc - master secondary controller
- hdd - slave secondary controller
/dev/sd* denotes SCSI drives -- the * can again be a,b,... first device seen by the computer is a, second device is b.
Column 2 - mount point of file system
Column 3 - type of filesystem
Common filesystem types:
- auto - Can only be used if the option is built into the Kernel
- iso9660 - CD-ROM
- proc - A vertiual filesystem that interfaces with the kernal to display kernal information in a readable fashion. It is a view of the state and configuration of your system. The files contain information representing every piece of harware, chipset, RAM and every process running.
To view the files:
use the commands cat, more or less; however do not cat /proc/kcore - file of the kernel memory which will display computer
- ext2 - If the filesystem was not cleanly unmounted, fsck will check all of the 'meta-data' to make sure of the filesystem consistency. Process takes time and contributes to the downtime of the computer. A better Option for filesystems is the use of Journaling.
- Journaling filesystems - Instead of having to check the whole disk after an unclean unmount of the filesystem, it has kept a log of changes in an on disk file. With this file only the recent changes have to be checked.
- ReiserFS
- ext3
- XFS
- JFS
- GFS
Column 4 - mount options of filesystem
A list of options seperated by commas
Common options:
- noauto
- user - allows common users to mount the system/device. The user who mounted the device is the only one able to umount the system/device.
- users - allows users to mount and umount any of the devices.
- owner
- ext2 file system error handling options
- ignore error, mark file system erroneous and continue
- remount as read only
- panic and halt the system
Column 5 - used with the dump command for which filesystem to be dumped
- 0 - filesystem does not need to be dumped.
Column 6 - order of checks on filesystems at reboot
- 0 - file system does not need to be checked.
- 1 - reserved for root filesystem
- 2 - all other drives to be checked sequentially.
Mounting partitions/devices not in fstab
Mounting partitions is useful when the disk has been partitioned with multiple operating systems or the computer has multiple disk drives.
General command:
mount
- Partition/device to be mounted hard drive partition - /dev/hda or /dev/sda sda for SCSI drives.
- Where to mount the device. Can be mounted to any directory. A standard option is /mnt
umount
mount
- Displays a list of all the devices currently mounted from the /etc/mtab file.
man fstab
- Explains configuration of the file fstab.
Explanation of drives and devices -
http://www.linuxselfhelp.com/gnome/unix-primer/devices.html
Back to top