Find the answer to your Linux question:
Results 1 to 4 of 4
hi guys, i understand that cat prints text to the screen and that /etc/fstab is the file that holds file system tables here is my output data: Code: # # ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2012
    Posts
    56

    Cat /etc/fstab break down...


    hi guys,

    i understand that cat prints text to the screen
    and that /etc/fstab is the file that holds file system tables

    here is my output data:
    Code:
    #
    # /etc/fstab
    # Created by anaconda on Mon Jan  7 21:50:16 2013
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/mapper/vg_centos1-lv_root /                       ext4    defaults        1 1
    UUID=168d0189-0e73-4fa5-87e6-8516d58220a1 /boot                   ext4    defaults        1 2
    /dev/mapper/vg_centos1-lv_home /home                   ext4    defaults        1 2
    /dev/mapper/vg_centos1-lv_swap swap                    swap    defaults        0 0
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
    my questions:

    what is dev/mapper/vg_centos ...... is that just my root directory?
    UUID number? i googled what UUID is...is this just a number assigned to the root directory?

    and what are the numbers 1 2 and 0 0
    this output looks pretty confusing, my book doesnt explain this

    can somebody please help me or point me to some info i can read
    thanks
    Last edited by atreyu; 04-12-2013 at 12:00 AM. Reason: added CODE tags to aid in readability

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by j0n1n View Post
    what is dev/mapper/vg_centos ......
    Each of these vg_centos1-lv_* entries in the /dev/mapper directory is an LVM volume group. LVM is a suite of tools used to manage logical volumes in Linux. Read the main man page here. There are many related tools/man pages that you can read about in that one.

    UUID number? i googled what UUID is...is this just a number assigned to the root directory?
    It is a unique number assigned to the volume group. You could also assign a UUID to a regular hard disk partition, if you weren't using LVM. It is way to tell fstab to mount your disks even if they get detected in an order different from their order during install.

    and what are the numbers 1 2 and 0 0
    Run man fstab to read up on the field meanings, e.g.:

    The fifth field (fs_freq).
    This field is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is
    returned and dump will assume that the filesystem does not need to be dumped.

    The sixth field (fs_passno).
    This field is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a
    fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be
    checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume
    that the filesystem does not need to be checked.


  3. #3
    Just Joined!
    Join Date
    Dec 2012
    Posts
    56
    thanks for that Atreyu

    is it very important to know / edit the fstab file? would you work in it often?

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by j0n1n View Post
    is it very important to know / edit the fstab file?
    As an admin of Linux boxes, it is imperative that you understand the format of the fstab file. Fortunately, it has not changed all that much in its history, and is not too complicated. Like you said, the least understood ones are the two you mentioned. Definitely spend some time reading up on the man page, and I encourage you to play with the fstab file, on a test box that you don't mind bricking!

    would you work in it often?
    These days, you don't have to work with it too often, but times definitely come up. One obvious one is when you add a new hard disk drive to your system. most Linux OSs don't write to fstab for you, even if they partition and format the disk for you.

    You might also need to add entries for things like network shares (SaMBa, NFS, etc.), or maybe add a ramdisk (tmpfs) etc, or maybe change the mount options of a particular partition. for example, maybe you want faster writes to an ext volume, so you might want to turn off mod times that are normally stored in the filesystem. you'd do that in fstab in the options field.

    but always remember that if you mess up your fstab file, you will likely brick your system! the most important filesystems are root ("/") and /boot. they are usually the first two entries listed in the fstab file. don't mess with those until you really know what you are doing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •