Does Alt + SysRq work on Librem laptops?

I am aware that the sysRq key needs to be configured at kernel compile time and I was wondering if anyone can shed some light at so the kernel configuration on the PureOS distro.

Can one use Alt + SysRq + F say or some other combination to recover from a frozen UI screen?

I tried it on one of my many freezes and found the screen to go black (just a black screen) and nothing more, forcing me to do a hard reboot.

1 Like

Edit /etc/sysctl.d/99-sysctl.conf to add kernel.sysrq = 1, save and restart.

4 Likes

thanks @mladen for the solution. Any particular key combinations to use?

See http://www.linuxhowtos.org/Tips%20and%20Tricks/sysrq.htm

2 Likes

this may sound stupid, but where is the sysrq key on the librem laptops? I don’t see one on the librem 13v4…

I’m not sure what the Librem laptop’s keyboard layout looks like, but SysRq and PrintScrn are usually the same key even if SysRq isn’t marked.

Yeah I know. The Purism 13v4 has, on the right of the F12 key:

NumLk Insert Delete

ScrLk PrtSc Pause

The bottom row gets triggered when you hit Fn. No key is labeled SysRq. I guess it might be Fn-PrtSc?

I would assume that’s the case and that the Fn key would continue to work in the event of a kernel hang. I’ve never had a keyboard where Print Screen was on a secondary layer so I can’t say for sure, but you could enable it, try it out, and report back to let others with Librem laptops know.

I can confirm that Fn PrtSc a does show the little “help” dialog in the logs, which means it works, thanks!

sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)  

It’s a little awkward because ScrLk and PrtSc are reversed from their usual order (PrtSc and ScrLk). But I guess I’ll just have to get used to it…

Update: the magic key combination is actually: Fn Alt PrtSc to invoke Sysrq. That’s because Sysrq is shared with PrtSc so you need Alt PrtSc to invoke it. Then you can use the magic sysrq key to forcibly tell the kernel to reboot, by holding Fn Alt PrtSc then typing R E I S U B, which, of course, stands for “Reboot Even If System Utterly Broken”

2 Likes

Fn Alt PrtScr doe not work for me. Nothing happens.

The PrtScr key has a the SysRq marked below on the same key on my librem 15v4

Does it reboot if you hit Alt + Fn + PrtSc + B ?
That works for me (L13 v3).
I’m not sure if the order is important, but I always press Fn directly before PrtSc, as it needs to apply to this key.
When I do REISUB, I also release all keys in between (I think it didn’t work for me otherwise).

thanks for the heads up

yes it does. My previous attempts kept printing a screenshot. I disable the shortcut and not it works.

I usually don’t need to release Fn Alt PrtSc when I REISUB… I also don’t think the modifier order matters, as long as Fn and Alt are pressed before PrtSc.

That’s kind of nasty advice to give to people, for the record. :slight_smile: The b shortcut is super aggressive – it sends a CPU reset instructions that causes an immediate reboot without any other operation, which can lead to data loss and filesystem corruption. That’s why you run the entire sequence.

A safer way to test this is to monitor your kernel logs, for example, in a terminal, with:

sudo dmesg -w

Then trying a shortcut like Fn Alt PrtSc a, which should print a usage like this:

sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)  

I had the same problem and it was because I wasn’t hitting the Alt key.

I hope that helps!

2 Likes