Repair Bootloader

Hello

I’m completely lost getting my bootloader back. I had some hard-disk problems two days ago. My system overheated and I need to reboot. Afterwards my grub2 only shows only “GRUB C” and stops.

I tried Leap rescue system to recover bootloader I tried the following:


mount /dev/sda2 /mnt/
mount --bind /dev/ /mnt/dev/
mount --bind /proc/ /mnt/proc/
mount --bind /sys/ /mnt/sys/
chroot  /mnt
mount -a -t btrfs
mount /boot/efi

cat /etc/SuSE-release


openSUSE 20160818 (x86_64)
VERSION = 20160818
CODENAME = Tumbleweed
# /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead

fdisk -l


Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F7EDE57D-DC33-4810-8CE8-858F63FD5C23

Device        Start       End   Sectors  Size Type
/dev/sda1      2048    354303    352256  172M EFI System
/dev/sda2    354304  63264767  62910464   30G Microsoft basic data
/dev/sda3  63264768 250068991 186804224 89.1G Microsoft basic data

Disk /dev/sdb: 59.6 GiB, 64023257088 bytes, 125045424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00029f84

Device     Boot  Start       End   Sectors  Size Id Type
/dev/sdb1  *      2048    206847    204800  100M  7 HPFS/NTFS/exFAT
/dev/sdb2       206848 125042687 124835840 59.5G  7 HPFS/NTFS/exFAT

Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DB0629D1-5079-492E-8346-CCA3D937835C

Device     Start        End    Sectors   Size Type
/dev/sdc1   2048 1953523711 1953521664 931.5G Microsoft basic data

Disk /dev/loop0: 43.8 MiB, 45875200 bytes, 89600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop1: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop2: 54.7 MiB, 57344000 bytes, 112000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop3: 14.8 MiB, 15466496 bytes, 30208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop4: 4.1 MiB, 4325376 bytes, 8448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdd: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0cd026cf

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdd1  *     2048 15523839 15521792  7.4G  c W95 FAT32 (LBA)

Disk /dev/sde: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start      End  Sectors  Size Id Type
/dev/sde1        8192 62333951 62325760 29.7G  c W95 FAT32 (LBA)

efibootmgr -v


Timeout: 0 seconds
No BootOrder is set; firmware will attempt recovery

grub2-install --recheck /dev/sda


Installing for x86_64-efi platform.
Installation finished. No error reported.

efibootmgr -v


Timeout: 0 seconds
BootOrder: 0000
Boot0000* opensuse

shim-install /dev/sda


Timeout: 0 seconds
BootOrder: 0001,0000
Boot0000* opensuse
Boot0001* opensuse-secureboot

efibootmgr -v


Timeout: 0 seconds
BootOrder: 0001,0000
Boot0000* opensuse

After rebooting nothing changes still the same picture as before. Anyone can help me to recover the bootloader.

When this happened to me (and it has one more than one occasion) I do the following after booting my Tumbleweed rescue system from my downloaded ISO which I have burned on a DVD.


mount /dev/sdb2 /mnt
mount /dev/sdb1 /mnt/boot/efi
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /run /mnt/run
chroot /mnt
mount -a -t btrfs
update-bootloader --reinit

or 
grub2-install

obviously you will need to select the correct disk, mine was SDB and SDB2 was the root partition and SDB1 was my EFI partition, looks like yours is SDA2 for root but which partition is your EFI one? I have found that it is best to do a grub2-install rather than the update-bootloader --reinit, although it might work for you - who knows.

Stuart

Thanks a lot for you reply. However, I’m quite sure that mounting my partitions is correct. My system is on sda2, efi partition on sda1 and later home on sda3.

I tried almost every iteration of the various commands. I even formated sda1.
When I try to use yast to create bootloader I only get “-no-nvram” not supported.

I tried mounting also /run, which I didn’t by now. However, the result is the same
grub2-install --no-nvram --removable --force --recheck --verbose /dev/sda result of latest try can be found here: http://pastebin.com/jjESDBCs
The result is the same as on this screenshot

Personally I always write to the MBR of the 1st drive
Never had and problems

In order to do this for an EFI boot you must boot the rescue system in EFI mode, I made that mistake once. So make sure when you boot the recovery media it is in EFI mode, on my system both a USB device and DVD/CD can show up with both EFI and non-EFI boot so make sure you select the correct one. Failing that I am out of ideas.

Stuart

This what I do, its sda connected to SATA-1

I boot in EFI mode. Whenever I start I select EFI version of my USB stick

Still clueless how to continue.

kein0r

I think you need to mount your efi partition before you chroot.

mount /dev/sda2 /mnt/
**mount /dev/sda1 /mnt/boot/efi**
mount --bind /dev/ /mnt/dev/
mount --bind /proc/ /mnt/proc/
mount --bind /sys/ /mnt/sys/
chroot  /mnt

Mark

Tried this, also did not worked. Im sad to say that the only thing that at least partially helped was the most stupid workaround known to mankind, that is re-install. Now, if I chose EFI boot in my “BIOS”, I can successfully boot my system. If I just chose the harddisk I get the same strange error as in this picture.

The complete bootloader (re) install thing seems pretty much unstable in opensuse these days.

Hi
Since your using bleeding edge, then a bug report is in order if your not happy.

If you can’t get anything out of efibootmgr after booting your rescue setup, then for sure it’s not booted in efi mode, else it’s a buggy efi BIOS, either way a bug report would be a good starting point.

Believe me I would love to do this. However, I don’t even know what went wrong or which information to provide in the report. The tools always says “No errors reported” at the end it still did not worked.

If you really want to get to the bottom of this in case it all goes pear shaped again I’d start by proving you have your rescue system booted in efi mode so this

$ sudo efibootmgr        

EFI variables are not supported on this system.

should happen if you are NOT in efi mode.

You can also check to see if /sys/firmware/efi exists with data in it. You can also issue efivar -l (if the package is installed) to list the efi variables all of which will be true if you are in efi mode.

Once this can be proved it might be possible to move forward.

Stuart