cybernightlife [e-mail] [forums] [home] [return]

Explaining /etc/fstab on SimplyMEPIS 6.0

The /etc/fstab file is one of the most important files on any Linux system. It keeps track of disk devices and their mount points on the UNIX directory tree.

Devices kept track with this file are the partition(s) where Linux is installed, the swap partition, any partitions created by other operating systems, floppy drive devices, zip drives, digital cameras, card readers, and other devices that are treated as disks by Linux.

UNIX fundamentals

When accessing anything connected to a Linux system (or Solaris, FreeBSD, or Mac OS-X), everything in a Linux/UNIX system is represented by as a file in the directory structure.

This is true whether you are accessing a document, a printer, your iPod, or another machine on the Internet.

If you ever wondered why files in your SimplyMEPIS system are named as such, here is the structure of a Linux system.

  • /boot: This directory contains all the files needed to start your SimplyMEPIS system (or other Linux for that matter)
  • /bin: This directory contains programs needed for basic Linux functionality
  • /sbin: This directory contains prorgams needed for basic Linux administration
  • /etc: This directory contains systemwide configuration files for not only Linux and applications that run on it. Also, user account information is generally stored here.
  • /var: This directory functions as a scratchpad for much Linux software. MySQL, teTeX, and Postgresql are examples of software that use this directory to store its data for systemwide use. Mail transport agents such as Postfix use this to store systemwide mail.
  • /tmp: This directory is used for temporary files, similar top those files that end in .TMP on W*****s systems, only in a directory of its own.
  • /opt: On some distributions, this is used for installation of major packages or systems of packages such as OpenOffice.org, GNOME, KDE, and Mono.
  • /usr: Here is where most of the Linux distribution resides. It houses a directory similar to the root directory, except that everything not essential to the basic administration and startup of Linux resides.
  • /usr/local: This directory normally contains software packages and their configuration files that are locally installed and locally used. Many packages that are downloaded from source by default are installed into this subdirectory.
  • /home: This is where user accounts are housed on your Linux system. Typically, this directory is housed in a separate partition to make system backups easier. You can integrate this directory in the same partition as the rest of Linux.
  • /dev: This directory contains pseudofiles that are linked to physical devices and disk partitions connected to your system.
  • /mnt and /media: These are mount points on a typical Linux system where devices and partitions are mounted.

fstab stands for File System Table, and it is used by the mount, umount, and eject commands, and any other software that has that functionality.

SimplyMEPIS treats the /etc/fstab slightly different from other Linux distributions. /etc/fstab is divided into two parts, one for static mounting as with other Linux distributions, the other edited by the udev and hal subsystems (the dynamic portion).

Definitions: udev and hal are subsystems for creating and removing devices that are plugged into your system at runtime. hal stands for Hardware Abstraction Layer.

The following is the /etc/fstab from my Gateway 700S system.

# Pluggable devices are handled by uDev, they are not in fstab
/dev/hda5 / ext3 defaults,noatime 1 1
/dev/ipod /media/ipod vfat noauto,users,noexec,rw 0 0
none /proc proc defaults 0 0
none /proc/bus/usb usbfs devmode=0666 0 0
none /dev/pts devpts mode=0622 0 0
none /sys sysfs defaults 0 0
# Dynamic entries below, identified by 'users' option
/dev/hda1 /mnt/hda1 ntfs noauto,users,exec,ro,umask=0222 0 0
/dev/hda6 swap swap sw,pri=1 0 0
/dev/cdrom /media/cdrom iso9660,udf noauto,users,exec,ro 0 0
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 0 0

The line containing "Dynamic entries below" is the division point between the static and dynamic portion of the file.

You can edit the portion above this line as I did with the line containing /dev/ipod, used for mounting and ejecting of my iPod.

However, you cannot edit lines below the division point. These lines are dynamically edited each time your SimplyMEPIS machine boots to reflect the current state of the hardware in terms of disk storage.

The Lines

Each line in /etc/fstab represents a mapping of a physical device or partition to a mount point in the UNIX filesystem.

Let us take an example, the line representing my iPod:

/dev/ipod /media/ipod vfat noauto,users,noexec,rw 0 0

There are six fields that make up this /etc/fstab line, with at least one space separating each field.

  1. Device name: This is the UNIX filename representing the physical device or partition. Typically, this name starts with /dev.
  2. Mount point: This is the UNIX filename on the directory structure where the device or partition is to be mounted.
  3. File system type: This field represents the filesystem to be used when mounting the device or partition. Typical values for this field are ext2, ext3, reiserfs, vfat, iso9660, and udf. auto can be used if multiple filesystems can be used on removable devices such as card readers, CD-ROMs, and DVD-ROMs.
  4. Options: These are options given to the mount, umount and eject commands. A value of defaults means to use the default options for the filesystem being used. users means that any user can mount the device. owner means that only the "owner" of the device can mount and unmount the device. Usually this is the administrator. rw means to mount the device for read and write access. ro means the device is mounted for read-only access. There are quite a few other options that can be placed in this field.
  5. dump: This is usually set to zero for removable devices.
  6. needs checked: When set to zero, this tells Linux not to do a filesystem integrity check on this device at boot time. Setting this value to anything other than zero means the filesystems for the device will be integrity checked at each boot time. This is not recommended for removable devices.

Trademarks Acknowledged

  • SimplyMEPIS and MEPIS are registered trademarks of MEPIS, LLC
  • Linux is a registered trademark of Linus Torvalds
  • Ubuntu and Kubuntu are registered trademarks of Canonical, Inc
  • Debian is a registered trademark of Software for the Public Interest
  • all other trademarks are properties of their respective owners

Copyright 1996-2007 Patrick G Horneker.
Distributed under Free Documentation License, because the greatest enemy we have in this world is ignorance.