`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를 누른 다음 4Enter를 누른 직후에 4를 추가하면 일어날 수 있는 일입니다. OS 응답보다 빠르면 터미널에서 여전히 sda4로 표시될 수 있습니다. 이것은 당신이 경험한 것처럼 보이는 전체 /dev/sda를 0으로 설정했음을 의미합니다.

관련 정보