0

I have two internal SSDs in my computer, one that currently has Ubuntu 20 installed with the following partitioning:

nvme0n1
    │                                                                       
    ├─nvme0n1p1
    │    vfat         EFI                                             
    ├─nvme0n1p2
    │    ext4         /boot                  
    └─nvme0n1p3
         crypto       LUKS                  
      └─luks-long_uuid
         LVM2_m                      
        ├─vgubuntu-root
        │  ext4         /                  
        └─vgubuntu-swap_1
           swap         swap

That work's well with the default bootloader GRUB2

But I want to install a second Ubuntu 20 on my other drive with a detached boot partition (on an usb thumb). The second drive has the following partitioning :

sda                                                                     
    ├─sda1 empty (I will use that later)
    │                                                                       
    ├─sda2 empty (I will use that later)
    │                                                                       
    ├─sda3 empty (I will use that later)
    │                                                                       
    └─sda5
         crypto       LUKS                  
      └─sda5_crypt
         ext4         /

And I installed my boot partition on my USB as follows :

sdc                                                                     
├─sdc1
│    vfat   EFI                                               
├─sdc2
│    ext4         /boot                  
└─sdc3
     ext4         empty

When I install my second ubuntu with ubiquity from a live CD all works well (I can boot with my usb to my SSD) but when I update grub on the previous SSD (nvme0n1) because the previous configuration has been removed by the fresh installation I cannot boot anymore with my usb (but I can boot to the first SSD/nvme0n1)

I tried to install the second ubuntu with or without an EFI partition, with or without a bootloader. But the main point is that when I update grub from the first SSD/nvme0n1 it's not detecting the second ubuntu (os-prober does not find my second OS even if I mounted it)

The ideal situation for me would be to have my EFI and boot partitions on my usb with the rest of my second SSD in my computer, but I could also go for only my boot partition on a USB.

2
  • 1
    You need an ESP on external drive. But Ubuquity installer only installs grub to first ESP it finds. You need to reinstall grub in UEFI boot mode. askubuntu.com/questions/1296065/… Lets see details, use ppa version with your live installer (2nd option) or any working install, not Boot-Repair ISO: Please copy & paste the pastebin link to the Boot-info summary report ( do not post report), do not run the auto fix till reviewed. help.ubuntu.com/community/Boot-Repair
    – oldfred
    Feb 13, 2021 at 14:33
  • I followed the askubuntu you gave to me and followed that answer How do I install Ubuntu to a USB key? and...that's all. It's working now. Just temporarily remove the esp flag from the EFI partition on my first SSD and install grub normally on my second one (with boot and EFI partitions on my USB). Note there is also no problem with update-grub on all disk taken individually
    – Ben W
    Feb 13, 2021 at 18:09

1 Answer 1

1

As pointed out in the comments by @oldfred there is a subtlety with Ubiquity which install Grub only on the first EFI partition it found. A workaround is to remove the esp flag (with gparted for example) of the EFI partition on the primary drive (here the EFI of my main drive is nvme0n1p1).

Then run update-grub while beeing in the chrooted environement of the second drive : in my case it's the unencrypted sda5_crypt luks device mounted on /mnt (for example) in a live Ubuntu OS with the device that will receive the boot partition (here sdc2 with an ext4 fs) mounted on /mnt/boot and the device that will receive the EFI partition (here sdc1 with a vfat fs) mounted on /mnt/boot/efi.

And finally set back the esp flag of the main partition (here nvme0n1p1)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .