2

I'm running Ubuntu 20.04 on one drive (m.2) and Win10 on another (3.5" SSD). I recently added another m.2 drive to my system and cloned my Win10 system onto it. So here's what my drives look like now, where sda1 and nvme1n1p1 are clones:

root@cantankerous:~# lsblk -f

NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT sda
└─sda1 ntfs 9638B89D38B87E35
nvme1n1
└─nvme1n1p1 ntfs 9638B89D38B87E35
nvme0n1
├─nvme0n1p1 vfat 23FD-2B75 478.1M 6% /boot/efi └─nvme0n1p2 LVM2_member cKt344-wOPa-y34D-j0Wg-y3wq-ZlFz-fIGpnr
├─vgkubuntu-root ext4 27945eb2-45c3-48da-b887-6391111416e3 328.4G 23% / └─vgkubuntu-swap_1 swap 9bdb7f2f-ac7b-4322-ae8e-38c870a190cc [SWAP]

I'd like to get rid of /dev/sda now.

I believe that what I need to do next is use efibootmgr to modify my bootable drives. Right now my EFI files live on the nvme0n1 drive that houses Ubuntu. Here's the output of efibootmgr:

root@cantankerous:~# efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0002,0008,0001
Boot0000* ubuntu        HD(1,GPT,9ab61c6d-62f6-474f-99c4-64eae4e5b595,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0001* Windows Boot Manager  HD(1,GPT,9ab61c6d-62f6-474f-99c4-64eae4e5b595,0x800,0x100000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0002* Hard Drive    BBS(HD,,0x0)..GO..NO........q.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B....................A...........................%8Z.........4..Gd-.;.A..MQ..L.S.4.6.6.N.X.0.K.A.6.2.1.5.9.H........BO..NO........u.S.H.G.P.3.1.-.5.0.0.G.M.-.2....................A.......................................8..Gd-.;.A..MQ..L.C.S.0.9.N.5.2.4.9.1.0.2.0.9.G.3.K........BO..NO........u.S.a.m.s.u.n.g. .S.S.D. .8.5.0. .E.V.O. .2.5.0.G.B....................A.................................>..Gd-.;.A..MQ..L.2.S.5.R.X.N.H.A.0.3.4.9.1.2. .Z. . . . ........BO
Boot0008* Windows m.2   HD(1,GPT,2aba441a-2647-48c4-868c-b4ca31d4f5a3,0x800,0x3a385800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)

I've tried using efibootmgr to create a new bootable entry, but what I can't figure out how to do is specify that, although the EFI image lives on "nvme0", I need it to boot onto "nvme1". I see this being done with /dev/sda with this "bcdobject=([uuid])" but I can't find any information out there about how this is done.

That is, of course, assuming I'm on the right track!

Once that's done I'm assuming os-probe will pick up the new drive and I can integrate it with grub-mkconfig.

Thanks for any help!

Chris C
  • 23

1 Answers1

3

You cannot have duplicate UUIDs or GUID/partUUID that efibootmgr uses.

Disconnect sda, before trying any updates to avoid confusion of which device is which. Some example efibootmgr entries: Sony, HP & others workarounds:

Dual boot Win 8 / Ubuntu loads only Win

You have to use /dev/nvme & correct drive, partition. Like this but check if correct drive/partition, compare GUID in UEFI boot entry and partUUID from lsblk. That will tell which ESP you are using to boot from.

sudo efibootmgr -v
lsblk -o name,mountpoint,label,size,fstype,uuid,partuuid | egrep -v "^loop"

sudo efibootmgr -c -L "Windows Boot Manager" -l "\EFI\Microsoft\Boot\bootmgfw.efi" -d /dev/nvme1n1 -p 1

Grub only boots working Windows. Windows will turn fast start up back on and then grub will not boot it, so best to fix UEFI boot entry to boot Windows directly.

Grub2's os-prober looks for .efi boot files in the ESP to find other installs to boot. It is not using UEFI entries.

oldfred
  • 12,583