6

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) ?

5
  • 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
    Commented Sep 28, 2021 at 3: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. Commented Sep 28, 2021 at 3: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
    Commented Sep 28, 2021 at 4:10
  • Here is a related question. It has detailed answers. Commented Jun 30, 2023 at 2:40
  • 1
    Does this answer your question? Boot drops to a (initramfs) prompts/busybox
    – guiverc
    Commented Apr 20 at 6:51

1 Answer 1

11

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.

2
  • 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. Commented Jun 30, 2023 at 2: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
    Commented Feb 29 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .