5

My cat walked over my keyboard and pressed "magical" SysRq u, doing an Emergency Remount R/O. How do I reverse this?

On How do I remount a filesystem as read/write?, SirCharlo claims

The correct syntax is:

sudo mount -o remount,rw /partition/identifier /mount/point

but that just yields another error,

mount: you must specify the filesystem type

and if I supply it, e.g.,

$ sudo mount -t ext4 -o remount,rw /dev/sda7 /

I'm back at the error message the OP reported,

mount: / not mounted or bad option

That diagnostic begs the question, which? Not mounted, or bad option? The exit status is 32, and man mount provides this key:

  mount has the following return codes (the bits can be ORed):
  0      success
  1      incorrect invocation or permissions
  2      system error (out of memory, cannot fork, no more loop devices)
  4      internal mount bug
  8      user interrupt
  16     problems writing or locking /etc/mtab
  32     mount failure
  64     some mount succeeded

OK, looks like a mount failure. ;-)
What can I do about it?

BTW, in response to Alkthree's question "How do I remount", SirCharlo also suggest not a remount but umount followed by mount. Why?

11
  • I deleted my answer; on a second thought, that's probably just not reversible. What if a process tries to remount the system read/write after you remounted everything with an emergency remount? I think that's just actively inhibited to forbid any process to go against the emergency remount. Nevertheless +1 for the good question, and I'll research this a bit and post again if I find something since this intrigued me.
    – kos
    Dec 22, 2015 at 17:14
  • 1
    @Hi-Angel: Yes, kos and I did exactly that, with removed partition identifier. When I (as root) run mount -o remount,rw /, that program (/bin/mount) figures out the partition identifier by itself, and attempts the system call mount("/dev/sda7", "/", 0x19f6590, MS_MGC_VAL|MS_REMOUNT, "errors=remount-ro"), which returns -1 EINVAL (Invalid argument), and then it prints mount: / not mounted or bad option.
    – Quigi
    Dec 22, 2015 at 19:13
  • 1
    mount without options produces this output that's too long by 900 or so characters, and ends with this crucial note about its staleness: mount: warning: /etc/mtab is not writable (e.g. read-only filesystem). It's possible that information reported by mount(8) is not up to date. For actual information about system mount points check the /proc/mounts file.
    – Quigi
    Dec 22, 2015 at 19:20
  • 1
    The first (stale!) row reports a partition mounted on "/", namely /dev/sda7 on / type ext4 (rw,errors=remount-ro,commit=0). In contrast, the up-to-date /proc/mounts has two, rootfs / rootfs rw 0 0 and /dev/disk/by-uuid/3a1bce3b-90fa-423f-9bee-69874fd7a9c1 / ext4 ro,relatime,errors=remount-ro,data=ordered 0 0
    – Quigi
    Dec 22, 2015 at 19:26
  • 1
    Okay, I don't know what to do, but a couple of thoughts of what I'd do here: try to look at the /var/log/syslog and dmesg for anything file system related, especially for the moment when the filesystem was remounted, and anything related to /dev/sda7. Run tail -f /var/log/syslog, and try to run the mount -o remount,rw / again, also try to press again the Alt+SysRq+u — and see if there would be any prints.
    – Hi-Angel
    Dec 22, 2015 at 20:06

0

You must log in to answer this question.

Browse other questions tagged .