[Sort of] solved Grub2/UEFI problem with 13.*

I`ve spent about two days in a battle with OpenSUSE+Grub2+UEFI and as strange as my results seem - they appear to be solid (for the moment) so I figured I should share with the hope of being helpful to someone in the future.

The victim is Dell Latitude 6520 with A19 BIOS. Has 12GB of RAM, a 240GB SSD as a primary drive (90GB of which is dedicated to Linux) and 1.5T secondary drive. CPU is i5-2520M.
I should mention that the only good reason to even consider fixing UEFI is because I was dumb enough to install Win7 in that mode and don`t feel like reinstalling it now.

My system started as OpenSUSE 12.3 and has been transformed into Factory and later back to 13.1 (or something resembling 13.1) so I`ve had many glitches on the way, including breaking the btrfs root a few times. Snapper was left to defaults so running out of free space was also a normal cause for a system crash at first … but I got it working.
The history is not important in itself but is to show that I am used to the occasional issue, most of the cases my fault - from poking around too much.

That being said, my adventure started with a failed hibernate yesterday - happens from time to time, cause is not clear but could be because I shutdown/reboot only on a system crash and/or kernel update. Next boot didnt last too long and I got some major output in dmesg, caused by btrfs issues. I managed to mount the partition in a live Arch (which doesnt boot in UEFI mode either, but it does boot faster …) and read everything important, but it was painful and involved many segfaults and hangs. BTRFS was broken way beyond repair so I decided to do a clean install of 13.2 and start again, hopefully wiser this time.

And here is where the fun begins - None of the Install/Live/Rescue/Net images would boot via UEFI. I tried them on USB/DVD - nothing. Went back to 13.1 as I consider my old system to be that version - same problem. The laptop would freeze after echoing “loading initial ramdisk”.

I asked google for help and got nowhere … slowly. Finally I decided to try something stupid and boot the LiveCD in x86_64 mode (looking back - perhaps the full installation would have worked just as well, no idea why I didn`t use that one) and forced it to install Grub2-EFI. It did tell me that will not work, but I insisted.
After the instalation I added the entry in BIOS manually and I became a proud owner of a 13.2-RC system.

So far, so good. I restored my home dir, my extra repos (got those from 13.1) and the software I use on a daily basis (Chromium, Emacs, Eclipse - nothing too fancy).

At some point - a VirtualBox package decided it needs a 3.11.6 kernel for some reason and therefore reinstalled the bootloader. On the next reboot my machine froze at the exact same spot - “loading initial ramdisk” and everything but the power button becomes irresponsive.
At that point, I returned to google and poked around some more. The solution I came up with (mostly by accident, due to desperation) was :

1 To boot the Arch image (again - x86_64 mode but it simply loads less stuff and takes less time)
2 mount / and /boot/efi
2 “mount -o bind” of /dev, /proc and /sys
3 chroot
4 yast2 (console mode)
5 bootloader configuration
6 save (to force a reinstall)
7 reboot

Again - my shiny new 13.2 came to life and I figured I should, just in case, do another grub2 reinstall from the proper working environment … We go a few lines back to the unbootable enviroment and fix it with the exact same 7 steps. Since then, I`ve rebooted a few more times and everything is ok. I also hibernated 2-3 times, just to be sure - no issues.

If anyone can provide any ideas on whats happening - Id be eternally grateful, since I assume history will repeat itself every kernel update. Do I appear do be doing something wrong? To this moment I havent managed to boot any 13.* image in UEFI mode. 12.3 boots just fine, every time. I cant establish a reason why reinstalling Grub-EFI from the GUI Yast would be any different than the console.
Hope I have been at least of minor use to anyone out there :slight_smile:

BTRFS is the problem in this case. Apparently in 13.1 grub2 does not know how to write to a BTRFS formatted partition and thus anything that requires such a write fails. A separate non-btrfs boot partition would fix this. I believe that maybe this problem is fixed 13.2 maybe… Not real sure :stuck_out_tongue:

Well … I considered that (mostly because 12.3 would screw up grub every hibernate and would not show the menu again until I reinstall it). To exclude that I did try to boot with no hard drives in the system - absolutely same problem.
And whatever the problem is - it is the same between 13.1 and 13.2 (13.2 RC was the first one I tried to boot, I started going down after that)

Well I’m pretty sure a separate non-btrfs boot partition will fix it.

Might want to report it on the beta forum and see if other still see this problem.

Perhaps reinstalling was a great chance to make a separate boot partition … still - that wouldn`t explain why 13.1/13.2 images hang on boot even when I take both the HDD and SSD out of the machine (and have no partitions to speak of).

Video??? Tried nomodeset?

Can’t see over your shoulder and can’t boot covers a lot.

Yep. Also tried the failsafe option and acpi=off. Basically everything that came out in a search on uefi hangs “loading initial ramdisk”. It appears to be a relatively common issue, some times not fixed, some times fixed with a bios update … some topics just die out with no further info.

Noticed two things - first, when Grub is screwed up (and is going to freeze), I have more hdd activity during POST. Second, after it freezes the battery led would start blinking. Don`t have a good reason for either of those.

The first thing is to find out whether this is grub or kernel. Edit /boot/grub2/grub.cfg and add

echo Finished loading initrd
sleep 10

after line “initrd …” in menu entry you use. This will show whether grub has problems reading initrd.

Initrd does load. Takes notably longer than a normal installation (I tested the 13.2 RC full installation DVD) but I assume that is to be expected. Im a bit short on time so I cant check right now on 13.1 (activity on hdd/dvd is about as long so I assume things are the same).

PS My chrooted-console-repair still stands and I am still posting from my brand-new 13.2 RC :slight_smile: Still no idea why, though …

Well, I generally have no issues with 13.2 as a distro - runs great, hasn`t crashed on me and does what I tell it to do :slight_smile:

As I suspected, when I did a “zypper up” today to install the 3.16.4-9.g7a8842b-desktop kernel, my system reverted to the unbootable state (loads initrd and hangs). Luckily, the fix still holds - I boot a live console Arch in x86_64 mode, chroot, rerun yast2 so it would update grub-efi and I`m back in the game.

Its not really a huge issue as kernels dont come out every day (and I could simply choose not to update them), but if anyone has an idea on how to permanently fix that, I`d be grateful.