在分割區“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 永遠不會擦除您沒有告訴它的分區,但可能發生的情況是您在寫入之前按了 Enter 4,然後在按 Enter 後立即添加了 4。在終端機中,如果您的速度快於作業系統的回應,它仍然可能顯示為 sda4。這意味著您已將整個 /dev/sda 歸零,這似乎就是您所經歷的

相關內容