在分区“sda4”上运行“sudo dd”导致我的硬盘所有分区上都有未分配的空间

在分区“sda4”上运行“sudo dd”导致我的硬盘所有分区上都有未分配的空间

我正在使用 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 归零,这似乎就是你所经历的

相关内容