5

I get the (initramfs) prompts/busybox occasionally in Ubuntu 20.04.

BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash) 
Enter 'help' for a list of built-in commands.

(initramfs)

A manual fsck solves the problem. But, I need to know which partition got corrupted. Sometimes when I get the BusyBox, neither the reboot command nor the exit command works (I suppose the exit command works, but we are still in the BusyBox because the file system errors persists). I need to turnoff or reboot to see which partition has the problem.

How to turnoff or reboot when you get BusyBox (and reboot and exit commands has no effect) ?

  • Have you tried SysRq commands direct to kernel ? (ie. REISUO for off, REISUB for reboot) Sorry I can't verify they'll work currently, but they'd be what I tried first – guiverc Sep 28 '21 at 03:30
  • @guiverc I don't know these commands. Feel free to post an answer (e.g. generally what we should do in linux when we get busybox). I tried only commands listed by help. – Cyriac Antony Sep 28 '21 at 03:37
  • 1
    SysRq is a key on the keyboard (though many modern keyboards don't have it printed on the keys, as it was traditionally printed on the key front and not top - but those keyboards still work; some just require you to add a Fn but this is firmware/brand specific). It's not Ubuntu specific but kernel commands (anything using a linux kernel can use it - so android phones IF you have one with a real keyboard; it cannot be on-screen GUI keyboard). Grab a phone & search "magic sysrq" & the wikipedia article will be near/at top for any search engine & is good enough – guiverc Sep 28 '21 at 04:10
  • Here is a related question. It has detailed answers. – Cyriac Antony Jun 30 '23 at 02:40

1 Answers1

8

I know I'm almost two years late here, but considering this has no answers...

To turn off your system from the initramfs shell, run the poweroff command:
(initramfs) poweroff

To reboot, you can use the reboot command:
(initramfs) reboot -f

Note that you must pass the -f (force) switch to the reboot command, without it the system does not reboot.

Gogeta70
  • 347
  • I no longer have this issue (moved to another version of os). But, I had tried only reboot. The command reboot -f may solve the issue. Users who have this problem currently are requested to share whether this solution works for you. – Cyriac Antony Jun 30 '23 at 02:36
  • 1
    Just had the unfortunate encounter and can confirm the reboot part. SysReq SUB would probably have also worked, (REI were reported as disabled) I used it when the boot before failed, after the reboot I ended up in BusyBox. – Brandlingo Feb 29 '24 at 20:58