Saturday, January 29, 2011

Direction on incorrect /etc/mtab file

I have an mtab file that looks nothing like the fstab file. I'm running CentOS 5.3 on Xen Source and am using HyperVM and Kloxo to administer the VM. Where should I be looking for assistance? XenSource, CentOS, or HyperVM documentation.

/etc/fstab:

> /dev/sda1   /              ext3        defaults,usrquota,grpquota  1 1
> none        /dev/pts       devpts      gid=5,mode=620              0 0 
> none        /dev/shm       tmpfs       defaults                    0 0 
> none        /proc          proc        defaults                    0 0 
> none        /sys           sysfs       defaults                    0 0 
> /dev/sda2   swap           swap        defaults                    0 0

/etc/mtab:

> /dev/simfs    /                         reiserfs    rw,usrquota,grpquota 0 0 
> /dev          /dev                      tmpfs       rw                   0 0 
> /proc         /proc                     proc        rw                   0 0
> /sys          /sys                      sysfs       rw                   0 0 
> none          /selinux                  selinuxfs   rw                   0 0 
> /proc/bus/usb /proc/bus/usb             usbfs       rw                   0 0 
> none          /dev/pts                  devpts      rw                   0 0 
> none          /dev/shm                  tmpfs       rw                   0 0 
> none          /proc/sys/fs/binfmt_misc  binfmt_misc rw                   0 0
  • /etc/fstab is for specifying what to mount at boot time. /etc/mtab returns what is currently mounted.

    /etc/mtab may not be 100% reliable in all situations, it's best to rely on the output of a plain mount command which provides the same information.

    It's completely possible for the two to differ substantially and the system still be running normally.

    I have the /dev/pts and /dev/shm in my mtab, but not in my fstab, and all is running normally.

    James Lawrie : Just to add to this, mount is not always reliable either as it reads from the disk (if the disk is readonly for example it will be wrong). `cat /proc/mounts` is a more accurate alternative.
  • The /etc/fstab is what you, the systems administrator, configures that is used to direct the mounting of the disks mostly at reboot time. It is quite possible that things in the kernel mount table, or the /etc/mtab file will be different. For example, some of your mounts specified in the /etc/fstab may not be mountable. This may be of concern.

    However when you mount a device or disk, basically TWO special tables get changed: (1) the mount table resident in the kernel, and (2) /etc/mtab basically a standard file. In some cases, it is possible for /etc/mtab and the kernel mount table not to be in sync. If this is a problem you can delete /etc/mtab and reboot the system.

    From mdpc

0 comments:

Post a Comment