dd を使用して SSD を hdd にコピーすると、hdd を起動できません。

dd を使用して SSD を hdd にコピーすると、hdd を起動できません。

2台のコンピュータ間で、64G SSDのUbuntu 20.04を160G HDDにコピーしようとしています。

ddを使用してSSDディスクイメージを作成し、イメージをHDDに復元しました。ただし、HDDを搭載した新しいシステムは、Linuxブートローダより前の起動画面(PCIデバイスのリスト)で停止します。

ディスクイメージ情報です。

~$ 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

SSD情報です。

~$ 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 

修正する

また、ソースマシンで次のコマンドを実行しました。

~$ 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

ターゲットマシンには、ソースマシンと同じ/boot/efi/EFI/コンテンツがあります。

私はこの分野に精通していないので、詳細な説明をいただきありがとうございます。ありがとうございます!

ベストアンサー1

システム全体を小さなドライブから大きなドライブに移動するには、ディスクイメージングユーティリティを使用してみてください。私はClonezillaを使って幸運になりました(https://clonezilla.org/downloads/download.php?branch=stable)。

理論的にはddが機能するはずですが、実際にはわずかな違いが発生する可能性があります。最も簡単な方法は、ddよりもスマートなものを使用することです。

おすすめ記事