Removed /boot and /boot/efi
Hello,
yesterday I upgraded from Fedora 19 to 20beta by fedup --network 20.
The update ran through, took about 2 hours and it upgraded about 3000 packages. So far so good, but the GRUB2-entry of Heisenbug told me that a magic value was wrong after the reboot.
So I booted a previous entry and tried to upgrade grub2-efi with yum upgrade grub2-efi. It said there is a new version, but the installation was not successful. I remounted /boot and /boot/efi as read/writeable and tried again. This time there was another error: "Disk space too low (required 6MB)"
When I installed F19 this year I accepted the values from the installer: /dev/sda1:/boot=200M, /dev/sda2:/boot/efi=500M. I thought this should be enough, but apparently the EFI-partition needs more space (?). So I used fdisk to delete both partitions and created two new: /dev/sda1 with 150M and /dev/sda2 with 550M. This should be enough to hold the new grub2-efi version. Or so I thought.
I knew that I had to reinstall grub2 because I removed the partitions. So I rebooted, started from Fedora 20-DVD but the rescue-environment couldn't automatically fix grub2.
I tried to install Fedora 20 from disk - a fresh install to say. I have 120GB unallocated disk space where I located fedora-root. /home is the same /home as before and the both boot partitions are created automatically. The installation stopped two times with a yum error "no more mirrors to try". It was not connected to the internet, so I don't know why it even tries any mirrors but at least both partitions are created. This time /boot was set to 200M on /dev/sda2 and /boot/efi was set to 500M on /dev/sda1 (switched from prior installation wizard).
I rebooted into rescue-enviroment (from installation DVD) and executed the following commands.
# mount /dev/fedora_pcname/root /mnt/sysimage
# mount /dev/sda2 /mnt/sysimage/boot
# mount /dev/sda1 /mnt/sysimage/boot/efi
# mount -o bind /proc /mnt/sysimage/proc
# mount -o bind /sys /mnt/sysimage/sys
# mount -o bind /dev /mnt/sysimage/dev
# mount -o bind /run/lvm /mnt/sysimage/run/lvm
# chroot /mnt/sysimage
I removed the newest kernel with "rpm -e --nodeps kernel-3.11.8-300..." and reinstalled it with "yum install kernel" and installed grub2 on /dev/sda
# grub2-install /dev/sda
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 2001
Boot0000* UEFI DVD1 PATH1 (...)
Boot0001* UEFI Onboard LAN IPv4
Boot0002* UEFI Onboard LAN IPv6
Boot2001* EFI USB Device
BootCurrent: 0000
Timeout: 0 seconds
BootOrder 0003,2001
Boot0000* UEFI DVD1 PATH1 (...)
Boot0001* UEFI Onboard LAN IPv4
Boot0002* UEFI Onboard LAN IPv6
Boot2001* EFI USB Device
Boot0003* fedora
Installation finished. No error reported.
This sounded good, so I tried grub2-mkconfig
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11.8-300.fc20.x86_64
Found initrd image: /boot/initramfs-3.11.8-300.fc20.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-0f18bb71b2d6400eb098ed7ca633f657
Found initrd image: /boot/initramfs-0-rescue-0f18bb71b2d6400eb098ed7ca633f657.img
done
More information:
# efibootmgr -v ...
I was able to fix it myself (with the massive help of fedoraproject guides and internet searches). I edited my question what I did.
Why can't I comment the answer below? The button is not shown.
I wanted to avoid reinstalling everything to keep my settings. I have some programs in /opt which would be lost by formatting.
A couple points, for posterity: On an efi system, use
/boot/efi/EFI/fedora/grub.cfg
not/boot/grub2/grub.cfg
. Similarly, don't dogrub2-install /dev/sdX
- the system firmware keeps the possible boot entries, we don't need it on the disk MBR.Unfortunately there is no easy to understand tutorial. Fedora keeps several previous kernels and the rescue environment in GRUB2, so I'd like to keep it that way.