Linux: Access directly to the shell in case of boot failure

Why

Sometimes, we mess up with Ubuntu (for example), then we are not able to boot to the graphical user interfaces. We may fix the issue with the command line, but we cannot access the command line because of failures during boot time.

In this case, we can edit the grub boot option, to access the shell. Then we made changes, then reboot.

With this trick, we can even reset the root password without remembering the current password.

How

When the grub shows the menu of operating systems to boot, press e to edit the menu of current entry.

Find the line that contains linux... vmlinux ... ro. We need to:

  1. ro => rw Any change has to be writen to the system.
  2. add init=/bin/sh
  3. Press Ctrl + X to boot

That’s it. If you know this trick, you are probably know how to fix your own issue.

I guess anyone who jumps into this post via search engine just doesn’t remember the exact parameter, but they know how already. Please comment if this post help you 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.