Ask Your Question

Removed /boot and /boot/efi

asked 2013-11-23 07:28:09 -0600

mithrial gravatar image

updated 2014-09-12 19:15:01 -0600

mether gravatar image


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

More information:

# efibootmgr -v ...
edit retag flag offensive close merge delete


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.

mithrial gravatar imagemithrial ( 2013-11-24 09:20:19 -0600 )edit

A couple points, for posterity: On an efi system, use /boot/efi/EFI/fedora/grub.cfgnot/boot/grub2/grub.cfg. Similarly, don't do grub2-install /dev/sdX - the system firmware keeps the possible boot entries, we don't need it on the disk MBR.

randomuser gravatar imagerandomuser ( 2013-11-26 21:40:54 -0600 )edit

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.

mithrial gravatar imagemithrial ( 2013-11-27 03:12:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-23 16:41:57 -0600

wilf gravatar image

updated 2013-11-23 16:42:57 -0600

If you still have any data on it, copy it off. Then use a GParted live disk to do frsh reformat of the disk, and then install to it. For the GParted Live Disk, see here:

edit flag offensive delete link more


Thank you, I wanted to keep my data in place. Your answer still works, of course.

mithrial gravatar imagemithrial ( 2013-11-29 15:58:19 -0600 )edit

You can always edit the partions in GParted, most of the time the data will still be there aftwerwards, but not always...

wilf gravatar imagewilf ( 2013-11-29 17:59:01 -0600 )edit

Question Tools

1 follower


Asked: 2013-11-23 07:28:09 -0600

Seen: 3,357 times

Last updated: Nov 24 '13