[blfs-support] Filesystem recovery messages at every boot

Bruce Dubbs bruce.dubbs at gmail.com
Sat May 11 18:42:55 PDT 2013


Pierre M.R. wrote:
> Markku Pesonen wrote:
>> Arthur Radley wrote:
>> umount -a -d -r -t notmpfs,nosysfs,nodevtmpfs,noproc >/dev/null
>> Despite using the -r option, umount does not remount the root filesystem
>> in read-only mode during shutdown like it used to. Adding this command
>> after that line fixed things for me:
>> mount -n -o remount,ro /
>>
> slackware does that (from /etc/rc.d/rc.6):
> ...
> # Turn off swap:
> echo "Turning off swap."
> /sbin/swapoff -a
> /bin/sync
>
> echo "Unmounting local file systems."
> /bin/umount -v -a -t no,proc,sysfs
>
> echo "Remounting root filesystem read-only."
> /bin/mount -v -n -o remount,ro /
>
> # This never hurts:
> /bin/sync
> ...

I do think there is a bug in umount.

I edited my mountfs script to add some debugging output below the line:

umount -a -d -r -t notmpfs,nosysfs,nodevtmpfs,noproc

mount
cat /proc/mounts
mount -o remount,ro /
mount
cat /proc/mounts

bash

The bash entry is just to read the output.

What I get is:

/dev/sda16 on / type ext4 (rw)

rootfs / rootfs rw 0 0
/dev/root / ext3 rw,...

before the remount.  After the remount the only thing that changes is 
that /dev/root is ro.

In other words mount -r does not work for the root file system any more. 
  It seems a little strange to me that the kernel uses /dev/root because 
that entry is not in the /dev devtmpfs.  Also, I don't understand the 
rootfs in /proc/mounts.  It does not get changed when remounting / read 
only.  This condition is normally only present for the fraction of a 
second between stopping mountfs and the halt/reboot scripts.

I did try to write to /tmp from the bash command and it did tell me that 
the file system was read only.

I'll make a change to the bootscripts to work around this problem a 
little later tonight.

   -- Bruce






More information about the blfs-support mailing list