This is not yet meant to be the completed guide. It is still work in progress as I document my notes and important links and references. I will update this document once I have gotten all of it sorted out.
Background
This is another of my strange experiments. And another on-going ubuntu experiment and learning experience for me.
My main daily work involves usual office type Windows-based activities. Most of my day-time stuff is using Windows. But at night, I like to play around with Ubuntu.
I have my own laptop for this purpose. It is a Lenovo Thinkpad X1 Carbon 7th Generation. The internal M.2 nvme SSD is occupied by Windows 10 and I don’t wish to remove this, and keep Windows fairly pristine.
However, I do wish to boot into Ubuntu via an external USB SSD – 2.5″ SATA III.
And this is where my problems begin. Hahaha.
The problems
From what I can gather – I am faced with TWO problems:
- Installing Ubuntu on the external SSD does in fact cause some changes to the internal nvme SSD. As a result of this, it causes bitlocker recovery issues.
- Even after dealing with bitlocker, I am unable to boot into Ubuntu from the external SSD even though the drive is visible in laptop’s UEFI boot selection screen.
Problem 1, solved through work around: After much asking on the Lenovo community forums and googling – I was able to find a work around the bitlocker problem (see below recapping what I did and how, second step).
Problem 2, still unresolved:
- I later had lots of difficulties booting the Ubuntu external USB SSD drive.
- As I started the machine, I pressed F12 to go to the UEFI boot menu. I see both the “ubuntu” and “Windows Boot Manager” as well as the USB drives (either flash drive, or SSD as the case may be).
- But selecting “ubuntu”, “Windows Boot Manager” or the USB-SSD drive results in nothing as the screen goes blank momentarily (in some cases, a couple of seconds), and then returns back to the UEFI boot menu.
- Nothing happens, unless I selected the USB flash drive (e.g. Ubuntu live installer, or Boot-repair) – the latter results in a proper boot from the flash drive.
- I posted my problems on the Lenovo community forums too. But to date, I have not received any solution. I have tried multiple different things to solve this problem but to no avail. I am officially now, at complete wits’ ends. lol.
Details of still unresolved Problem 2:
In my post and exchanges with user @pvdeynse on the Lenovo community forums – we seem to suspect the problem is getting the bootloader installed correctly on the external USB SSD. It would appear that the external USB SSD is missing a number of files as follows:
What was in pvdeynse external USB drive:
listing of /dev/sda1 pvdeynse@lenovo:/mnt$ ll /mnt/EFI/ total 32 drwxr-xr-x 4 root root 8192 mei 27 08:32 ./ drwxr-xr-x 5 root root 8192 jan 1 1970 ../ drwxr-xr-x 2 root root 8192 mei 24 19:04 BOOT/ drwxr-xr-x 4 root root 8192 mei 24 19:04 ubuntu/ pvdeynse@lenovo:/mnt$ ll /mnt/EFI/ubuntu/ total 4920 drwxr-xr-x 4 root root 8192 mei 24 19:04 ./ drwxr-xr-x 4 root root 8192 mei 27 08:32 ../ drwxr-xr-x 2 root root 8192 mei 15 17:52 boot/ -rwxr-xr-x 1 root root 108 mei 24 19:04 BOOTX64.CSV* -rwxr-xr-x 1 root root 954576 mei 24 00:13 bootx64.efi* -rwxr-xr-x 1 root root 85672 mei 24 00:13 fbx64.efi* -rwxr-xr-x 1 root root 139 mei 24 19:04 grub.cfg* -rwxr-xr-x 1 root root 1718144 mei 24 19:04 grubx64.efi* -rwxr-xr-x 1 root root 379992 mei 24 00:13 LenovoBT.EFI* -rwxr-xr-x 1 root root 1523 mei 24 00:13 License.txt* drwxr-xr-x 38 root root 8192 mei 19 04:03 microsoft/ -rwxr-xr-x 1 root root 856232 mei 24 19:04 mmx64.efi* -rwxr-xr-x 1 root root 74 mei 24 00:13 ReadMe.txt* -rwxr-xr-x 1 root root 954576 mei 24 19:04 shimx64.efi* pvdeynse@lenovo:/mnt$ ll /mnt/EFI/ubuntu/boot total 2216 drwxr-xr-x 2 root root 8192 mei 15 17:52 ./ drwxr-xr-x 4 root root 8192 mei 24 19:04 ../ -rwxr-xr-x 1 root root 41504 aug 17 2016 acpidump.efi* -rwxr-xr-x 1 root root 284696 apr 30 00:19 boot.efi* -rwxr-xr-x 1 root root 951840 mei 8 22:55 BOOTX64.efi* -rwxr-xr-x 1 root root 85672 mei 7 15:13 fbx64.efi* -rwxr-xr-x 1 root root 856232 mei 7 15:13 mmx64.efi* -rwxr-xr-x 1 root root 18 mei 15 17:52 startup.nsh* pvdeynse@lenovo:/mnt$
This differs significantly compared to what is on my external USB SSD file listing:
ubuntu@ubuntu:/mnt/efi$ ll total 16 drwxr-xr-x 4 root root 4096 May 15 02:32 ./ drwxr-xr-x 3 root root 4096 Jan 1 1970 ../ drwxr-xr-x 2 root root 4096 May 15 02:32 BOOT/ drwxr-xr-x 2 root root 4096 May 15 02:32 ubuntu/ ubuntu@ubuntu:/mnt/efi$ cd ubuntu@ubuntu:~$ cd /mnt ubuntu@ubuntu:/mnt$ ll /mnt/EFI/ total 16 drwxr-xr-x 4 root root 4096 May 15 02:32 ./ drwxr-xr-x 3 root root 4096 Jan 1 1970 ../ drwxr-xr-x 2 root root 4096 May 15 02:32 BOOT/ drwxr-xr-x 2 root root 4096 May 15 02:32 ubuntu/ ubuntu@ubuntu:/mnt$ ll /mnt/EFI/ubuntu/ total 4256 drwxr-xr-x 2 root root 4096 May 15 02:32 ./ drwxr-xr-x 4 root root 4096 May 15 02:32 ../ -rwxr-xr-x 1 root root 108 May 15 02:32 BOOTX64.CSV* -rwxr-xr-x 1 root root 126 May 15 02:32 grub.cfg* -rwxr-xr-x 1 root root 1718144 May 15 02:32 grubx64.efi* -rwxr-xr-x 1 root root 1277024 May 15 02:32 mmx64.efi* -rwxr-xr-x 1 root root 1341560 May 15 02:32 shimx64.efi* ubuntu@ubuntu:/mnt$ ll /mnt/EFI/BOOT/ total 3764 drwxr-xr-x 2 root root 4096 May 15 02:32 ./ drwxr-xr-x 4 root root 4096 May 15 02:32 ../ -rwxr-xr-x 1 root root 1341560 May 15 02:32 BOOTX64.EFI* -rwxr-xr-x 1 root root 1222800 May 15 02:32 fbx64.efi* -rwxr-xr-x 1 root root 1277024 May 15 02:32 mmx64.efi* ubuntu@ubuntu:/mnt$
Some observations:
- there is no directory
/mnt/EFI/ubuntu/boot/ - the files in
/mnt/EFI/ubuntu/ seem incomplete
Any ideas how to fix this properly?
Recap: What I did, and how I went about installing Ubuntu onto the external SSD
I tried a few variations of this. Bear in mind I did a few permutations over many days (part-time too!) to end up with the following current ten steps. Phew!
First step: I created an Ubuntu Live Installer USB flash drive (or thumb drive) using Rufus with the Ubuntu 20.24 LTS iso. I initially created the flash drive using MBR partition tables. Then re-did this by creating the flash drive using the GPT partition tables (current). I didn’t observe anything different with the outcomes.
Second step: I disabled bitlocker in Windows 10 using Option 6 first (because it was graphical and seemed easier), and then Option 4 from the disabling bitlocker quick guide. When I first tried Option 6, rebooting the computer after an earlier Ubuntu install still resulted in the bitlocker recovery issue. So next-time round I executed the Option 4 solution and it seems that bitlocker has been disabled properly.
Third step: I disabled secure boot in the Lenovo UEFI settings screen. I got there by pressing F1 at the computer start up. Why disable secure boot? I read it somewhere that this was needed.
Fourth step: I booted the Ubuntu Live Installer USB flash drive, by pressing F12 at the computer start up, while the external SSD was plugged in.
Fifth step: After the Ubuntu Live Installer started up – instead of installing Ubuntu, I opted “Try Ubuntu” (ie. without installing).
Sixth step: In the “Try Ubuntu” desktop – I opened gparted and did two things:
- removed the
bootandespflags from the Windows internal nvme EFI disk partition (this is to avoid Ubuntu live installer from installing the boot loader onto the nvme EFI disk partition as apparently it tends to do. Reference: Tim Richardson’s answer to “How do I install Ubuntu to a USB key? (without using Startup Disk Creator)” on 14 July 2018 - created the partitions in the external SSD: 500MB EFI partition (sda1), swap partition (sda2), and the root ext4 journaling partition (sda3). Reference: How To Create A Truly Portable Ubuntu Installation On An External USB HDD Or SSD
Initially, before I started removing the boot and esp flags from the Windows internal nvme EFI partitions, the Ubuntu Live Installer kept installing the boot loader onto the internal nvme (Windows) even though I specifically selected to be installed on the external SSD (Ubuntu). I had all sorts of Grub problems including the grub black screen of death – which I had to fix by following the guide at Fix Minimal BASH like line editing is supported GRUB Error In Linux.
Seventh step: After step six, I proceeded to start the Ubuntu installation process. Most of the installation steps were straight forward following the recommendations except at the install locations: for some reason, the Ubuntu Live Installer recognizes the internal nvme as Ubuntu instead of Windows – and I have not figured out why, yet (this may be a clue to my problems). I tried multiple options:
- erase disk – but selected the external SSD (sda) and not install onto the internal nvme (nvme)
- install along side Ubuntu – but selected the external SSD (sda) and not install onto the internal nvme (nvme)
- “something else” and installed on the external SSD (sda) and on the relevant partitions, plus installing the bootloader onto sda
Eight step: re-store he boot and esp flags from the Windows internal nvme, by booting again into the Ubuntu Live Installer and “Try Ubuntu” again, and do the gparted configuration.
Ninth step: Shut down and boot with the external USB SSD connected, but not successful.
Tenth step: Booted the computer using a USB flash drive with boot-repair. I didn’t do any boot repairs at this point, but instead created the boot-repair report to provide further details of my boot details and configuration for others to help problem-solve: http://paste.ubuntu.com/p/yvK6vKfCfb/
Various website references, I used during this time trying to problem solve:
How To Create a Truly Portable Ubuntu Installation on an External USB HDD or SSD
How to Install Ubuntu 18.04 LTS (Bionic Beaver) on UEFI and Legacy BIOS System
Use Linux efibootmgr Command to Manage UEFI Boot Menu
How do I check where devices are mounted?
How to install Grub in an external hard drive?
Fix Minimal BASH like line editing is supported GRUB Error In Linux
For anyone else with EFI file system that was getting this error-
error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn’t exist. Please specify –target or –directory
try running the following command first:
sudo apt install grub-efi
then you can try this command again (from the last the uefi step before reboot):
sudo grub-install –boot-directory=/mnt/boot –bootloader-id=ubuntu –target=x86_64-efi –efi-directory=/mnt/boot/efi
More technical stuff:
I checked the efibootmgr list on my computer and the results are as follows:
fazz27@fazz27-ThinkPad-X1-Carbon-7th:~$ efibootmgr BootCurrent: 001F Timeout: 0 seconds BootOrder: 0001,0000,0019,001A,001B,001C,001D,001E,001F,0020,0021,0022,0023,0024,0002 Boot0000* Windows Boot Manager Boot0001* ubuntu Boot0002* Linux-Firmware-Updater Boot0010 Setup Boot0011 Boot Menu Boot0012 Diagnostic Splash Screen Boot0013 Lenovo Diagnostics Boot0014 Regulatory Information Boot0015 ThinkShield secure wipe Boot0016 Startup Interrupt Menu Boot0017 Rescue and Recovery Boot0018 MEBx Hot Key Boot0019* USB CD Boot001A* USB FDD Boot001B* NVMe0 Boot001C* NVMe1 Boot001D* ATA HDD0 Boot001E* ATA HDD1 Boot001F* USB HDD Boot0020* PXE BOOT Boot0021* HTTPS BOOT Boot0022* LENOVO CLOUD Boot0023 Other CD Boot0024 Other HDD Boot0025* IDER BOOT CDROM Boot0026* IDER BOOT Floppy Boot0027* ATA HDD Boot0028* ATAPI CD
Earlier Boot-repair details:
https://paste.ubuntu.com/p/ysmHSVnXwm/
http://paste.ubuntu.com/p/VyZBhYyYBc/
boot.repair@gmail.com