我有一个双启动设置,最近得到了一个新的 SSD,我想将我的 Windows 分区转移到新的驱动器。
Disk /dev/nvme1n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: INTEL SSDPEKNW512G8L
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: C7D99CBF-8EE2-464B-87CA-B6E9DA062ED4
Device Start End Sectors Size Type
/dev/nvme1n1p1 2048 534527 532480 260M EFI System
/dev/nvme1n1p2 534528 567295 32768 16M Microsoft reserved
/dev/nvme1n1p3 567296 367994879 367427584 175.2G Microsoft basic data
/dev/nvme1n1p4 367994880 986656766 618661887 295G Linux filesystem
/dev/nvme1n1p5 986656768 997142524 10485757 5G Microsoft basic data
/dev/nvme1n1p6 998166528 1000214527 2048000 1000M Windows recovery environmen
/dev/nvme1n1p7 997142528 998166523 1023996 500M EFI System
我运行以下 dd 命令将前 3 个分区传输到新磁盘:
sudo dd if=/dev/nvme1n1 of=/dev/nvme0n1 bs=1b count=367994880 status=progress
188362383872 bytes (188 GB, 175 GiB) copied, 3308 s, 56.9 MB/s
367994880+0 records in
367994880+0 records out
188413378560 bytes (188 GB, 175 GiB) copied, 3312.56 s, 56.9 MB/s
然而,分区表似乎存在一些问题,我无法使用 gdisk 解决:
GPT fdisk (gdisk) version 1.0.8
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
Warning! One or more CRCs don't match. You should repair the disk!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
我尝试e
将备份数据结构重新定位到磁盘末尾,但没有成功
Caution: The CRC for the backup partition table is invalid. This table may
be corrupt. This program will automatically create a new backup partition
table when you save your partitions.
Problem: partition 4 is too big for the disk.
Problem: partition 5 is too big for the disk.
Problem: partition 6 is too big for the disk.
Problem: partition 7 is too big for the disk.
Warning! Secondary partition table overlaps the last partition by
23441393 blocks!
You will need to delete this partition or resize it in another utility.
Identified 6 problems!
复制之后这些结果都是正常的
dd
。您不仅复制了前 3 个分区,还复制了整个分区表,包括所有分区的条目。由于实际分区未被复制,因此您必须使用
d
fdisk 或 gdisk 中的命令手动删除这些分区条目。GPT 分区表存在于两个位置:磁盘的开头(主)和磁盘的结尾(备份)。由于您复制了一个,而没有复制另一个,因此新磁盘仅在备份表所在的末尾有垃圾。fdisk 或 gdisk 将在之后修复此问题
e
,然后w
写出分区表(例如,在您修复第一个问题之后)。