Ask Your Question

# How do I migrate from grub to grub2?

Hello I just attempted the upgrade to FC16 from FC14 via preupgrade on my XP/Linux dual boot, having made sure all the software was up to date in FC14. I left the process loading the 2000 packages, and when I returned I got an ominous message : "Error - your system may not be able to boot", although the upgrade had terminated otherwise sucessfully. With no obvious other option I rebooted anyway.

What I found was legacy grub with two options "Upgrade to Fedora 16 (Verne)" "Other" (which is my windows installation)

but no old kernels or anything. Ouch.

Selecting the "Other" works fine. Selecting "Upgrade to Fedora 16" leads to the error "Error 15: File not found" because it is looking for a kernel in /boot/upgrade and that whole directory is gone. However, in /boot I do see the new kernel, as well as a grub2 directory with what looks like an appropriate /boot/grub2/grub.cfg file, containing entries for the new kernel as well as the windows partition.

So, what I think happened is that the grub2 installation was almost successful, in that it is configured correctly, it just didn't manage to supplant grub as the bootloader. The "Upgrade" option was already executed, meaning I shouldn't have to find that lost kernel, I should just be able to manually move from grub to grub2 and I'm good to go.

However, there are two issues

1. I don't remember if I installed grub to the MBR or to the first linux partition. The partition table (fdisk -l /dev/sda) looks like

Device Boot ID System /dev/sda1 7 HPFS/NTFS/exFAT /dev/sda2 5 Logical /dev/sda3 1c Hidden W95 FAT32 (LBA) /dev/sda4 ef EFI (FAT-12/16/32) /dev/sda5 * 83 Linux /dev/sda6 82 Linux swap/Solaris

(without the sizes, because it is too much to type)
2. Since I have no bootable kernels (thanks preupgrade!) I have to perform this switch using a LiveUSB installation, and doing the appropriate manipulations - do I chroot to the installation or do grub2-install from the live root, etc?

I have perused the various bug reports etc, have tried a few things, but haven't see a definitive answer on how to do a) figure out where I had put the bootloader, MBR or /dev/sda5 and what to do know and b) how to get grub2 working. Is there a clear prescription for either a) or b) or better, both?

edit retag close merge delete

## 2 Answers

Sort by » oldest newest most voted

You have a few solutions to try to upgrade your MBR from grub to grub2.

The Fedora Wiki describes these options, but I will repeat them here.

Since you already have a /boot/grub2 directory you can skip running grub2-mkconfig. If you only see GRUB (and not a Windows boot loader) when you boot I would suggest to go ahead and setup the MBR. You can run the following command without chroot:

# grub2-install /dev/sda


Replace /dev/sda with the hard drive device name, of course.

more

I am in this situation as well but with no easy access to grub2. Tomorrow I plan to fix grub.conf (for the old grub) to point to the new F16 kernel (instead of the now missing preupgrade kernel). Is there anything wrong with just staying with the old grub? My /boot partition is only 200 MB which is probably why grub2 installation failed, and I'm expecting not to be able to install it (and not wanting to download and burn an F16 DVD to find out).

By the way, preupgrade told me how much space to free up in /boot, and I freed up significantly more than that, so it's a real bug that grub2 installation failed. I have no other systems being booted so my situation is very simple, aside from having a small /boot partition.

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2011-12-22 12:29:22 -0500

Seen: 6,070 times

Last updated: Feb 26 '12