/etc/fstab

/etc/fstab is a configuration file that is used to tell Linux what file systems to mount on boot and where.

= Format = The format of every line is [Device] [Mount Point] [Filesystem] [Options] [dump] [fsck order] the character # allows to write comments into the file. A typical /etc/fstab file can look like this: /dev/hda2		/              ext2		defaults	1  1 /dev/cdrom		/mnt/cdrom	iso9660	       noauto,ro,user  0  0 /dev/hda1		/mnt/dos/c	msdos		defaults	0 0 /dev/fd0		/mnt/floppy	ext2		noauto,user	0 0 /dev/hdb1		/mnt/hdb1      auto	        defaults	0  0 /dev/hda3		none		swap		sw mynfsserver:/vol/vol1	/mnt/filer	nfs		defaults	0 0 //mysambaserver/share	/mnt/sambashare	smbfs		rw,credentials=/home/joe/winbox-credentials.txt 0  0

Device
This is the physical location of the file system, e.g
 * /dev/hda - The master drive connected to the primary IDE cable.
 * /dev/hda2 - The second partition on master drive on primary IDE.
 * /dev/hdb - second drive on primary IDE cable.
 * /dev/fd0 - First floppy drive

It can also be a file system volume label or UUID, using this has the advantage that adding/removing disks won't effect what gets mounted. The format to use instead of the device name in the fstab file is:

LABEL= (Where is some name, e.g. Boot) UUID= (Where is some number like 3e6be9de&#8208;8139&#8208;11d1&#8208;9106&#8208;a43f08d823a6. You can find out the uuid of your devices using hwinfo --block.)

How the label and the UUID are set depends on the file system type used. It can normally be set when creating/formatting the file system and the file system type usually has some tool to change it later on (e.g. e2tunefs, xfs_admin, reiserfstune etc.)

Mount Point
The mount point is what folder the filesystem is to be available under from system root, e.g.
 * /media/floppy
 * /media/cdrom
 * /mnt (temporary mount point)

Note: Make sure folder exists

Filesystem
This specifies what filesystem the device uses. Typically you will be mounting iso9660 for CDs and ext2/ext3/ReiserFS for hard drives/floppies. It can also be NFS which means the mount operation can only start after the network is up. If it is not a network drive and you just want it to be mounted (no matter which filesystem), use auto.

Options
This field describes how kernel should handle filesystem, i.e. will it be writable by the user.


 * sync/async - All I/O to the file system should be done (a)synchronously.
 * auto - The filesystem can be mounted automatically (at bootup, or when mount is passed the -a option). This is really unnecessary as this is the default action of mount -a anyway.
 * noauto - The filesystem will NOT be automatically mounted at startup, or when mount passed -a. You must explicitly mount the filesystem.
 * dev/nodev - Interpret/Do not interpret character or block special devices on the file system.
 * exec / noexec - Permit/Prevent the execution of binaries from the filesystem.
 * suid/nosuid - Permit/Block the operation of suid, and sgid bits.
 * ro - Mount read-only.
 * rw - Mount read-write.
 * user - Permit any user to mount the filesystem. This automatically implies noexec, nosuid,nodev unless overridden.
 * nouser - Only permit root to mount the filesystem. This is also a default setting.
 * defaults - Use default settings. Equivalent to rw, suid, dev, exec, auto, nouser, async.
 * _netdev - this is a network device, mount it after bringing up the network. Only valid with fstype nfs.
 * atime - This option causes Linux to record the last (or latest) time when a particular file was accessed.
 * noatime - This option stops recording the last file access time when the file is just read.
 * relatime - This option causes the access time to be updated if they are earlier than the modification time.

Dump
Dump field sets whether the backup utility dump will backup file system. If set to "0" the file system is ignored, with "1" it is backed up.

Fsck
Fsck order is to tell fsck what order to check the file systems, if set to "0" the file system is ignored.

= Auto-mount of iso-image in /etc/fstab = /iso-archiv/image.iso /mnt/image1 iso9660 ro,loop,auto 0 0 ( first mkdir /mnt/image1 !)