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 Answers 3

26

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

2
  • 1
    And... that did it. Thank you! (If only I'd asked this before spending an hour searching the web.) Dec 30, 2011 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! Dec 30, 2011 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.

1
  • I am not prompted to select a disk when re configuring grib-pc? Feb 23, 2020 at 20:54
5
sudo grub-install /dev/sda

then

sudo update-grub
2
  • You want to use the debconf method so that it will automatically reinstall grub to the correct drive when you upgrade.
    – psusi
    Dec 31, 2011 at 17:46
  • @psusi Can you expand on that with a usage example please? Feb 23, 2020 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .