首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在分区‘dd` 4’上运行‘`sudo’会导致硬盘上所有分区上的未分配空间

在分区‘dd` 4’上运行‘`sudo’会导致硬盘上所有分区上的未分配空间
EN

Ask Ubuntu用户
提问于 2022-01-20 10:03:52
回答 1查看 102关注 0票数 0

我使用的是Ubuntu20.04,在我的根分区sda4上运行下面的命令之后,我通过live检查了这个分区,它显示了我硬盘上所有分区(不仅仅是sda4)的未分配空间。

有人能指导我实际发生了什么以及我现在如何访问其他分区吗?

sudo dd if=/dev/zero of=/dev/sda4

更新:我运行了命令sudo gdisk -l /dev/sda,它显示如下:

代码语言:javascript
复制
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```
EN

回答 1

Ask Ubuntu用户

发布于 2022-01-20 11:04:44

首先,在您擦除驱动器之后断开驱动器,以防止任何写入操作,并进一步损坏磁盘。

第二:创建驱动器的副本并在副本上执行恢复选项

第三:通过以下https://help.ubuntu.com/community/DataRecovery恢复分区/文件

dd永远不会擦除您没有告诉它的分区,但是可能发生的是在编写4之前按enter,然后在按enter之后添加4个。在终端中,如果您比操作系统响应更快,它仍然可以显示为sda4。这意味着您已经对整个/dev/sda进行了零化,这似乎就是您所经历的。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1388127

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档