# <fs> <mountpoint> <type> <opts> <dump/pass>
/dev/hda1 /boot ext2 noauto,noatime 1 1
/dev/hdc7 / xfs noatime,osyncisdsync,nodiratime 0 0
/dev/hdc5 none swap sw 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,ro,user 0 0
# /proc should always be enabled
proc /proc proc defaults 0 0
Now, take a look at the /proc line and notice the defaults option. Use
defaults whenever you want a filesystem to be mounted with just the standard
mount options. Since /etc/fstab has multiple fields, we can't simply leave the
option field blank.
Also notice the /etc/fstab line for /dev/hdc5. This line defines /dev/hdc5 as
a swap device. Since swap devices aren't mounted like filesystems, none is
specified in the mountpoint field. Thanks to this /etc/fstab entry, our
/dev/hdc5 swap device will be enabled automatically when the system starts up.
With an /etc/fstab entry for /dev/cdrom like the one above, mounting the CD-ROM
drive becomes easier. Instead of typing:
# mount -t iso9660 /dev/cdrom /mnt/cdrom -o ro
We can now type:
# mount /dev/cdrom
In fact, using /etc/fstab allows us to take advantage of the user option.
The user mount option tells the system to allow this particular filesystem to
be mounted by any user. This comes in handy for removable media devices like
CD-ROM drives. Without this fstab mount option, only the root user would be
able to use the CD-ROM drive.