Score:2

My /boot/efi is not pointing to the right ESP partition

tm flag

I have a computer with 2 storage devices. I would like to have Windows on one and Linux on the other.

For a variety of reasons, I want them as separate as possible.

I'm using UEFI.

I installed Kubuntu on one device, during the setup, I specified it should be used for the bootloader installation.

But it turns out it has not been. Boot loader has been written to another device.

I've mounted the ESP partition from the other device, copied its content to the ESP partition of the device Kubuntu is installed on, rebooted, in the firmware boot manager, I chose to boot from it, it worked.

Now using mount, I see the /boot/efi is still pointing to the ESP partition on the other device.

I looked at /etc/fstab, it's got one line for /boot/efi, which indicates UUID=931B-CB7F . This UUID doesn't match any of the 2 ESP partition GUID, nor anything returned by blkid.

How can I have /boot/efi point to the ESP partition on the same device as KUbuntu is installed on?

fstab:

/dev/mapper/vg0-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/nvme1n1p1 during installation UUID=df5a10ea-a128-4c35-82f6-207493d101da /boot           ext4    defaults        0       2
# /boot/efi was on /dev/nvme0n1p2 during installation
#UUID=931B-CB7F  /boot/efi       vfat    umask=0077      0       1 

/dev/mapper/vg0-home /home           ext4    defaults        0       2 

/dev/mapper/vg0-swap none            swap    sw              0       0

lsblk -f | grep -v loop:

NAME                FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                                  
nvme0n1                                                                                              
├─nvme0n1p1                                                                                          
└─nvme0n1p2         ntfs                       0E68C51168C4F88B                        877.3G     6% /media/xlp-admin/0E68C51168C4F88B
nvme1n1                                                                                              
├─nvme1n1p1         ext4        1.0            df5a10ea-a128-4c35-82f6-207493d101da      1.5G    13% /boot
├─nvme1n1p2         vfat        FAT32          423D-2695                                             
└─nvme1n1p3         crypto_LUKS 2              1fc50d65-62f7-4513-bbf8-0002ae52b6b2                  
  └─nvme1n1p3_crypt LVM2_member LVM2 001       GNoW1G-nfU6-2yuG-MH2O-QGiC-0wmE-ONHQv8                
    ├─vg0-swap      swap        1              6dfe2158-b779-47b6-83c3-cc2df4474ec0                  [SWAP]
    ├─vg0-root      ext4        1.0            b937a6a3-c62d-445a-9709-348a27a79b57     36.1G    21% /
    └─vg0-home      ext4        1.0            d86b3683-d330-4eaf-a278-d82c34a3685f    849.7G     0% /home

In the meantime, I have installed Windows on the other device. Windows decided to put its bootloader on the Linux device, and while at it, removed the Linux bootloader. I had made a copy before and restored it. But in the process, Windows having failed to install on the other device ESP, I removed it hoping Windows would just create another on the same device.

That lead to Linux not booting anymore, so I commented it out in fstab.

user1532080 avatar
tm flag
UEFI File System partition, aka "EFI Partition".
mook765 avatar
cn flag
Please add the output of `cat /etc/fstab` and `lsblk -f | grep -v loop` via [edit](https://askubuntu.com/posts/1439337/edit) to your question.
user1532080 avatar
tm flag
@David Sorry I just realized, it's not EFS but ESP. Fixed.
mook765 avatar
cn flag
Seems you have destroyed the ESP on `nvme0n1`, only an unformatted empty partition is left. Now you have only the ESP on `nvme1n1` . You can still boot into your installation? If yes, then change the UUID in `/etc/fstab` to the one of `nvme1n1p2` in the `lsblk`-output. Then run `sudo mount -a` and `sudo grub-install` to make sure grub is installed to this partition. I cannot help you fix the Windows part. Of course, you can use GParted to make this empty partition `nvme0n1p1` a valid ESP, but then you still had to install Windows bootloader there.
user1532080 avatar
tm flag
@mook765 Thanks, I think I understood what was disturbing me... the very short UUID... I guess since it's a FAT partition, this "UUID" is actually the partition "serial number" (32 bit integer stored in sector 0 of FAT partition). As far as I understand, Linux can happily boot without access to ESP partition (after all it's ESP that loads kernel, it's loaded prior to it), so yes I could still access. Now I can access, and I have my /boot/efi back. If you'd turn that into an answer, I'd validate it.
Score:3
cn flag

Seems you have somehow destroyed the ESP on nvme0n1 (your Windows drive),I see only an unformatted empty partition nvme0n1p1. Now you have only the ESP on nvme1n1( your linux drive) which is nvme1n1p2.

Since you can still boot into your installation, you just need to change the UUID in /etc/fstab to the one of nvme1n1p2 in the lsblk-output. Then run sudo mount -a and sudo grub-install to make sure grub is completely installed in this partition.

When a system update delivers a new version of grub, you need the partition mounted, otherwise the upgrade will fail.

I cannot help you with the Windows part. Of course, you can use GParted to make this empty partition nvme0n1p1 a valid ESP, but then you still had to install Windows bootloader there, but that's a Windows thing and out of scope here. This link might be helpful.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.