4 ms·
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 s
by throwaway76543 9y ago
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.
- mschuster91 9y agoNice to learn this - but how does one send a "break-u" e.g. from inside minicom, or in KVM virtual machines, via virsh console?
- throwaway76543 9y agoI 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.rst 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.
- jk2323 9y ago"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?
- kbaker 9y agoYou are looking for the Magic SysRq Key: https://en.wikipedia.org/wiki/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.