I’ve been travelling internationally a lot, and returned and was then ill for a month and only today decided to boot to my external nvme SSD. I plugged it into my Lenovo X1 Gen-4 carbon, switched on laptop (pressing F12 to get BIOS boot menu), selected the external USB device (legacy boot option), and booted to LEAP. I spotted an update available, which I applied, where I note there was included a kernel update.
After the kernel update I rebooted, but when doing so, there was no Legacy boot option, only a couple UEFI options. Neither would boot the old Lenovo X1 Carbon Gen4 laptop. 
So I switched off the Lenovo X1 Carbon Gen4, and moved the external USB enclosure over to my Lenovo X1 Carbon Gen9. Switched it on, pressed F12 immediately after switch-on, and in the BIOS boot menu, selected the UEFI boot (for the external drive) and it booted fine.
So then I tried to figure out, how do I fix this external SSD (in the external USB enclosure) to get working on the old Lenovo X1 generation 4 laptop (ie boot in legacy mode).
Of course, I could not remember anything of my external SSD setup (a bad memory - product of my now being in my 70s?? ) …
So first thing, check the portioning, when running this external SSD (in UEFI boot mode) from my Lenovo X1 carbon generation 9 laptop:
oldcpu@orico-samsung:~> lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 2M 0 part
├─sda2 8:2 0 2G 0 part /boot/efi
├─sda3 8:3 0 50G 0 part /
└─sda4 8:4 0 879.5G 0 part /home
zram0 254:0 0 7.7G 0 disk [SWAP]
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 260M 0 part
├─nvme0n1p2 259:2 0 16M 0 part
├─nvme0n1p3 259:3 0 78.1G 0 part
├─nvme0n1p4 259:4 0 25.1G 0 part
├─nvme0n1p5 259:5 0 1000M 0 part
├─nvme0n1p6 259:6 0 16.4G 0 part
└─nvme0n1p7 259:7 0 833G 0 part
oldcpu@orico-samsung:~>
Ok. clearly sdax is the external SSD, and nvme0n1px is the internal SSD on my Lenovo X1 carbon gen9.
My memory started to come back. I had setup sda1 as the legacy grub boot partition, and sda1 (/boot/efi) was for the legacy grub boot.
So to confirm I did the following:
oldcpu@orico-samsung:~> sudo fdisk -l /dev/sda
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: RTL9210B-CG
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 2048 bytes
I/O size (minimum/optimal): 2048 bytes / 2048 bytes
Disklabel type: gpt
Disk identifier: EFD96E5B-4200-4D76-ADBC-CDCB9DFD3B49
Device Start End Sectors Size Type
/dev/sda1 2048 6143 4096 2M BIOS boot
/dev/sda2 6144 4200447 4194304 2G EFI System
/dev/sda3 4200448 109058047 104857600 50G Linux filesystem
/dev/sda4 109058048 1953525134 1844467087 879.5G Linux filesystem
oldcpu@orico-samsung:~>
Which confirmed ‘functions’ of sda1 and sda2 in my external SSD setup (where RTL9210B-CG is the external SSD).
I decided to double check the boot that I selected:
verify where /boot/efi is mounted:
oldcpu@orico-samsung:~> mount | grep /boot/efi
/dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
oldcpu@orico-samsung:~>
Where /boot/efi is mounted from /dev/sda2, which is on my external drive. Hence I decided the internal nvme drive will NOT be touched by the following commands that I sent which was to reconfigure GRUB2 for both Legacy BIOS and UEFI :
i.e. I then restored GRUB2 for legacy BIOS boot
sudo grub2-install --target=i386-pc /dev/sda
Then to be certain, I re-installed GRUB2 for UEFI boot (I don’t know if that was necessary as I was already running from a UEFI boot):
sudo grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=opensuse
And finally I regenerated the GRUB configuration
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
But … I asked myself, did it work? Before rebooting for the final test, I decided to send another few commands:
oldcpu@orico-samsung:~> sudo grub2-install --target=i386-pc /dev/sda
[sudo] password for root:
Installing for i386-pc platform.
Installation finished. No error reported.
oldcpu@orico-samsung:~> sudo grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=opensuse
Installing for x86_64-efi platform.
Installation finished. No error reported.
oldcpu@orico-samsung:~> sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-6.4.0-150600.23.78-default
Found initrd image: /boot/initrd-6.4.0-150600.23.78-default
Found linux image: /boot/vmlinuz-6.4.0-150600.23.73-default
Found initrd image: /boot/initrd-6.4.0-150600.23.73-default
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
oldcpu@orico-samsung:~>
Given this is for an external boot USB, I decided I could ignore the warning … (hopefully I was correct).
And then another couple of checks:
oldcpu@orico-samsung:~> sudo dd if=/dev/sda bs=512 count=1 2>/dev/null | strings | grep -i grub
GRUB
oldcpu@orico-samsung:~>
ok … ‘GRUB’ as output suggests legacy boot is in place.
Then a test of the EFI for UEFI boot:
oldcpu@orico-samsung:~> ls -la /boot/efi/EFI/opensuse/
total 3984
drwxr-xr-x 2 root root 4096 Jul 25 18:54 .
drwxr-xr-x 4 root root 4096 Jul 23 17:03 ..
-rwxr-xr-x 1 root root 58 Dec 8 16:06 boot.csv
-rwxr-xr-x 1 root root 345 Dec 8 16:06 grub.cfg
-rwxr-xr-x 1 root root 2082816 Dec 8 16:06 grub.efi
-rwxr-xr-x 1 root root 155648 Dec 8 16:50 grubx64.efi
-rwxr-xr-x 1 root root 852456 Dec 8 16:06 MokManager.efi
-rwxr-xr-x 1 root root 965672 Dec 8 16:06 shim.efi
oldcpu@orico-samsung:~>
All with todays date, which looked good.
So I then shutdown my Lenovo X1 Carbon generation-9 and moved the external SSD enclosure over to my Lenovo X1 Carbon generation-4, switched on that laptop, pressed F12 at start of boot, and in the BIOS boot menu I spotted the legacy boot option was back ! … I choose that, and the Legacy grub boot of the Lenovo X1 Carbon Generation-4 to the external USB SSD openSUSE version worked !!
Next I switched off the Lenovo X1 Carbon Generation-4, and moved the external USB SSD over to my Lenovo X1 Carbon Generation-9, switched it on (immediately pressing F12) and in the BIOS boot menu selected the UEFI boot for the external SSD. And I successfully was able to boot in UEFI mode as well, from the external SSD.
So all is back to normal, but I am puzzled as to how this problem happened.
I assume that the problem I encountered can occur if:
- openSUSE detected UEFI-capable system: The update scripts may have detected that my external drive has a GPT partition table with an EFI partition, assumed I only needed UEFI boot, and only reinstalled the UEFI bootloader ??? and/or
- the grub2-install (that perhaps is part of the kernel update) only ran for UEFI, where the kernel update may have explicitly run grub2-install --target=x86_64-efi only as it spotted the EFI partition?
This is speculation by me. …
I think in future, after every kernel update on this external SSD, I should as a good check (before rebooting) verify both bootloaders are still present by::
1. Check for legacy BIOS bootloader
sudo dd if=/dev/sda bs=512 count=1 2>/dev/null | strings | grep -i grub
and
2. Check for UEFI bootloader
ls /boot/efi/EFI/opensuse/grubx64.efi
If either presents an issue, then before rebooting, run the commands I noted earlier in this post, so not to have a subsequent boot issue.
I am not 100% certain I have all of this correct. I am still a bit ‘under the weather’ due to illness, but I am getting better.