I have recently cloned the filesystem partition from an HDD to an SSD using dd
. I am quite sure the cloning was successful (because I am using it), but I forgot to clone the boot partition. Since the boot partition does not exist in the SSD, I cannot boot it unless I plug the old HDD as well. Basically, I am using the SSD but the boot partition mounted comes from the HDD. I was initially surprised because I expected to boot the old filesystem partition, but the filesystem partitions' UUIDs are the same, so I guess the first found is the one from the SSD.
The current situation is:
Here the only mounted partition is sdb1
on /boot/efi
(In the picture I manually unmounted it while doing some tests).

I also tried to boot from a live USB, then I plugged the SSD and run boot-repair
but it does not even show the Recommended repair
option. This is the boot info generated:
boot-repair-4ppa2056 [20230427_1948]
============================== Boot Info Summary ===============================
sda: ___________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.2 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sdb: ___________________________________________________________________________
File system: iso9660
Boot sector type: Grub2 (v1.99-2.00)
Boot sector info: Grub2 (v1.99-2.00) is installed in the boot sector of
sdb and looks at sector 0 of the same hard drive for
core.img, but core.img can not be found at this
location.
Mounting failed: mount: /mnt/BootInfo/FD/sdb: /dev/sdb already mounted or mount point busy.
================================ 0 OS detected =================================
================================ Host/Hardware =================================
CPU architecture: 64-bit
Video: Skylake GT2 [HD Graphics 520] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile] from Intel Corporation Advanced Micro Devices, Inc. [AMD/ATI]
Live-session OS is Ubuntu 64-bit (Ubuntu 22.04.2 LTS, jammy, x86_64)
===================================== UEFI =====================================
BIOS/UEFI firmware: F.21(15.33) from Insyde
The firmware is EFI-compatible, and is set in EFI-mode for this live-session.
SecureBoot disabled (confirmed by mokutil).
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 2001,2002,2004
Boot0000* USB Hard Drive (UEFI) - General UDisk PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(2,GPT,a0891d7e-b930-4513-94db-f629dbd637b2,0x92b094,0x2754)RC
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
Partitions info (1/3): _________________________________________________________
Partitions info (2/3): _________________________________________________________
Partitions info (3/3): _________________________________________________________
fdisk -l (filtered): ___________________________________________________________
Disk sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk sdb: 7.5 GiB, 8053063680 bytes, 15728640 sectors
Disk identifier: A0891D7E-B930-4513-94D9-F629DBD637B2
Start End Sectors Size Type
sdb1 64 9613459 9613396 4.6G Microsoft basic data
sdb2 9613460 9623527 10068 4.9M EFI System
sdb3 9623528 9624127 600 300K Microsoft basic data
sdb4 9625600 15728576 6102977 2.9G Linux filesystem
parted -lm (filtered): _________________________________________________________
sda:500GB:scsi:512:4096:loop:ATA CT500MX500SSD1:;
1:0.00B:500GB:500GB:ext4::;
sdb:8053MB:scsi:512:512:gpt:General UDisk:;
1:32.8kB:4922MB:4922MB::ISO9660:hidden, msftdata;
2:4922MB:4927MB:5155kB::Appended2:boot, esp;
3:4927MB:4928MB:307kB::Gap1:hidden, msftdata;
4:4928MB:8053MB:3125MB:ext4::;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda ext4 f8f87223-9d26-4ba6-a4ae-6447cf61605c
sdb iso9660 2023-02-23-04-13-44-00 Ubuntu 22.04.2 LTS amd64
├─sdb1 iso9660 2023-02-23-04-13-44-00 a0891d7e-b930-4513-94d8-f629dbd637b2 Ubuntu 22.04.2 LTS amd64 ISO9660
├─sdb2 vfat F7DB-4D56 a0891d7e-b930-4513-94db-f629dbd637b2 ESP Appended2
├─sdb3 a0891d7e-b930-4513-94da-f629dbd637b2 Gap1
└─sdb4 ext4 20f8183f-4ae7-41e8-a7e7-399cf0b70ff1 a3019bbf-abed-b74d-9444-ac9ebb99d47c writable
Mount points (filtered): _______________________________________________________
Avail Use% Mounted on
/dev/disk/by-label/writable[/install-logs-2023-04-27.0/crash] 2.6G 0% /var/crash
/dev/disk/by-label/writable[/install-logs-2023-04-27.0/log] 2.6G 0% /var/log
/dev/sdb1 0 100% /cdrom
Mount options (filtered): ______________________________________________________
====================== sda/boot/grub/grub.cfg (filtered) =======================
Ubuntu f8f87223-9d26-4ba6-a4ae-6447cf61605c
Ubuntu, with Linux 5.19.0-41-generic f8f87223-9d26-4ba6-a4ae-6447cf61605c
Ubuntu, with Linux 5.19.0-40-generic f8f87223-9d26-4ba6-a4ae-6447cf61605c
Ubuntu, with Linux 5.15.0-71-generic f8f87223-9d26-4ba6-a4ae-6447cf61605c
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
=========================== sda/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=f8f87223-9d26-4ba6-a4ae-6447cf61605c / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=965C-26BF /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda/etc/default/grub (filtered) ========================
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
==================== sda: Location of files loaded by Grub =====================
GiB - GB File Fragment(s)
183.869487762 = 197.428359168 boot/grub/grub.cfg 1
158.846710205 = 170.560356352 boot/vmlinuz 2
158.846710205 = 170.560356352 boot/vmlinuz-5.15.0-71-generic 2
411.003543854 = 441.311694848 boot/vmlinuz-5.19.0-40-generic 1
133.370731354 = 143.205732352 boot/vmlinuz-5.19.0-41-generic 1
133.370731354 = 143.205732352 boot/vmlinuz.old 1
154.984371185 = 166.413201408 boot/initrd.img 4
154.984371185 = 166.413201408 boot/initrd.img-5.15.0-71-generic 4
74.997768402 = 80.528240640 boot/initrd.img-5.19.0-40-generic 2
159.107086182 = 170.839932928 boot/initrd.img-5.19.0-41-generic 1
159.107086182 = 170.839932928 boot/initrd.img.old 1
====================== sda: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18683 Apr 15 2022 10_linux
-rwxr-xr-x 1 root root 43031 Apr 15 2022 10_linux_zfs
-rwxr-xr-x 1 root root 14180 Apr 15 2022 20_linux_xen
-rwxr-xr-x 1 root root 13369 Apr 15 2022 30_os-prober
-rwxr-xr-x 1 root root 1372 Apr 15 2022 30_uefi-firmware
-rwxr-xr-x 1 root root 700 Feb 21 2022 35_fwupd
-rwxr-xr-x 1 root root 214 Apr 15 2020 40_custom
-rwxr-xr-x 1 root root 215 Apr 15 2022 41_custom
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would not act on the boot.
As you can read from the Suggested repair
paragraph, boot-repair
cannot help me. The question is: Can I solve this without cloning the boot partition? I read that the boot partition is not necessary, but copying the files from the boot partition directly into the ssd /boot/efi
folder did not solve the issue. It is probably a silly idea, which is the reason I am posting a new question: I have found many articles/discussions on this topic, but I am completely lost right now. Should I start over and create a new partition where I can clone the boot partition from the HDD? Would that work and would the boot loader find it? Or can I solve this easily (and safely)?