Clonezilla 停止了。“sgdisk -z /dev/sdx”可以销毁 sda 上的所有数据吗?

Clonezilla 停止了。“sgdisk -z /dev/sdx”可以销毁 sda 上的所有数据吗?

我需要建议。我想备份安装了 Win7 的 sda2。我删除了恢复分区。(可能 Testdisk 可以恢复这个分区,因为从那时起我就没有对该区域进行任何操作。)Clonezilla 说:

This disk contains mismatched GPT and MBR partition: /dev/sda
It will confuse Clonezilla and might make the saved image useless or
fail to clone the disk.
You can use gdisk or sgdisk to fix this issue. E.g. if you are sure
only MBR partition table is the one you want, you can run this command
to destroy the GPT partition table while keep the MBR partition table:
sudo sgdisk -z /dev/sdx
//NOTE// (1) Replace /dev/sdx with the above hard drive name. (2) ALL 
EXISTING DATA ON THE DISK WILL BE LOST IF GIVING WRONG COMMAND. USE THIS 
COMMAND CAREFULLY!
Please fix this issue then restart Clonezilla again.

所以我正在考虑执行这个命令,不过在执行此操作之前,我想我应该用 dd 备份 sda,以防万一。我不记得我的笔记本电脑最初是 MBR 还是 GTP 分区表。

Win7 无法启动。我也尝试通过 Windows PE 恢复 Win7 的 MBR 和 PBR。

bootsect /nt60 c: /mbr
bootsect /nt60 c:

两个命令都运行正常。但即便如此,Win7 仍无法启动。/Boot/BCD 和 bootmgr.exe.mui 已经存在。

我打算备份 sda,以便生成的映像包含 sda2 末尾以外的足够区域,

dd if=/dev/sda of=./sda_60G.img bs=32M count=1920 conv=noerror 

(首先我尝试

dd if=/dev/sda bs=32M | lzma > /media/SSD_1/sda.img

,但这需要太长时间。每1GiB大约需要17分钟。)

当我输入命令时

sgdisk -z /dev/sdx

既然如此,sda 上的所有数据是否有可能丢失?如果我用 sgdisk 销毁了 sda 上的所有数据,我可以使用这个 sda_60G.img 恢复我硬盘的当前状态吗?

我阅读了以下问答。

Clonezilla 因 GPT 和 MBR 分区不匹配而无法克隆

进入 gdisk,输入 x 进入专家菜单,输入 p,输入 o,然后输入 q 退出。

我尝试执行该命令。但是出现了以下消息。

# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.5

Caution: invalid main GPT header, but valid backup; regenerating main 
header
from backup!

Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table
instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: damaged

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Your answer:

我应该选择哪一个?如果我选择 2-GPT,
是否有可能 sda 上的所有数据都会丢失?

附加信息。

# fdisk -l /dev/sda

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util
fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 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 identifier: xxxxxxxxxx

Device Boot      Start         End      Blocks   Id  System
/dev/sda1      1250058240  1250263039      102400   83  Linux
/dev/sda2        30926848   109707263    39390208    7  HPFS/NTFS/exFAT

Partition table entries are not in disk order

几天前我已经让这个 sad1 安装了 Grub。

最后,在添加 sda2 后,我尝试复制并粘贴“sgdisk -z /dev/sda”。成功了?sda2 和 sda1 都安全了。

# sgdisk -z /dev/sda

Caution: invalid main GPT header, but valid         
backup; regenerating main header from backup!

Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch!         
Loaded backup partition table
instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

Invalid partition data!
GPT data structures destroyed! 
You may now partition the disk using fdisk or other utilities.

这次 Clonezilla 成功了。我可以获取 sda2 的备份映像。但 Win7 仍然无法启动。我已经发布了这个问题。

检测Win7所需的HDD驱动程序在哪里?

答案1

sgdisk作为或 的替代gdisk,您可以使用fixparts。考虑到您的磁盘配置,它应该可以安全地删除剩余的 GPT 数据,并且由于拼写错误或其他用户错误而造成损坏的风险较小。

即使你使用sgdisk -z不当(例如,使用大写-Z而不是小写-z),它也不会完全地擦除磁盘,只擦除分区表数据。TestDisk 等工具应该能够在发生此类错误后恢复分区。话虽如此,您不应该指望 TestDisk 能够从此类错误中恢复;TestDisk 是最后的手段,因此如果您指望它清除错误而它失败了(有时确实如此),那么您就麻烦大了。

相关内容