1

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!

3
  • Did you try whether the second computer would boot with that ssd at all? A system installed on one machine may not necessarily start on a different hardware.
    – Philippos
    Aug 23, 2021 at 4:42
  • Does the first partition include an appropriate bootloader file in the UEFI removable media/fallback bootloader position? For example, if the first partition is mounted as /boot/efi and 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 (see efibootmgr -v) from the source system to the target system.
    – telcoM
    Aug 23, 2021 at 6:25
  • @telcoM thanks. updated post with new info. I also found a similar post Interestingly few comments in that post mentioned intel NUC which is exactly the 64G SSD source machine I have. I am going to take a closed look at it.
    – perlwle
    Aug 23, 2021 at 16:13

2 Answers 2

1

If you're just trying to move your entire system from a smaller drive to a larger one, try a disk imaging utility. I've had good luck with Clonezilla (https://clonezilla.org/downloads/download.php?branch=stable).

In theory, dd should work, but in practice, there are nuances that might come into play. Easiest way is to use something a little more intelligent than dd.

1
  • Thank you. I am aware of Clonezilla. Will try it if dd doesn't work.
    – perlwle
    Aug 23, 2021 at 16:05
0

With GPT, it is necessary to run gdisk on the target drive once the image has been dumped, and just hit w for write, it will correct some errors, which it will inform you upon write or verify. I do this all the time, so if you copied the image correctly, I am confident, this can resolve your boot problems.

1
  • thanks. gdisk doesn't exist in my live usb(debian) so I will give it a go later. Is there any way to automate it? This disk image will be used as a install media for other computer too.
    – perlwle
    Aug 23, 2021 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.