![在分区“sda4”上运行“sudo dd”导致我的硬盘所有分区上都有未分配的空间](https://linux22.com/image/1071561/%E5%9C%A8%E5%88%86%E5%8C%BA%E2%80%9Csda4%E2%80%9D%E4%B8%8A%E8%BF%90%E8%A1%8C%E2%80%9Csudo%20dd%E2%80%9D%E5%AF%BC%E8%87%B4%E6%88%91%E7%9A%84%E7%A1%AC%E7%9B%98%E6%89%80%E6%9C%89%E5%88%86%E5%8C%BA%E4%B8%8A%E9%83%BD%E6%9C%89%E6%9C%AA%E5%88%86%E9%85%8D%E7%9A%84%E7%A9%BA%E9%97%B4.png)
我正在使用 Ubuntu 20.04,仅在我的根分区上运行以下命令后sda4
,我通过实时 Ubuntu 检查了 gparted,它显示我的硬盘上所有分区(不仅仅是sda4
)都有未分配的空间。
有人能告诉我到底发生了什么以及我现在如何访问其他分区吗?
sudo dd if=/dev/zero of=/dev/sda4
更新:
我运行了该命令sudo gdisk -l /dev/sda
并显示以下内容:
GPT fdisk (gdisk) version 1.0.4
Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!
Warning: Invalid CRC on main header data; loaded backup partition table.
Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.
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!
Main header: ERROR
Backup header: OK
Main partition table: ERROR
Backup partition table: OK
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: damaged
Found invalid MBR and corrupt GPT. What do you want to do? (Using the
GPT MAY permit recovery of GPT data.)
1 - Use current GPT
2 - Create blank GPT```
答案1
首先,在擦除驱动器后断开驱动器的连接,以防止任何写入操作并进一步损坏磁盘
第二:创建驱动器的副本并在副本上执行恢复选项
第三:按照以下步骤恢复您的分区/文件https://help.ubuntu.com/community/DataRecovery
dd 永远不会擦除你没有告诉它的分区,但可能发生的情况是你在写入之前按下了回车键4
,然后在按下回车键后立即添加了 4。在终端中,如果你的速度比操作系统的响应速度快,它仍然可能显示为 sda4。这意味着你已经将整个 /dev/sda 归零,这似乎就是你所经历的