0

I've got a broken HDD for the rootfs - this probably caused the filesystem to be mounted read-only... however /proc/mounts still says it's mounted rw:

$ cat /proc/mounts 
rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,relatime,size=7575440k,nr_inodes=1893860,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,relatime,size=3033888k,mode=755 0 0
/dev/disk/by-uuid/548b00b0-bd98-4017-9e62-5c27b633268b / ext4 ro,noatime,errors=remount-   ro,data=ordered 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0
/dev/sdb1 /mnt/storage1 ext4 ro,noatime,errors=remount-ro,data=ordered 0 0
/dev/sdc1 /mnt/storage2 ext4 rw,noatime,errors=remount-ro,data=ordered 0 0
/dev/sdd1 /mnt/storage3 ext4 rw,noatime,errors=remount-ro,data=ordered 0 0

However the filesystem is read-only:

$ touch new
touch: cannot touch `new': Read-only file system

That's pretty unfortunate because the Nagios/Icinga Script I use check_ro_mounts checks /proc/mounts for exactly this. It works with other filesystems mounted under /mnt/ without problems.

Is this some Linux Kernel trick? I also don't know what does rootfs means here?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.3 LTS
Release:    12.04
Codename:   precise
$ uname -a
Linux foo 3.5.0-25-generic #39~precise1-Ubuntu SMP Tue Feb 26 00:07:14 UTC 2013     x86_64 x86_64 x86_64 GNU/Linux
kei1aeh5quahQu4U
  • 445
  • 5
  • 22
  • read the kernel documentation about rootfs and it will be clear why there is a rootfs entry and why two entries are mounted on `/`. https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt – Eric Dec 19 '18 at 20:50

1 Answers1

5

There are multiple entries for / in /proc/mounts, and the second entry shows information about your real root filesystem (note the ro flag there):

/dev/disk/by-uuid/548b00b0-bd98-4017-9e62-5c27b633268b / ext4 ro,noatime,errors=remount-ro,data=ordered 0 0

The first entry with the rootfs filesystem type appears because the Linux kernel creates a RAM-based filesystem internally during boot and unpacks the initramfs archive there; then initramfs scripts and utilities load the required driver modules and mount the real root filesystem.

Sergey Vlasov
  • 6,288
  • 1
  • 21
  • 30