recovering from echo u > /proc/sysrq-trigger without restarting/rebooting/power cycle

threesc

New Member
Joined
Jul 5, 2021
Messages
7
Reaction score
2
Credits
80
Is it possible if I run echo u > /proc/sysrq-trigger to get the linux back to the same state it was before without waiting for a restart. My use case is an embedded linux system that needs to deal with sudden (though with short notice because of supercapacitors) loss of power, and possibly regaining power when it thought it was going to lose power.

When power loss is detected I would like to prevent writing to anything, for which this command is an option (the other I've found is fsfreeze -f, which stops any program that attempts to write until fsfreeze -u is run), and then in the case that power is restored unexpectedly, I would prefer to avoid needing to restart.

However, I'm not actually sure what that command does, I if I look at findmnt it looks like it has remounted some things as ro, of which I am able to remount all as rw except for / (I think its called the rootfs), but I can't find clear explanation of the command, some people say it unmounts everything (which seems to be false) and all I can find about it is that it is a good command to run if power is about to be lost.

Also, not sure if it is relevant, but sometime in the future rootfs will be mounted as ro.
 

Members online


Latest posts

Top