How can I force a Ubuntu kernel to fail mounting / and drop into the initramfs rescue shell?

9,704

This will drop you into an initramfs shell:

  • Start your computer. Wait until the Grub menu appears.
  • Hit e to edit the boot commands.
  • Append break=mount to your kernel line.
  • Hit F10 to boot.
  • Within a moment, you will find yourself in a initramfs shell.

If you want to make this behavior persistent, add GRUB_CMDLINE_LINUX_DEFAULT="break=mount" to /etc/default/grub and run grub-mkconfig -o /boot/grub/grub.cfg.

Share:
9,704

Related videos on Youtube

0xC0000022L
Author by

0xC0000022L

human father bibliophile geek & ~nerd misanthropic philanthropist skeptic code necromancer programmer reverse engineer (RCE) / software archaeologist / grayhat hacker moderator on reverseengineering system administrator FLOSS enthusiast Debian, FreeBSD and Ubuntu aficionado

Updated on September 18, 2022

Comments

  • 0xC0000022L
    0xC0000022L over 1 year

    I am trying to customize the initramfs rescue environment and would like to force the kernel to fail mounting / and drop into the (initramfs) rescue shell, as opposed to single user mode.

    How can I do that?

    NB: I know how to hook into initramfs-tools to achieve the customization steps, but I need to be able to verify the result.

  • 0xC0000022L
    0xC0000022L about 11 years
    thanks! This is spot on what I was looking for. Two things: 1.) I had to press Ctrl+C before being dropped into the initramfs shell and 2.) because I use GRUB2 the line is called linux :)