듀얼 부팅 노트북용 하드 디스크를 복제한 후 Grub을 복원하는 방법

듀얼 부팅 노트북용 하드 디스크를 복제한 후 Grub을 복원하는 방법

500GB SSD가 장착된 듀얼 부팅(Windows/Linux) 노트북이 있었고 아래 설명된 절차에 따라 SSD를 1TB SSD로 교체했습니다. 재부팅하면 grub 메뉴 없이 Windows로 직접 부팅됩니다. 왜 이런 일이 발생했으며, 그럽 메뉴를 어떻게 복원할 수 있나요?

이것이 내가 한 일입니다:

  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로 인해 문제가 발생할 수 있습니까? 틀렸을 수도 있지만 AFAIK, 디스크 UUID는 디스크 자체에 저장되므로 나머지 데이터와 함께 복제되어야 합니다. 그렇다면 무엇이 잘못되었을 수 있으며 어떻게 grub을 다시 활성화할 수 있습니까?

다음은 몇 가지 하드웨어 세부정보입니다.

노트북: 델 XPS 15(9550)

기존 SSD: PM951 NVMe 삼성 512GB

새로운 SSD: Kingston Technology KC2500 M.2 1000GB PCI Express 3.0 3D TLC NVMe

페이스트빈 링크:http://paste.ubuntu.com/p/DkMGvNXdYq/

관련 정보