1

At work we have an old debian machine that I need to install security updates on, but the filesystem is mounted read-only. Unfortunately the guy who installed it has already retired and has not documented what he did on this machine.

output of mount:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=63624,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=51512k,mode=755)
/dev/disk/by-label/rootfs0 on / type ext2 (ro,noatime,errors=continue)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda4 on /mnt type ext2 (rw,noatime,errors=continue)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /var/log type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /var/tmp type tmpfs (rw,nosuid,nodev,relatime)

I took a look at /etc/fstab which looks kinda strange, since I can't see an entry for /:

LABEL=data      /mnt    ext2    defaults,noatime,rw     0       2
proc            /proc   proc    defaults                0       0
tmpfs           /tmp    tmpfs   nosuid,nodev            0       0

Where else could there be a settings, that mounts the filesystem read-only?

1
  • I remember I had this happen but don't recall the answer. But I do know for sure I found it by exercising some Google Fu.
    – SDsolar
    Commented Jun 16, 2017 at 0:57

1 Answer 1

3

/ is not initially mounted via fstab because to get to /etc/fstab you need to have / mounted. It is mounted via kernel root= option. The ro parameter is probably in your bootloader configuration (like /boot/grub/grub.cfg) as it should be.

Later during boot / is remounted according to fstab; the rw option should be there. In your case there's no proper entry so the ro option stands.

You may want to read more: How is /etc/fstab accessed before root is mounted?


Solution

Remount as read-write by hand:

sudo mount -o remount,rw /

If you want to make a permanent change then create proper / entry in /etc/fstab with rw option.

You must log in to answer this question.

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