FSTAB and MTAB
These are some of those critical programs for
your computer. Without these, your computer will not know where to find
any of the partitions or drives on the computer. Goof this up and you
can be dead in the water. Never make any changes without a good backup
copy.
/etc/fstab
In this file there is a
description of the various file systems. Commands like ¨fsck¨
and
¨mount¨ consult this file for the actions they take.
This looks
like a complicated description of the files on your computer, but it is
really simple if you break it down into the parts of each entry. Take a
look below.
( OR :In order for certain programs to be able to
determine where certain partitions are supposed to be mounted by
default, the /etc/fstab file is used )
/dev/hdb1 / ext3 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hdb6 /home ext3 defaults 1 2
none /mnt/cdrom supermount
dev=/dev/hdc,fs=auto,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0
none /mnt/cdrom2 supermount
dev=/dev/scd0,fs=auto,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0
none /mnt/floppy supermount
dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,sync,codepage=850,umask=0 0
0
/dev/hda1 /mnt/windows vfat
iocharset=iso8859-1,codepage=850,umask=0 0 0
none /proc proc defaults 0 0
/dev/hdb7 /usr ext3 defaults 1 2
/dev/hdb5 swap swap defaults 0 0
/dev/sda1 /mnt/memory_card auto
user,iocharset=iso8859-1,kudzu,codepage=850,noauto,umask=0,exec 0 0
I
will try to bring some clarity in there. Let´s only take the
partitions, here for Linux : / and /home and swap. For Windows C:
< partition >< mount point >< file system >< mount
options >< dump >< fsck order >
/dev/hdb1
. . . . /
. . . . . . . . . . . .
ext3
. . . . . . . . .
defaults
. . . . .
. . 1
. . . . . . . . .
1
/dev/hdb6
. . . . /home
. . . . . . .
ext3
. . . . .
. . . . defaults
. . .
. . . . 1
. . .
. . . . . . 2
/dev/hdb5
. . . . swap
. . . . . . . .
swap
. . . . . . . .
defaults
. . . . . . . 0
. . . . . . . . . 0
/dev/hda1
. . . .
/mnt/win_c vfat
. . . iocharset=iso8859-1,codepage=850,umask=0
0 0
For the CD-ROM and floppy drive:
none
. /mnt/cdrom
. . supermount
dev=/dev/hdc,fs=auto,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0
none
.
/mnt/floppy supermount
dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,sync,codepage=850,umask=0 0
0
You can see the CD-ROM and floppy have the same codes as the Windows
partition because they are not Linux default.
For the memory card reader:
/dev/sda1 /mnt/memory_card auto
user,iocharset=iso8859-1,kudzu,codepage=850,noauto,umask=0,exec 0 0
Two additional entries are ¨devpts¨ and ¨/proc¨
The devpts file system provides an interface to pseudo-terminal (pty)
devices. It is typically mounted at /dev/pts.
The /proc filesystem is to provide an easy way to view kernel and
information about currently running processes.
If you build Linux from scratch, you will have to write your own
/etc/fstab file.
/etc/mtab
This file handles the mounted devices and is automatically
updated by the mount command.
And
it looks a bit similar to fstab but not the 100% same ( notice rw and
ro for read/write and read only ) And it does only lists the mounted
devices !
/dev/hdb1 / ext3 rw 0 0
none /proc proc rw 0 0
none /proc/bus/usb usbdevfs rw 0 0
none /dev devfs rw 0 0
none /dev/pts devpts rw,mode=0620 0 0
/dev/hdb6 /home ext3 rw 0 0
none /mnt/cdrom supermount
ro,dev=/dev/hdc,fs=auto,--,iocharset=iso8859-1,codepage=850,umask=0 0 0
none /mnt/cdrom2 supermount
ro,dev=/dev/scd0,fs=auto,--,iocharset=iso8859-1,codepage=850,umask=0 0 0
none /mnt/floppy supermount
rw,sync,dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,codepage=850,umask=0
0 0
/dev/hda1 /mnt/windows vfat rw,iocharset=iso8859-1,codepage=850,umask=0
0 0
/dev/hdb7 /usr ext3 rw 0 0
/dev/sda1 /mnt/memory_card vfat
rw,nosuid,nodev,iocharset=iso8859-15,codepage=850,umask=0,user=julia 0 0
Next time we will do the ¨mount¨ and ¨umount¨
commands related to these /etc/fstab and /etc/mtab files.

Bruno
-- Jul 2 2003 ( Revised Dec 10 2005 ) --