LVM isn't "Linux Virtual Machine", it's "Logical Volume Manager". If I understand LVM correctly, to boot to a root partition on LVM, you need a separate /boot partition outside of the LVM (was that the small partition on /dev/sda2?). Your system may still have this, but if your FC12 installation overwrote it, recovery will be much more difficult.
Here's a couple of links to Grub vs LVM problems: link 1, link 2
Also see "Mounting a Linux LVM volume" -- you should be able to verify that your old FC9 system is still OK by mounting and examining its root partition while booted into FC12. If so, you can probably recover fairly easily, even if you've overwritten the FC9 /boot partition.
Here's an example Grub boot entry for an LVM system (source). In this case, (hd0,0) (meaning /dev/sda1) is a small /boot partition, and the rest of the system resides on an LVM on /dev/sda2. Note the root= and lvm2root= entries on the kernel line:
title Debian GNU/Linux, kernel 2.6.26 Using LVM with SATA Disk
root (hd0,0)
kernel /vmlinuz-2.6.26 root=/dev/ram0 lvm2root=/dev/mapper/sda_vol-root
initrd /initrd-lvm2-2.6.26.gz
Postmortem: This user ended up with the best-case scenario. The FC12 installation didn't overwrite or reformat FC9's /boot partition, /dev/sda2, and all that was needed was to access FC9's old /boot/grub/menu.lst and copy the boot entries into FC12's Grub menu.
Firstly, you will need an EFI-booted linux system. If you still have your original install media (CD/DVD/USB stick), that should usually include an adequate rescue system. It might even have a one-click repair option :).
Alternatively, the Ubuntu community provides an automatic boot-repair image. It claims to support Fedora. If you want to know what it actually does, I suggest you read this third-party explanation in advance.
However I used a general purpose rescue system with console tools. As well as supporting EFI boot, I made sure efibootmgr
is in the list of packages. It happened to be called GRML and was based on Debian. Here's the information about console tools and grub-efi I discovered while rescuing my Fedora system:
When running a Fedora 18 system booted by EFI, do not run grub2-install
. It will claim success, but it breaks the Fedora grub-efi boot system.
The file /boot/EFI/fedora/grub.efi
is installed by the grub-efi package. If you do want to reinstall it, use yum reinstall grub-efi
. (To do this from a generic rescue system, you can do this after mount
ing and chroot
ing into your installed Fedora system). Fedora grub-efi uses the config file /boot/EFI/fedora/grub.cfg
(presumably generated by grubby). Fedora on EFI won't generate a file at /boot/grub2/grub.cfg
. Running grub2-install
will replace grub.efi with an image that tries to read /boot/grub2/grub.cfg
, and will therefore fail.
grub2-install
installs an EFI boot entry for grub.efi
. However if you have not disabled Secure Boot in your Windows 8-certified firmware, this entry will fail to boot. You need to boot shim.efi
instead (ignore shim-fedora.efi
, I'm not sure exactly what that is). See below.
You can lose your EFI boot entry for Fedora if your firmware settings are reset. (Manually, or by firmware upgrade, or because firmware is buggy - the latter has been reported in the wild). Here's how to manually create an EFI boot entry for Fedora with secure boot:
$ sudo efibootmgr -c -L Fedora -d /dev/sda -p 100 -l \\EFI\\fedora\\shim.efi
This example uses partition number 100 on the first standard disk recognized by linux. You should adjust the options -d /dev/sda
and -p 100
to identify the filesystem which Fedora mounts at /boot/efi
. This is an EFI system partition. The Fedora installer will have created a dedicated ESP for your Fedora install to use, separate from the ESPs used by any other operating system. (This is different from Ubuntu and OpenSUSE).
Note the efibootmgr
command requires that you run it from an EFI-booted system.
Best Answer
Luckily the Fedora Wiki covers this topic! Seems you can just reinstall GRUB very easily, just using a live CD.
Boot the system from an installation boot medium. (live CD/USB)
Type linux rescue at the installation boot prompt to enter the rescue environment.
Type chroot /mnt/sysimage to mount the root partition.
Type /sbin/grub-install bootpart to reinstall the GRUB boot loader, where bootpart is the boot partition (typically, /dev/sda). (in your case, sda3 perhaps)
Review the /etc/grub.d/10_linux file, as additional entries may be needed in the /etc/grub.d/40_custom for GRUB to control additional operating systems.
Reboot the system.
These instructions are straight from the Wiki.