Vagrant: What is the grub-pc?

Created on 28 Jan 2011  ยท  16Comments  ยท  Source: hashicorp/vagrant

I fired up a new box (vagrant 0.6.8) and I was updating the box with aptitude and I get this visual box asking me where to install it?

What is this thing and which option do I have to choose?

Package configuration                                                                                   
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค Configuring grub-pc โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  
 โ”‚ The GRUB boot loader was previously installed to a disk that is no longer present, or whose normally unique       โ”‚  
 โ”‚ identifier has changed for some reason. It is important to make sure that the installed GRUB stays in sync with   โ”‚  
 โ”‚ other components such as 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.                                              โ”‚  
 โ”‚                                                                                                                   โ”‚  
 โ”‚ If you're unsure which drive is designated as boot drive by your BIOS, it is often a good idea to install GRUB    โ”‚  
 โ”‚ to all of them.                                                                                                   โ”‚  
 โ”‚                                                                                                                   โ”‚  
 โ”‚ Note: It is possible to install GRUB to partition boot records as well, and some appropriate partitions are       โ”‚  
 โ”‚ offered here.  However, this forces GRUB to use the blocklist mechanism, which makes it less reliable, and        โ”‚  
 โ”‚ therefore is not recommended.                                                                                     โ”‚  
 โ”‚                                                                                                                   โ”‚  
 โ”‚ GRUB install devices:                                                                                             โ”‚  
 โ”‚                                                                                                                   โ”‚  
 โ”‚    [ ] /dev/sda (42949 MB, VBOX_HARDDISK)                                                                         โ”‚  
 โ”‚    [ ] - /dev/sda1 (41420 MB, /)                                                                                  โ”‚  
 โ”‚                                                                                                                   โ”‚  
 โ”‚                                                                                                                   โ”‚  
 โ”‚                                                      <Ok>

Most helpful comment

The fix I had to use within my chef bootstrap file for Vagrant was...

apt-get -y remove grub-pc
apt-get -y install grub-pc
grub-install /dev/sda # precaution
update-grub 
# now start bootstrapping and upgrading your system packages
apt-get -y upgrade
...

All 16 comments

This is strange. I haven't seen this before. I would simply update Vagrant (to 0.7.0), redownload the latest box, and try again. I have a feeling this may be a strange issue with version compatibility.

Let me know if this helps. Also ,what OS are you on?

Going to close this due to inactivity. I'll happily reopen with more info. :)

Just to answer the questions:

What is this thing ? grub is the bootloader used by most linux distros. It is needed to start the operating system.

Which option do I have to choose ? Use /dev/sda.

(implicit) Why is this happening ? grub needs to install some software at the start of the disk/partition (see /dev/sda). When the package gets an upgrade, dpkg will ask you where to install that upgrade.

Well, that was my stupidity. I was running a RailsReady script published at ChangeLog.com directly in the vagrant VM.

Thought I'd let you guys know that i've seen this start to pop up with the Precise64 box.
There's a grub update that gets installed when you do an apt-get upgrade that causes the above mentioned modal to present itself.

Really plays havoc with my Chef bootstrap file :/

I'm seeing this too on the Precise64 box when I apt-get upgrade...

Choosing /dev/sda seems to allow things to work - I've successfully vagrant halt and vagrant up since running it...

The fix I had to use within my chef bootstrap file for Vagrant was...

apt-get -y remove grub-pc
apt-get -y install grub-pc
grub-install /dev/sda # precaution
update-grub 
# now start bootstrapping and upgrading your system packages
apt-get -y upgrade
...

sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade

was the magic words for me... seems to be an ubuntu problem, maybe apt-chef is the proper place to report it?

After installing grub to /dev/sda all consequent boots get into Memtest and would never go back to the OS itself.

I just got this same issue after running sudo apt-get update && sudo apt-get upgrade with the vanilla precise64 box. Installing GRUB to /dev/sda (the first option, has VBOX_HARDDISK) worked fine. VM rebooted without issues.

Vagrant version: 1.4.3
Output of uname -a in VM: Linux precise64 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Host machine OS X 10.9.1, uname -a: Darwin <redacted> 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
VirtualBox version: 4.3.6 r91406

I am having the same issue with precise64. I am running in gui mode with ubuntu-desktop installed through apt-get, and am updating through the update manager.

The update manager tells me that the disk grub-pc was previously installed on is no longer present, and gives me the option to install it one of three places (/dev/sda VBOX_HARDISK, /dev/sda1, or /dev/dm-0). However, attempts to install in any of those places fail. Update manager gives me the option to continue without installing grub-pc. When I do that, things seem to go through without a problem and restart works.

I don't know what all this means, but it doesn't inspire the greatest confidence . . . that said, it seems to be working. :)

Vagrant version 1.4.3. Host OSX 10.9.1. Virtualbox 4.3.6 r91406.

I had the same problem on a precise64 box after adding apt-get upgrade to the bootstrapping script.
My solution was to use debconf to preconfigure the selection to /dev/sda prior to apt-get update and upgrade.
And after reboot everything worked OK.

echo "set grub-pc/install_devices /dev/sda" | debconf-communicate
apt-get -y -qq update
apt-get -y -qq upgrade

This tutorial was helpful: http://feeding.cloud.geek.nz/posts/manipulating-debconf-settings-on/

Vagrant 1.5.1 VirtualBox 4.3.10 MacOX X 10.9.2

From https://help.ubuntu.com/community/Grub2/Setup, below. Also, It seems that when the grub-pc menu pops up, it indicates the current drive location as "- [drive]", for instance, it will show several options, but the current partition where grub is installed with has a hyphen in front of it.

[ ] /dev/sda (250059 MB; ST9250410AS
[ ] - /dev/sda1 (510 MB; /boot)
[ ] /dev/sda5 (249546 MB; ST9250410AS)

Another way to tell is with #> sudo fdisk /dev/sda (if sda is the primary disk)
Once in fdisk, type 'p' and it will print the partition table. The decide marked bootable is where it's installed. I'm not sure I agree with that statement that it's a good idea to mark them all for installation.

File Structure
GRUB 2 incorporates a totally revised directory and file hierarchy. The menu.lst of GRUB legacy is no longer used.

To find out where GRUB 2 is installed, the user can run the following commands:

Device: sudo grub-probe -t device /boot/grub

UUID: sudo grub-probe -t fs_uuid /boot/grub

From the GRUB 2 menu at boot, the user can also determine which Ubuntu is controlling the boot on a multi-OS system. By default, the first menuentry always lists an option from the installation which is in charge of GRUB 2. For example, if the first menuentry contains "on sda5, then the GRUB installed on sda5 OS is controlling the menu/boot.

echo "grub-pc grub-pc/install_devices multiselect /dev/sda" | sudo debconf-set-selections

Giving a error on techempower/tfb

 default: The following additional packages will be installed:
    default:   aufs-tools cgroupfs-mount libltdl7 pigz
    default: Suggested packages:
    default:   mountall
    default: The following NEW packages will be installed:
    default:   aufs-tools cgroupfs-mount docker-ce libltdl7 pigz
    **default: dpkg-preconfigure: unable to re-open stdin: No such file or directory**

It does say to install to all devices if you're unsure which is what I did.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cbednarski picture cbednarski  ยท  3Comments

hesco picture hesco  ยท  3Comments

lebogan picture lebogan  ยท  3Comments

bbaassssiiee picture bbaassssiiee  ยท  3Comments

janw-me picture janw-me  ยท  3Comments