Hacker News new | past | comments | ask | show | jobs | submit login

If you're concerned about flushing writes consider `mount -oremount,ro` -- this guarantees writes are flushed and is the only truly important step of a system shutdown anyway WRT filesystem integrity. Once filesystems are mounted read-only you can safely power off the machine.

Filesystems can be remounted read-only via the serial console as well, with a break-u. Useful even when userland is otherwise inaccessible such as in the event of a fork bomb.




Nice to learn this - but how does one send a "break-u" e.g. from inside minicom, or in KVM virtual machines, via virsh console?


I usually use `cu`, but the docs for minicom tell me it's control-A followed by F to send a break signal. Then just hit "u." There are a number of single characters following a break with actions to them, the full doc on this kernel feature is here: https://www.kernel.org/doc/Documentation/admin-guide/sysrq.r...

I'm not terribly familiar with KVM but the VM console tools probably have some way to generate a break signal. Check the docs for how to "send a break."

Oh, and don't forget to enable this feature via sysctl -- per the above linux doc.


"Once filesystems are mounted read-only you can safely power off the machine."

In Ubuntu/Kubuntu there was once a key combination to forcefully unmount all file systems. THey seemed to have discontinued this? No?


You are looking for the Magic SysRq Key: https://en.wikipedia.org/wiki/Magic_SysRq_key

- Alt+SysRq+u remounts all filesystems readonly.

Looks like some of the Magic SysRq Keys are disabled by default now in new Ubuntus.



Yup. You need to set kernel.sysrq=1 , probably in /etc/sysctl.conf




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: