デュアルブートラップトップのハードディスクをクローンした後にgrubを復元する方法

デュアルブートラップトップのハードディスクをクローンした後にgrubを復元する方法

500GB SSD を搭載したデュアル ブート (Windows/Linux) ラップトップを使用していましたが、以下の手順で SSD を 1TB SSD に交換しました。再起動すると、grub メニューなしで Windows が直接起動します。なぜこのようなことが起こるのでしょうか。また、grub メニューを復元するにはどうすればよいでしょうか。

私がやったことは以下の通りです:

  1. ライブブートスティック(Linux Mint を実行)からラップトップを起動します。
  2. ddを使用して500GBのSSD全体をネットワークドライブにコピーする
  3. ラップトップをシャットダウンし、SSD を 1GB の SSD に交換します。
  4. ライブ ブートスティックで再度起動し、dd を使用してネットワーク ドライブ上のファイルを SSD にコピーします。
  5. ライブブートスティックなしで再起動する

これにより、新しい SSD の半分が未使用のままになることはわかっています。後で修正したいと思っていました。

dd は正常に動作しました。少なくとも、ブートスティックからライブ パーティションを含むすべてのパーティションをマウントできます。以下は出力ですfdisk -l

Disk /dev/loop0: 1.8 GiB, 1912557568 bytes, 3735464 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


GPT PMBR size mismatch (1000215215 != 1953525167) 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 /dev/nvme0n1: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: KINGSTON SKC2500M81000G                 
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: 282E2059-1738-4156-802F-50E4A4E71652

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048    1026047   1024000   500M EFI System
/dev/nvme0n1p2   1026048    1288191    262144   128M Microsoft reserved
/dev/nvme0n1p3   1288192  205020339 203732148  97.2G Microsoft basic data
/dev/nvme0n1p4 205021184  206086143   1064960   520M Windows recovery environment
/dev/nvme0n1p5 206088192  214087679   7999488   3.8G Linux swap
/dev/nvme0n1p6 214087680  969730047 755642368 360.3G Linux filesystem
/dev/nvme0n1p7 969730048  970651647    921600   450M Microsoft basic data
/dev/nvme0n1p8 970651648  997961727  27310080    13G Windows recovery environment
/dev/nvme0n1p9 997961728 1000204287   2242560   1.1G Windows recovery environment


Disk /dev/mapper/vg-root: 60 GiB, 64424509440 bytes, 125829120 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


Disk /dev/mapper/vg-home: 300.32 GiB, 322462285824 bytes, 629809152 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


Disk /dev/sda: 14.93 GiB, 16008609792 bytes, 31266816 sectors
Disk model: Cruzer Blade    
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: dos
Disk identifier: 0x5b137364

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *          0  3974271  3974272  1.9G  0 Empty
/dev/sda2           632     8567     7936  3.9M ef EFI (FAT-12/16/32)
/dev/sda3       3977216 31266815 27289600   13G 83 Linux

次のコマンドを使用して (ライブ ブートスティックから) grub を再インストールしようとしました。これらのコマンドは、以前の Windows 更新後に grub を復元するのに役立ち、エラーなしで実行されましたが、今回は grub が復元されませんでした。

mount /dev/mapper/vg-root /mnt
mkdir /efi
mount /dev/nvme0n1p1 /efi
grub-install --directory=/mnt/usr/lib/grub/x86_64-efi --boot-directory=/mnt/boot --efi-directory=/efi

問題は、新しいディスクの UUID が異なることによって引き起こされたのでしょうか? 間違っているかもしれませんが、私の知る限り、ディスク UUID はディスク自体に保存されているので、残りのデータと一緒にクローン化されているはずです。では、何が問題なのでしょうか? また、どうすれば grub を再アクティブ化できるのでしょうか?

ハードウェアの詳細は次のとおりです。

ノートパソコン: Dell XPS 15 (9550)

古いSSD: PM951 NVMe SAMSUNG 512GB

新しい SSD: Kingston Technology KC2500 M.2 1000 GB PCI Express 3.0 3D TLC NVMe

Pastebinリンク:http://paste.ubuntu.com/p/DkMGvNXdYq/

関連情報