Linux Basic Administration Concepts

Handling filesystems and mounts

In UNIX, as opposed to windows, there is only one directory tree, starting from the root directory (/). The root directory is mapped (or mounted) to some disk partition. Other partitions may be mounted instead of any existing directory in the filesystem. Mounts may be used to seperate system directories to different disks, or to access foreign (Windows, floppy, CDROM, ...) filesystems. Foreign filesystems are usually mounted under /mnt.

The default mount locations of partitions are defined in a file called /etc/fstab (filesystem table). The file looks like this:

/dev/hda8  /           reiserfs notail                        1 1
none /dev/pts devpts mode=0620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/cdrom /mnt/cdrom auto user,umask=0,exec,ro,noauto 0 0
/dev/fd0 /mnt/floppy auto user,umask=0,sync,exec,noauto 0 0
/dev/hda1 /mnt/win_c vfat defaults 0 0
/dev/hda5 /mnt/win_d vfat defaults 0 0
none /proc proc defaults 0 0
none /tmp tmpfs defaults 0 0
/dev/hda6 /usr ext3 defaults 1 2
/dev/hda7 swap swap defaults 0 0

The first column is the device (or partition) to mount, or none for special filesystems. /dev/hda is the first physical harddisk, and the number is the partition number. To find out your partition list and manipulate partitions use cfdisk or fdisk as root. WARNING: fdisk is a dangerous command and should be used with extreme caution.

The second column is the mount point, the location in the directory tree where the mounted filesystem starts. swap is a partition used for virtual memory.

The third column is the filesystem type, or auto which results in autodetection.

The fourth column is for mount options. For more information on these options and the meaning of the next columns see the man pages for mount andfstab.

Valid HTML 4.01!Alon Altman