Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidentally ran sudo grub-reboot 4 (background) twice in a row, and now GRUB permanently boots to the fourth menu item.

How can I restore the default boot behavior?

share|improve this question
up vote 6 down vote accepted

Use the grub-set-default command.
For example, assuming you want the first grub entry to be your default:

sudo grub-set-default 0

share|improve this answer
Or you can clear all this state entirely with 'sudo grub-editenv /boot/grub/grubenv unset prev_saved_entry; sudo grub-editenv /boot/grub/grubenv unset saved_entry'. (That's slightly lower-level, though.) – Colin Watson Jan 5 '11 at 15:03

Open Terminal and type:

cd /etc/default/

Backup your file:

sudo cp grub grub.backup

Edit your file:

gksudo gedit grub

Add this line before the GRUB_DEFAULT=? line:


and change this line to:


Save, close and then run this:

sudo update-grub

Next time, whenever you choose an OS from your grub menu it will be the default one until you choose another one, and so on.

Your first lines will look like these:

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
# ...
share|improve this answer
Thank you for the suggestion, but this is not the default behavior I want to restore. I want GRUB to always boot to the first menu item. – ændrük May 22 '11 at 17:15

It is working , ...anyway.

the first choice in the grub2 menu is '0' the second one is '1' and so on.......

so your file looks like:

GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian

................. ......................

share|improve this answer
Please only use the Post Your Answer button for new, different answers. You should use the edit button to modify your original answer if you need to add additional information. – ændrük May 23 '11 at 13:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.