Saturday, February 27, 2010

Overview on 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. If u mess up these files, the next moment you will feel like the fish kicked out of 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 !

 
Things You Should Know About Linux !!!