How to add an entry to GRUB which would drop to root shell?

I want to add a entry to the GRUB such that selecting it would boot my Manjaro installation into a root shell, something similar to the "recovery mode" in Ubuntu.

How do I go about doing that?

EDIT:

from this
linux /@/boot/vmlinuz-4.9-x86_64 root=UUID=d6e03157-aa9a-4077-a82e-7d2d4ca5151a rw rootflags=subvol=@ quiet resume=UUID=3966b4b6-8dca-42d0-a57a-d55aea08d44a
to
linux /@/boot/vmlinuz-4.9-x86_64 root=UUID=d6e03157-aa9a-4077-a82e-7d2d4ca5151a rw rootflags=subvol=@ quiet resume=UUID=3966b4b6-8dca-42d0-a57a-d55aea08d44a 3

Create a file /boot/grub/custom.cfg.
Put in that entry into that file.

I am a n00b. What do I put in that file?

Same as the normal entry but add '1' (no apostrophes) to the linux line.
You can always (temporarily) edit the linux line from the usual entry by pressing 'e' at grub menu and add the '1' and boot. Note '1' as root shell does not have internet access.
'3' will boot to user prompt with internet and if we need root privileges, then add 'sudo' to command. '3' is therefore more versatile. Other run levels are not that useful.

Personally, I don't find need to add an entry. Edit the normal entry if required. If you need to do that often, let us know why.

1 Like

Thank you! It worked for me.

If you need to do that often, let us know why.

Actually I was trying to change display driver in my laptop to an open source version. And it fails at boot. I have created a new thread. Please check it out if possible.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by