TL;DR 分区表(?)可能会被包含 NTFS 数据分区和 EXT4 文件系统的驱动器上的 Windows 磁盘管理搞乱。相当肯定零或几乎零数据丢失。 testdisk和其他补救措施都不起作用;现在真的不知道该尝试什么。
有一段时间,我有一个 1TB 驱动器,其中有约 330GB NTFS 数据分区+Windows 恢复分区作为数据驱动器,还有约 660GB 的 ext4 Linux 文件系统。最近,我删除并重新格式化了 Windows 卷。然后我将一些数据传输到该卷中,然后再次将其删除。此后,我尝试启动 Linux 系统,却被未知文件系统踢进 GRUB 救援。启动 Live CD 进行调查后,我在检查文件系统时发现了一些奇怪的结果:运行 fdisk -l 的结果:
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000MX500SSD4
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 02CF7D49-F583-4C04-9795-0455F781C90B
设备起始结束扇区大小类型
/dev/sdb2 660166656 1953523711 1293357056 616.7G Linux filesystem
尝试挂载重新安装GRUB(为什么它认为它是NTFS哈哈):
NTFS signature is missing.
Failed to mount '/dev/sdb2': Invalid argument
The device '/dev/sdb2' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
NTFS signature is missing.
Failed to mount '/dev/sdb2': Invalid argument
The device '/dev/sdb2' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
使用 ext4 显式挂载
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sdb2, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
尝试进行 fsck(尝试了从 mke2fs 获得的每个恢复块,但均无济于事,结果相同)
fsck from util-linux 2.38.1
e2fsck 1.47.0 (5-Feb-2023)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb2
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
试图找出我们认为分区是什么文件系统(wtf LOL)
ubuntu@ubuntu:~$ sudo file -sL /dev/sdb2
/dev/sdb2: OpenPGP Public Key
这(尤其是最后一件事表明它只是读取完全随机的字节)我认为所有这些都指向损坏的文件系统或未对齐/搞砸的分区表。我认为考虑到我从未直接在该分区上执行任何操作而仅在该驱动器上的其他分区上工作这一事实,我认为实际文件系统不太可能发生严重(如果有)损坏,并且没有证据表明存在任何破坏性该驱动器上发生的操作,例如硬格式化。我的猜测是 Windows 不知何故弄乱了分区表(就像经常做的那样),我们试图从错误的偏移量进行解释。
运行了一些文件恢复工具,除了一些垃圾错误解释的文件类型之外,没有得到任何有用的东西。
然后我尝试了测试盘。它最初看到我们在 fdisk 中找到的相同 Linux 文件系统分区,但也完全无法解释文件类型。快速和深入的搜索都没有结果,除了在 NTFS 文件系统和 ext4 文件系统之间的确切转换点出现一些奇怪的错误消息。 (它们与 FAT 相关,FAT 是该驱动器上曾经存在的 Windows 恢复分区的格式,也许这导致了问题(?)我在下面附加了测试磁盘日志。老实说,不确定此时该做什么
Sat Sep 16 04:30:31 2023
Command line: TestDisk
TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <[email protected]>
https://www.cgsecurity.org
OS: Linux, kernel 6.2.0-20-generic (#20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 6 07:48:48 UTC 2023) x86_64
Compiler: GCC 12.2
ext2fs lib: 1.47.0, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.3
User is not root!
Hard disk list
TestDisk exited normally.
Using locale 'C.UTF-8'.
Sat Sep 16 04:30:31 2023
Command line: TestDisk /debug
TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <[email protected]>
https://www.cgsecurity.org
OS: Linux, kernel 6.2.0-20-generic (#20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 6 07:48:48 UTC 2023) x86_64
Compiler: GCC 12.2
ext2fs lib: 1.47.0, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.3
/dev/sda: LBA, HPA, LBA48 support
/dev/sda: size 468862128 sectors
/dev/sda: user_max 468862128 sectors
/dev/sda: native_max 468862128 sectors
/dev/sdb: LBA, LBA48 support
/dev/sdb: size 1953525168 sectors
/dev/sdb: user_max 1953525168 sectors
Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29185 255 63, sector size=512 - KINGSTON SA400S37240G, S/N:50026B7783AA5D9F, FW:SBFKB1H5
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63, sector size=512 - CT1000MX500SSD4, S/N:2031E2BDCD5C, FW:M3CR023
Disk /dev/loop0 - 2372 MB / 2263 MiB - 4634632 sectors (RO), sector size=512
Disk /dev/loop1 - 369 MB / 352 MiB - 722280 sectors (RO), sector size=512
Disk /dev/loop10 - 462 KB / 452 KiB - 904 sectors (RO), sector size=512
Disk /dev/loop11 - 157 MB / 150 MiB - 307552 sectors (RO), sector size=512
Disk /dev/loop12 - 14 MB / 13 MiB - 28120 sectors (RO), sector size=512
Disk /dev/loop2 - 1015 MB / 968 MiB - 1983984 sectors (RO), sector size=512
Disk /dev/loop3 - 253 MB / 242 MiB - 495928 sectors (RO), sector size=512
Disk /dev/loop4 - 4096 B - 8 sectors (RO), sector size=512
Disk /dev/loop5 - 76 MB / 72 MiB - 149488 sectors (RO), sector size=512
Disk /dev/loop6 - 96 MB / 91 MiB - 187776 sectors (RO), sector size=512
Disk /dev/loop7 - 482 MB / 460 MiB - 943256 sectors (RO), sector size=512
Disk /dev/loop8 - 12 MB / 12 MiB - 25240 sectors (RO), sector size=512
Disk /dev/loop9 - 55 MB / 53 MiB - 109032 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 240 GB / 223 GiB - CHS 228936 64 32, sector size=512
Partition table type (auto): EFI GPT
Disk /dev/sdb - 1000 GB / 931 GiB - CT1000MX500SSD4
Partition table type: EFI GPT
Interface Advanced
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953525167 (expected 1953525167)
hdr_lba_start=34
hdr_lba_end=1953525134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
2 P Linux filesys. data 660166656 1953523711 1293357056
Analyse Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953525167 (expected 1953525167)
hdr_lba_start=34
hdr_lba_end=1953525134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
2 P Linux filesys. data 660166656 1953523711 1293357056
search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
check_FAT: Bad jump in FAT partition
check_FAT: Bad number of sectors per cluster
SYSV4 Marker at 37956/138/52
recover_sysv4
0 0000 0000 00 00 00 00 00 00 00 00
Unknown 609771885 717560551858540 717559942086656 [CjSÞ0]
SysV4, 367390 TB / 334139 TiB
0 0000 0000 00 00 00 00 00 00 00 00
Partition not added.
LVM magic value at 64813/225/1
check_FAT: Bad jump in FAT partition
check_FAT: Bad number of sectors per cluster
Results
interface_write()
No partition found or selected for recovery
search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
check_FAT: Bad jump in FAT partition
check_FAT: Bad number of sectors per cluster
SYSV4 Marker at 37956/138/52
recover_sysv4
0 0000 0000 00 00 00 00 00 00 00 00
Unknown 609771885 717560551858540 717559942086656 [CjSÞ0]
SysV4, 367390 TB / 334139 TiB
0 0000 0000 00 00 00 00 00 00 00 00
Partition not added.
LVM magic value at 64813/225/1
check_FAT: Bad jump in FAT partition
check_FAT: Bad number of sectors per cluster
Results
interface_write()
No partition found or selected for recovery
simulate write!
Interface Advanced
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953525167 (expected 1953525167)
hdr_lba_start=34
hdr_lba_end=1953525134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
2 P Linux filesys. data 660166656 1953523711 1293357056
TestDisk exited normally.
在 intel/mbr 模式下,为什么不呢:
Fri Sep 15 20:55:18 2023
Command line: TestDisk
TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <[email protected]>
https://www.cgsecurity.org
OS: Linux, kernel 6.2.0-20-generic (#20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 6 07:48:48 UTC 2023) x86_64
Compiler: GCC 12.2
ext2fs lib: 1.47.0, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.3
User is not root!
Hard disk list
TestDisk exited normally.
Using locale 'C.UTF-8'.
Fri Sep 15 20:55:18 2023
Command line: TestDisk /debug
TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <[email protected]>
https://www.cgsecurity.org
OS: Linux, kernel 6.2.0-20-generic (#20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 6 07:48:48 UTC 2023) x86_64
Compiler: GCC 12.2
ext2fs lib: 1.47.0, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.3
/dev/sda: LBA, HPA, LBA48 support
/dev/sda: size 468862128 sectors
/dev/sda: user_max 468862128 sectors
/dev/sda: native_max 468862128 sectors
/dev/sdb: LBA, LBA48 support
/dev/sdb: size 1953525168 sectors
/dev/sdb: user_max 1953525168 sectors
Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29185 255 63, sector size=512 - KINGSTON SA400S37240G, S/N:50026B7783AA5D9F, FW:SBFKB1H5
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63, sector size=512 - CT1000MX500SSD4, S/N:2031E2BDCD5C, FW:M3CR023
Disk /dev/loop0 - 2372 MB / 2263 MiB - 4634632 sectors (RO), sector size=512
Disk /dev/loop1 - 369 MB / 352 MiB - 722280 sectors (RO), sector size=512
Disk /dev/loop10 - 462 KB / 452 KiB - 904 sectors (RO), sector size=512
Disk /dev/loop11 - 157 MB / 150 MiB - 307552 sectors (RO), sector size=512
Disk /dev/loop12 - 14 MB / 13 MiB - 28120 sectors (RO), sector size=512
Disk /dev/loop2 - 1015 MB / 968 MiB - 1983984 sectors (RO), sector size=512
Disk /dev/loop3 - 253 MB / 242 MiB - 495928 sectors (RO), sector size=512
Disk /dev/loop4 - 76 MB / 72 MiB - 149488 sectors (RO), sector size=512
Disk /dev/loop5 - 4096 B - 8 sectors (RO), sector size=512
Disk /dev/loop6 - 96 MB / 91 MiB - 187776 sectors (RO), sector size=512
Disk /dev/loop7 - 482 MB / 460 MiB - 943256 sectors (RO), sector size=512
Disk /dev/loop8 - 12 MB / 12 MiB - 25240 sectors (RO), sector size=512
Disk /dev/loop9 - 55 MB / 53 MiB - 109032 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 240 GB / 223 GiB - CHS 228936 64 32, sector size=512
Partition table type (auto): EFI GPT
Disk /dev/sdb - 1000 GB / 931 GiB - CT1000MX500SSD4
Partition table type: Intel
Interface Advanced
Geometry from i386 MBR: head=256 sector=63
check_part_i386 1 type EE: no test
1 P EFI GPT 0 0 2 121601 80 63 1953525167
Analyse Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Geometry from i386 MBR: head=256 sector=63
check_part_i386 1 type EE: no test
Current partition structure:
1 P EFI GPT 0 0 2 121601 80 63 1953525167
Warning: Bad ending head (CHS and LBA don't match)
No partition is bootable
search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Results
interface_write()
No partition found or selected for recovery
simulate write!
write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition
Analyse Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Geometry from i386 MBR: head=256 sector=63
check_part_i386 1 type EE: no test
Current partition structure:
1 P EFI GPT 0 0 2 121601 80 63 1953525167
Warning: Bad ending head (CHS and LBA don't match)
No partition is bootable
search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Search for partition aborted
Results
interface_write()
No partition found or selected for recovery
simulate write!
write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition
Partition table type (auto): EFI GPT
Disk /dev/sdb - 1000 GB / 931 GiB - CT1000MX500SSD4
Partition table type: EFI GPT
Interface Advanced
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953525167 (expected 1953525167)
hdr_lba_start=34
hdr_lba_end=1953525134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
2 P Linux filesys. data 660166656 1953523711 1293357056
search_superblock
2 P Linux filesys. data 660166656 1953523711 1293357056
Support for this filesystem wasn't enabled during compilation.
2 P Linux filesys. data 660166656 1953523711 1293357056
Support for this filesystem wasn't enabled during compilation.
gpt_change_part_type
Change partition type:
2 P Linux filesys. data 660166656 1953523711 1293357056
Change partition type:
2 P ext4 660166656 1953523711 1293357056
New options :
Dump : No
Align partition: Yes
Expert mode : Yes
Analyse Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953525167 (expected 1953525167)
hdr_lba_start=34
hdr_lba_end=1953525134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
2 P Linux filesys. data 660166656 1953523711 1293357056
search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
check_FAT: Bad jump in FAT partition
check_FAT: Bad number of sectors per cluster
SYSV4 Marker at 37956/138/52
recover_sysv4
0 0000 0000 00 00 00 00 00 00 00 00
Unknown 609771885 717560551858540 717559942086656 [CjSÞ0]
SysV4, 367390 TB / 334139 TiB
0 0000 0000 00 00 00 00 00 00 00 00
Partition not added.
LVM magic value at 64813/225/1
check_FAT: Bad jump in FAT partition
check_FAT: Bad number of sectors per cluster
Results
Can't open backup.log file: No such file or directory
interface_load
0 0000 0000 00 00 00 00 00 00 00 00
interface_write()
No partition found or selected for recovery
search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
check_FAT: Bad jump in FAT partition
check_FAT: Bad number of sectors per cluster
SYSV4 Marker at 37956/138/52
recover_sysv4
0 0000 0000 00 00 00 00 00 00 00 00
Unknown 609771885 717560551858540 717559942086656 [CjSÞ0]
SysV4, 367390 TB / 334139 TiB
0 0000 0000 00 00 00 00 00 00 00 00
Partition not added.
LVM magic value at 64813/225/1
check_FAT: Bad jump in FAT partition
check_FAT: Bad number of sectors per cluster
Results
0 0000 0000 00 00 00 00 00 00 00 00
interface_write()
No partition found or selected for recovery
simulate write!
Interface Advanced
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953525167 (expected 1953525167)
hdr_lba_start=34
hdr_lba_end=1953525134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
2 P Linux filesys. data 660166656 1953523711 1293357056
search_superblock
2 P Linux filesys. data 660166656 1953523711 1293357056
Support for this filesystem wasn't enabled during compilation.
New options :
Dump : No
Align partition: No
Expert mode : Yes
Analyse Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953525167 (expected 1953525167)
hdr_lba_start=34
hdr_lba_end=1953525134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
2 P Linux filesys. data 660166656 1953523711 1293357056
search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Search for partition aborted
Results
interface_write()
No partition found or selected for recovery
任何帮助表示赞赏!文件系统/文件名是我在该驱动器上拥有的数据中最重要的部分,因此使用像 Photorec 这样的工具确实没有帮助 - 唯一的方法是如果可能的话恢复分区。顶部
答案1
misc/findsuper.c
尝试在 e2fsprogs 源代码树中构建并运行该实用程序。它将扫描整个磁盘并报告它找到的超级块以及分区的预期起始偏移量。
如果您有常规分区,这将工作正常,但如果您使用 LVM 并调整根文件系统的大小,那么它会变得更加复杂。