Monday, June 21, 2010

Boot to single user mode in Ubuntu 10.04 Lucid Lynx

This is symptomatic of how often I break X.org but I often need to boot my Ubuntu 10.04 machine into single user mode and fix some configuration file before rebooting into the GUI. I forget how to do it every time so here is how:

  1. Hold the Shift key at boot to display the Grub boot menu.
  2. Select the top Grub entry, it will be similar to:
    Ubuntu, with Linux 2.6.32-22-generic-pae
  3. Hit e to edit the the Grub entry.
  4. Find the line that looks like this:
    linux /boot/vmlinuz-2.6.32-22-generic-pae
    root=UUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
    ro vga=794 quiet splash
  5. Change the line to:
    linux /boot/vmlinuz-2.6.32-22-generic-pae
    root=UUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
    init=/bin/bash rw
  6. Hit crtl+x to boot

Your machine will now do a one time boot into single user mode. Once you reboot the changes you just made to Grub will be reverted.

** /bin/sh corrected to /bin/bash thanks Hola2040.

6 comments:

holla2040 said...

You might need init=/bin/bash

Unknown said...

Thanks Hola204,
it worked with init=/bin/bash

Troy Test 1234 said...

Thanks Hola2040
I have /bin/sh sym linked to /bin/bash instead of the usual /bin/dash and had forgotten.

孫德華 (Walter Suen) said...

It's read-only mode, to have read-write mode, should be set
rw init=/bin/bash

Arne Evertsson said...

I had to move rw before before init=/bin/bash

Anonymous said...

Thank you for this: I wouldn't've found that Shift is the magic keystroke without help. (I'd already rebooted a bunch of times looking for the boot menu and stabbing wildly at various keys to make it appear.)

Simply appending ‘single’ to the line worked for me. I left everything else exactly as it was, just putting a space then ‘single’ after ‘quiet splash’. I find that easier to remember and type than the way you describe.

Post a Comment