Explanation: The FSTAB File

Posted in Technology
Mon, Jun 5 - 5:02 am EST | 12 years ago by
Comments: 1
Be Sociable, Share!
    Use Arrow Keys (← →) to Browse

    The File System Table fiel (fstab) is usually  located in at /etc/fstab. The file contains all of the file systems that are available to the system. Any file system listed in the fstab can be mounted and unmounted with little trouble (assuming it is physically present).

    My fstab looks like this


    # /etc/fstab: static file system information.
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    /dev/sda1       /               ext3    defaults,errors=remount-ro 0       1
    /dev/sda2       /home           reiserfs defaults        0       2
    /dev/sda3       none            swap    sw              0       0
    /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0

    This isn’t formatted well, but you can see the column headings clearly.

    The first column contains the name of the file system. If you recall my primer on how hard drives are named in GNU/Linux, the names in this column should be somewhat familiar to you. I have on SATA (which is why it is named SDA instead of the more typical HDA) 100GB disk drive broken up into three partitions and a CDRom drive. The first three entries of my stab mount my hard drive partitions and the last mounts my CDRom drive.

    Note: /proc is a special file system which I won’t discusss here.

    The next column tells Linux where to mount the file system. My first partition at /dev/sda1 is mounted as root (/). In practise, this means I can simply type cd / to get to that parition. SDA2 is my 82GB home partition, and SDA3 is my 3GB swap partition. To get at my cdrom, I will have to type cd /meia/cdrom0.

    The next column specified the type of file system. My root partition is formatted as ext3, my home partition as reiserfs and my swap partition as…well…swap. My CDRom isn’t formatted for obvious reasons, but when I insert a disk my system will expect to find it formatted in either the Universal Disk Format (udf) or the iso9660 (standard CDRom) format.

    Next is the options colum. There are many possible values for this column, but some of the more common are defaults, user, and users. Defaults is a quick way of specifying read/write, suid, dev, exec, auto, nouser, and async. I’ll write another entry on what all of these options mean. User means that a non-privileged user can mount and the same user can unmount the file system. Users (note the ‘s’) means that non-privileged users can mount and unmount the file system. The difference being that ‘users’ can unmount file systems that they didn’t mount to begin with.

    The last two columns are dump frequency and the fsck pass number. Dump has two possible options: 1 for ext2 file systems and 0 for all other file systems. I’ll write another entry on exactly what dump frequency is, but these two values should suffice for now. Lastly, the fsck pass number tells the sytem when to run fsck on the file system. There are three possible values: 0,1, and 2. A value of 0 means to not check the file system at all, and 1 and 2 just specify the order in which to check the remaning file systems. A number 1 should be assigned to the root mount point (as is the case with mine) so that it is fscked first. If you’d like other partitions fsck’d at boot time, then you can put a ’2′ in the pass column of the other file systems to achieve that.

    technorati tags: ,

    Use Arrow Keys (← →) to Browse

    Be Sociable, Share!

      Related Posts

      Be Sociable, Share!