Wednesday, April 20, 2016

boot - How to mount root filesystem read-only - 16.04



In the past when I entered recovery-mode, the root filesystem was read-only and that was perfectly fine.



But now. after pressing enter at the prompt to drop to shell, it is mounted read-write. It is cumbersome to remount as read-only because many processes are accessing files on it.



I need root filesystem read-only when I am in recovery mode. How can I boot into recovery mode and have it read-only?



At initrd stage the root fs is in ro mode. And after systemd starts and remounts root fs into rw mode. I don't know guts of systemd well. So I tell you how to stop booting right before systemd.
You need to add this line:




break=init


to the end of the kernel parameters. You'll get a command line and the root fs will be in ro mode.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...