2

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
3
  • This is an ancient linux: most of these VFSs (sysfs, devpts, devtmpfs) are obsolete. Any chance you can upgrade to something more recent? Commented Jun 16, 2015 at 12:36
  • Hmm, I didn't know that. However, it certainly isn't an ancient linux. Kernel is at 3.19.0, desktop libraries and applications (eg Qt, KDE, GTK) are from git and most other system libraries are the most recent (or one of the most recent, if very frequently released) releases. I do have eudev installed - perhaps I should remove these VFSs? This time on boot, everything except /dev/pts mounted correctly. Switching to a text console (Ctl-Alt-F1) and running sudo mount /dev/pts fixed this.
    – chrisb2244
    Commented Jun 17, 2015 at 0:31
  • Considered that perhaps the reason for this problem was mounting /dev/pts earlier in the fstab than /dev, since wouldn't be very helpful, but /dev is one of four explicit mounts in /etc/rc.d/mountvirtfs, and /dev/pts is presumably left to be mounted by the mount -a call in /etc/rc.d/mountfs (which is called afterwards). In any case, switching order made no difference (which didn't surprise me following the closer inspection explained above)
    – chrisb2244
    Commented Jun 17, 2015 at 9:18

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .