1

I have dual boot system(Windows XP and Ubuntu 12.04) that was running fine until an auto-update of grub2 this past week-end.

I had been using the Windows boot loader to choose the O/S, which allowed me to retain the original Microsoft MBR on the hard drive. The setup had grub2 in a /boot partition (/dev/sda3) visible to the system BIOS in the first 137mb. Grub2 had been installed to the PBR in that partition. I had modified the Windows boot.ini file to point to a binary file copied from the /boot pbr, per a procedure whose URL escapes me at the moment, but is well known to dual-booters I believe.

I can run the latest Ubuntu 12.04 live CD and get access to all partitions on the hard drive. I can run fdisl -l and blkid and see all of the particulars of the various partitions. What I am uncertain of is the exact incantation to use to cause grub-install to do only what I want to do to fix up my boot partition, assuming grub-install is indeed the way to go.

Incidentally, I did look at the boot-repair tool and did not see it offering me the option of installing grub to other than the hard drive mbr. My boot partition is /dev/sda3 and the only option boot-repair appeared to permit for grub re-installation was to /dev/sda, rather than /dev/sda3. I take that to mean boot-repair will only install to the MBR, and not the PBR of /dev/sda3, though the menu labels are bit cryptic and I am guessing at meanings here.

I'm thinking the grub-install script is the way to go, but my first attempt produced an error message that suggested it could not find a /boot directory. I suspect the live CD session and its separate file system may be causing confusion about that. I assume there is a specific syntax I should be using to get around that, but am just about at the limit of my know-how.

I hesitate to tinker with syntax or script options and risk irreparably damaging my installation. I would be most appreciative if an expert coder would suggest a grub-install command line that will re-install grub2 on /dev/sda3 when executed from a terminal command line in an Ubuntu 12.04 live CD session. For educational purposes, it would also be nice to have an explanation of the rationale for the specific syntax.

1 Answer 1

1

Mount your / partition in /mnt and your /boot partition in /mnt/boot, then chroot into the system and run dpkg-reconfigure grub-pc and choose the install location from the menu.

sudo -s
mount /dev/sda2 /mnt
mount /dev/sda3 /mnt/boot
for f in dev sys proc dev/pts ; do mount --bind /$f /mnt/$f ; done
chroot /mnt
dpkg-reconfigure grub-pc

You must log in to answer this question.

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