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
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.
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.
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).
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…
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…
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.