Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

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

share|improve this answer
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
    
You can accept my answer (I think) if you found it solving the problem. That way we both gain some points on the site :) –  Niclas Nilsson Dec 30 '11 at 21:19
add comment
sudo grub-install /dev/sda

then

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
add comment

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
add comment

Your Answer

 
discard

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.