During boot, some/many mount points in /etc/fstab are not mounted. The /etc/mtab file contains these mount points - my understanding is that the system believes the filesystems are already mounted.

Modifying my /etc/rc.d/init.d/mountfs script (taken from LFS) with the line

grep -v root /proc/mounts > /etc/mtab

before the call to (I added the v and # to get some output - the system claims already mounted)

mount -av -O no_netdev # > /dev/null

allows the system to appropriately mount the filesystems.

However, in this case, the filesystems are not correctly unmounted on shutdown (by the same script taking the stop argument). The error on shutdown relates to the root filesystem.

df returns output which shows the state of my filesystems, so is easy to check. mount outputs all of the expected mountpoints, even if they are not mounted (ie, without the modification to /etc/rc.d/init.d/mountfs)

Issuing commands such as mount /mountpoint/in/fstab successfully mounts the point, even if it is already in /etc/mtab (presumably this is because mount -a checks mtab, and mount <specific point> does not?)

What's going wrong?

My /etc/fstab:

# device     mount-point     fs-type    options      dump fsck-order

# Core mount points
proc         /proc           proc       nosuid,noexec,nodev     0  0
sysfs        /sys            sysfs      nosuid,noexec,nodev     0  0
devpts       /dev/pts        devpts     gid=5,mode=620          0  0
tmpfs        /run            tmpfs      defaults                0  0
devtmpfs     /dev            devtmpfs   mode=0755,nosuid        0  0

/dev/sda8    swap            swap       pri=1                   0  0
/dev/sda9    /               ext4       defaults                1  1
/dev/sda10   /home           ext4       defaults                0  2

# Additional mount points
/dev/sda6    /mnt/Ubuntu     ext4       defaults                0  0
/dev/sda11   /sources        ext4       defaults                0  0

# Network mounts
//software.blah.blah/path /mnt/Licensed cifs credentials=/home/<user>/.smbpasswd,ro,_netdev 0 0
  • If you're still watching this question, as a troubleshooting measure, please empty out your Core Mount Points section to only include enough to boot your linux, which looks like sda8 - sda10, reboot and tell us the outcome. – eyoung100 Jul 16 '15 at 22:42

Issuing grep -v root /proc/mounts > /etc/mtab; echo "/dev/sda9 / ext4 defaults 1 1" >> /etc/mtab fixed this problem.

The startup issue was due to the mtab file having entries not properly removed during shutdown. Once the root filesystem was added to the mtab file (after boot), the shutdown occured properly and then startup also works fine.

The line added to mountfs was not needed after the mtab file was correctly set.

If the computer loses power/is shutdown forcefully, this has on one occasion become broken again. Then the steps above correct the problem.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.