I am trying to copy a ubuntu 20.04 on 64G SSD to a 160G HDD between two computers.
I have created the SSD disk image using dd and restored the image to the HDD. However, the new system with HDD stuck on the boot screen(PCI devices listing) before the linux bootloader.
here is the disk image info.
~$ file /mnt/usb/linux.iso
/mnt/usb/linux.iso: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 125045423 sectors, extended partition table (last)
~$ sfdisk -l /mnt/usb/linux.iso
GPT PMBR size mismatch (125045423 != 125045503) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /mnt/usb/linux.iso: 59.64 GiB, 64023298048 bytes, 125045504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: BBF8B52F-C483-418B-9A3C-22A48CEC051A
Device Start End Sectors Size Type
/mnt/usb/linux.iso1 2048 1050623 1048576 512M EFI System
/mnt/usb/linux.iso2 1050624 3147775 2097152 1G Linux filesystem
/mnt/usb/linux.iso3 3147776 125042687 121894912 58.1G Linux filesystem
here is the SSD info.
~$ sudo parted -l
Model: ATA INTEL SSDSCKKR06 (scsi)
Disk /dev/sda: 64.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 boot, esp
2 538MB 1612MB 1074MB ext4
3 1612MB 64.0GB 62.4GB
UPDATE
I have also run the following commands on the source machine:
~$ efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000
Boot0000* ubuntu HD(1,GPT,6931776f-1471-44d8-bd59-29746673cdb1,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)
~$ ls -lR /boot/efi/EFI/
/boot/efi/EFI/:
total 8
drwxr-xr-x 2 root root 4096 Aug 16 14:56 BOOT
drwxr-xr-x 2 root root 4096 Aug 16 14:56 ubuntu
/boot/efi/EFI/BOOT:
total 1860
-rwxr-xr-x 1 root root 954592 Aug 16 14:56 BOOTX64.EFI
-rwxr-xr-x 1 root root 85672 Aug 16 14:56 fbx64.efi
-rwxr-xr-x 1 root root 856232 Aug 16 14:56 mmx64.efi
/boot/efi/EFI/ubuntu:
total 3480
-rwxr-xr-x 1 root root 108 Aug 16 14:56 BOOTX64.CSV
-rwxr-xr-x 1 root root 121 Aug 16 14:56 grub.cfg
-rwxr-xr-x 1 root root 1734528 Aug 16 14:56 grubx64.efi
-rwxr-xr-x 1 root root 856232 Aug 16 14:56 mmx64.efi
-rwxr-xr-x 1 root root 954592 Aug 16 14:56 shimx64.efi
the target machine has the same /boot/efi/EFI/ content as the source machine.
I am not really versed in this area so detail instructions are much appreciated. thanks!
/boot/efiand intended for a x86_64 host, there should be a file with pathname/boot/efi/EFI/boot/bootx64.efi. If such a file is not there, then the disk/image will not be bootable without also copying the UEFI firmware boot variables (seeefibootmgr -v) from the source system to the target system.