17

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: http://www.livingtheanswer.org/misc/grub.jpg

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...

Thanks!

3 Answers3

26

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

Jorge Castro
  • 71,754
  • 1
    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
7

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.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
5
sudo grub-install /dev/sda

then

sudo update-grub
Marco Ceppi
  • 48,101