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 apologize in advance for asking a question I suspect is very, very simple. I just got a dedicated server running Ubuntu and I'm using SSH to access it. I ran sudo apt-get dist-upgrade and got the following error message: "The Grub boot loader was previously installed to a disk that is no longer present or whose normally unique indentifier was changed for some reason. It is important to make sure that the installed grub stays in sync with other components such as the grub-cfg or with newer linux images it will have to load, and so you should check again, to make sure that GRUB is installed to the appropriate boot devices."

The forum won't let me post an image since I'm a new user, but I uploaded a screenshot of what I'm seeing here:

After a bit of research, I know I need to install to /dev/sda. However, I can't figure out how to select that option. I used the arrow keys to highlight it, then pressed enter, but that didn't work. I assume there's some command which I am not familiar with. Can anyone help me out? Again, my apologies for a stupid question...


share|improve this question
up vote 12 down vote accepted

Use Spacebar! That's the way to select in ncurses :)

share|improve this answer
And... that did it. Thank you! (If only I'd asked this before spending an hour searching the web.) – David Vogel Dec 30 '11 at 21:15
LOL. Well, now you got it til the next time you need it. The ncurses interface (which is those text gui type of things) is pretty common sometimes. Glad to be able to help! – Niclas Nilsson Dec 30 '11 at 21:17
sudo grub-install /dev/sda


sudo update-grub
share|improve this answer
You want to use the debconf method so that it will automatically reinstall grub to the correct drive when you upgrade. – psusi Dec 31 '11 at 17:46

I've worked on this problem from the angle that I need to be able to run unattended upgrades from a bash script, and this " Grub boot loader was previously installed to a disk" breaks these.'

At first, I tried to follow the guidelines in the answer above, i.e.

sudo grub-install /dev/sda
sudo update-grub

This, unfortunately, does not solve the problem - next time I do an apt-get dist-upgrade I get the same error, and my upgrade script breaks.

The solution seems to be to run

sudo dpkg-reconfigure grub-pc

and select the correct disk (/dev/sda/) when prompted. In that way, the error does not come back next time I do a dist-upgrade.

share|improve this answer

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.