我犯了一个愚蠢的错误,将 *img 文件复制到了我的 /boot/efi 分区而不是 SD 卡上。
System:
Dell XPS15
Kubuntu 19.10
1 TB SSD
我的系统设置为多重启动 Kubuntu 19.10、Kubuntu 20.04 和 Windows 10。我将我的“磁盘”复制到外部 USB 驱动器进行分析。
我尝试使用 testdisk 检查磁盘并且能够看到分区信息:
Current partition structure:
Bad GPT partition, invalid signature.
Trying alternate GPT
1 P EFI System 2048 1026047 1024000 [EFI system partition]
No FAT, NTFS, ext2, JFS, Reiser, cramfs or XFS marker
2 P MS Reserved 1026048 1288191 262144 [Microsoft reserved partition]
2 P MS Reserved 1026048 1288191 262144 [Microsoft reserved partition]
No FAT, NTFS, ext2, JFS, Reiser, cramfs or XFS marker
3 P MS Data 1288192 206043135 204754944 [Basic data partition]
3 P MS Data 1288192 206043135 204754944 [Basic data partition]
4 P Linux filesys. data 206043136 245104639 39061504
5 P Linux filesys. data 245104640 284165186 39060547
6 P Linux filesys. data 284166144 1973938175 1689772032
7 P Windows Recovery Env 1974859776 1998145535 23285760
8 P Windows Recovery Env 1998145536 2000408575 2263040
Backup partition structure
分区信息对我来说是正确的。此时我不确定我应该做什么来尝试恢复我的驱动器。我应该使用哪些工具?我显然已经查看了 testdisk。ddrescue 能帮忙吗?
我要复制的文件大约 500 MB,我(无意中)将其复制到了驱动器的第一个分区上。虽然我是 Linux 的老用户,但我以前从未进行过磁盘恢复。除了使用 dd 对驱动器进行完整备份并运行 testdisk 查看驱动器外,我还没有对其进行任何更改。我的下一步是什么?我应该使用什么工具?
我真的很想至少恢复我的数据分区(上表中的分区 6)。
谢谢您的帮助。
[编辑添加:]我尝试在 testdisk 中列出每个分区的文件,但没有成功(未找到文件)。
我尝试运行 gdisk。它没有看到分区。输出如下:
kubuntu@kubuntu:~$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.5
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: MBR only
BSD: not present
APM: not present
GPT: damaged
Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: 2
Command (? for help): p
Disk /dev/sdb: 3906963456 sectors, 1.8 TiB
Model: My Passport 25E1
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 91626CE4-3C38-4BF1-A7DD-0B4FA3BC3A15
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 3906963422
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 3906961407 1.8 TiB 0700 My Passport
它只看到整个驱动器。