Help me recovery GRUB2/EFI partition (with enable Secure Boot Support)

OpenSuse Leap 15.1 (GRUB 2 for EFI)
I use 2 OS in one SSD (1-Windows, 2 OpenSuse)

OpenSUSE
I use LUKS encryption with enable Secure Boot Support, without LVM.

Yesterday I am delete Windows using Windows install DVD (Deleted was 3 partition: Boot partition - 500mb, Windows System Partition, and accidentally boot/efi for my Linux.)
What can I do now?
How to recovery this boot partition?

I am trying in place of Windows install second Linux, and decrypt my linux root partition, but this method not help me. Root partition was decrypt but all data was hiden.
I have partially acces to /boot folder.
https://ibb.co/w6XGnD3

/boot/grub folder
https://ibb.co/JyrHkw9

and some other folders in sum of 5 gb. But in this disk I have 180 gb of data.

It isn’t completely clear what you have. But if only the EFI partition is missing, then you can recreate that.

What do you have available? In particular, do you have the install medium for 15.1 that you could boot to rescue mode? Oh, and you will need to boot that with UEFI booting to recover.

If you don’t have that, then I would suggest the live iso for 15.1.

I’m guessing that you are using “btrfs” for the root partition, and that “/boot” is part of the root partition. But more detailed information would help. If you are using “btrfs”, then part of the root partition would appear to be “hidden” because the “btrfs” subvolumes have not been mounted.

Rough guide on needed actions:

(1) create an EFI partition, properly configured so that your firmware (BIOS) recognizes that it is an EFI partition.
(2) add the needed boot files to the EFI partition. Most of what you need is on the install medium, but you will need to do some editing.
(3) if possible, add an NVRAM boot entry for opensuse-secureboot. You can do this with “efibootmgr” command on the install media or elsewhere.
(4) boot your system. It will probably go into emergency mode because it fails to mount “/boot/efi”. You would need to adjust “/etc/fstab” to fix that.
(5) after fixing “fstab”, reboot into your system, and maybe run Yast bootloader to complete the fix.

I can give more details. But I first need to know more about your system.

It will help if you can post the output from

fdisk -l

or

parted -l

At some stage, we will need the UUID of your root partition. And assuming that’s where you use LUKS encryption, we will also need the UUID of the root file system enclosed in the LUKS container.

https://i.ibb.co/n76071z/IMG-20190612-203332.jpg](https://ibb.co/n76071z)

https://i.ibb.co/KrwYn9Q/IMG-20190612-203448759.jpg](https://ibb.co/KrwYn9Q)

-sda2
-sda3
its new installed OpenSuse

-sda5
-sda6
old OpenSuse

Original deleted EFI partition have UUID=CF8C-AD89.

Does the newly installed openSUSE boot? It it also Leap 15.1? Does it’s boot menu have an entry to boot the old openSUSE?

And what are you goals? Do you want the old openSUSE to be bootable as before? Or do you just want access to the data?

I’ll add that I am surprised to see DOS partitioning used with EFI booting. That’s often done on install media or USB flash drives, but is unusual on hard drives.

Yes, new OpenSuse boot without problem.

Yes. It is the same Suse, installed from the same usb installation stick.

No, Boot menu have not entry to boot the old Suse.

I want only access to the data.

First installed Windows and then Suse.

Then that should be easy (I hope).

From your working system (as root):


cryptsetup luksOpen /dev/sda5 cr_oldsys
  ### you will be prompted for passphrase
mount /dev/mapper/cr_oldsys  /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /boot/efi /mnt/boot/efi

That should get most of your system mounted. But you are probably using “btrfs” and the subvolumes are not mounted. So now do:


chroot /mnt
mount -a
exit

That “exit” only exits the “chroot” session. That should mount the subvolumes. It is possible that you will get an error message, due to the changes in your EFI partition. But I think it will still mount the subvolumes even if there is an error message.

And, at this point, your old system should all be visible under “/mnt”

Please post back if you run into problems (or even if you don’t have problems).

So, after

mount --bind /boot/efi /mnt/boot/efi
I have output:
mount.bin: /mnt/boot/efi: special device /boot/efi does not exist.

and
mount -a
I have output:
mount: /boot/efi: can´t find UUID=CF8C-AD89

But after rebooting I am choose 3th string with name “openSUSE Leap 15.1 (on /dev/mapper/cr-auto-1)”,
then enter passphrase, then second time enter passphrase and…

  0.218041] platform MSFT0101:00: failed to claim resource 1: [mem 0xfed40000-0xfed40fff]
  0218047] acpi MSFT0101:00: platform device creation failed: -16.
Enter root password:

When I enter my root pass, then I have access to my system in BASH. I am proofing, all folders there is.
Thanks man:)!

I don’t know so well BASH commands, so need found a way to start grafical desktop.

Okay. My mistake.

I assumed that your second openSUSE install was also using UEFI for booting. You did say that it uses “sda2” and “sda3”, and “sda2” is your EFI partition. But apparently it is not using UEFI. So skip that particular “–bind” mount.

and

mount -a

I have output:

mount: /boot/efi: can´t find UUID=CF8C-AD89

I did mention that you might get an error message. But your old system should be mounted at that point.

When you have “/dev/sda5” mounted on “/mnt”, you can edit “/mnt/etc/fstab”. And change “CF8C-AD89” to the UUID for you new EFI partition. You can find out what that UUID is, with the command:

blkid /dev/sda2

But after rebooting I am choose 3th string with name “openSUSE Leap 15.1 (on /dev/mapper/cr-auto-1)”,
then enter passphrase, then second time enter passphrase and…

  0.218041] platform MSFT0101:00: failed to claim resource 1: [mem 0xfed40000-0xfed40fff]
  0218047] acpi MSFT0101:00: platform device creation failed: -16.
Enter root password:

You used a boot menu line that would boot your original install. But that fails, probably because of your change to the EFI partition. It might boot correctly if you make that editing change.

I don’t know so well BASH commands, so need found a way to start grafical desktop.

Booting with the first choice for Leap 15.1 (instead of that third choice) should give you a graphic desktop. Then try those suggested mounts again. Actually, just try

mount /dev/sda5 /mnt

and then attempt to edit “/mnt/etc/fstab”. You can probably use:

nano /mnt/etc/fstab

for the editing.

If you are unsure about how to get that UUID, then you can try editing to change
UUID=CF8C-AD89

to

/dev/sda2

Save the editing changes and reboot. Possibly that third line with Leap 15.1 will now boot to a graphic interface.

SOLVED =)
https://i.ibb.co/cC3Hc7J/IMG-20190613-160850-2.jpg](https://ibb.co/cC3Hc7J)

Thank you!

I don’t sure that i can write good resolution for this theme. But I think another people can find some support.

Data was saved, and many many thanks for your help nrickert.](https://forums.opensuse.org/member.php/49759-nrickert)

I’m glad to here that your data is recovered. And thanks for reporting back.