4 ms·
This is not for the situation in the article, but a slightly different one. You have a remote server, there's an ssh session still open to it but it's somehow l
by Nursie 13y ago
This is not for the situation in the article, but a slightly different one. You have a remote server, there's an ssh session still open to it but it's somehow lost access to all its mount points including /
You have nothing to work with but bash builtins and /proc, you're 100 miles away and you need to get it up and running again NOW. Emergency reboot -
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
- peterwaller 13y agoDo a `sync` first! Also This is quite like yanking the power chord and plugging it back in. https://en.wikipedia.org/wiki/Sync_(Unix) https://en.wikipedia.org/wiki/Sync_(Unix)
- Nursie 13y agoSync never returns, all filesystems have been lost. Yes, it's exactly like pulling and replugging, which was exactly what I needed! --edit-- is sync even a bash builtin? Looks like it's /bin/sync on my systems. / had been lost (it was on a usb stick on an internal header on an unreliable usb3 card, I later found out.) --edit 2-- if you meant also echoing s to the sysrq-trigger, it seemed to kill the session
- joncp 13y agohttp://www.folkpeople.com/guitar-lesson/pic/power_chord_table.gif http://www.folkpeople.com/guitar-lesson/pic/power_chord_tabl...
- pit 13y agoAt first, I wasn't sure why you posted this, but I was too busy rocking out to mind.
- deleted 13y ago[deleted]
- herokusaki 13y ago>it's somehow lost access to all its mount points How could that happen and leave your system in a state where it is still accessible and can be fixed by a reboot? If you think you might face that kind of trouble you should keep a copy of Busybox and whatever other tools you might need on a RAM drive. You'd have an opportunity to figure out if rebooting would lead to a usable system.
- Nursie 13y agoThe machine would occasionally stop responding completely. I got into the habit of leaving an open ssh session going from another box so I could try and poke around. The root drive was on a (very fast) usb 3.0 stick on an internal header on an add-in card. There was a problem with the card or the driver as every so often something would go wrong and everything would stop responding again. The shell I left open revealed almost nothing as the root drive was gone, but it could be used to reboot the machine (thanks to the trick above), which would then be good again for another few days. I now have / on a proper SSD...