我有一块 WD Green 2TB 硬盘,以前放在一个带 USB 2.0 接口的外置机箱中。为了提高通信速度,我将其从机箱中取出并通过 SATA 连接到我的电脑。
在此硬盘上,我有一个分区,我 99% 确定文件系统是 EXT3。否则它可能是 EXT2 或 4。在我将其从机箱中取出之前,它运行良好,但现在似乎文件系统已损坏。
当我尝试挂载分区时出现以下错误:
ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /media/wd/
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
我尝试了几种方法来修复和恢复超级块。我阅读了以下相关文章:
- https://ubuntuforums.org/archive/index.php/t-1245536.html
- https://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superblock-in-ubuntu/
- https://www.cyberciti.biz/tips/surviving-a-linux-filesystem-failures.html
- https://www.linuxquestions.org/questions/linux-hardware-18/bad-superblock-how-to-recover-data-346696/
sudo fdisk -l
给出以下输出:
Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdb1 64 3907024895 3907024832 1.8T 83 Linux
Parted 没有表明它找到任何文件系统:
Model: ATA WDC WD20EURX-63T (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 32.8kB 2000GB 2000GB primary
我寻找了如下的备份超级块:
ubuntu@ubuntu:~$ sudo mke2fs -n -S /dev/sdb1
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 488378104 4k blocks and 122101760 inodes
Filesystem UUID: 9e7b7f80-e70c-474a-b889-eff034b72fb0
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
但是,当我使用 检查所有这些备份时sudo e2fsck -b <BLOCK NUMBER> /dev/sdb1
,它们似乎都不起作用。对于所有备份超级块,我都得到了相同的输出:
ubuntu@ubuntu:~$ sudo e2fsck -b 23887872 /dev/sdb1
e2fsck 1.42.13 (17-May-2015)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb1
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>
我也尝试使用 gpart 扫描驱动器,这表明我错了,因为它是一个 ext3 文件系统:
ubuntu@ubuntu:~$ sudo gpart /dev/sdb
Begin scan...
Possible partition(Linux ext2), size(1907726mb), offset(1mb)
End scan.
Checking partitions...
Partition(Linux ext2 filesystem): primary
Ok.
Guessed primary partition table:
Primary partition(1)
type: 131(0x83)(Linux ext2 filesystem)
size: 1907726mb #s(3907022848) s(2048-3907024895)
chs: (0/32/33)-(1023/254/63)d (0/32/33)-(243201/13/12)r
Primary partition(2)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
Primary partition(3)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
Primary partition(4)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
我还尝试过其他方法:
ubuntu@ubuntu:~$ sudo dumpe2fs /dev/sdb1
dumpe2fs 1.42.13 (17-May-2015)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn't find valid filesystem superblock.
ubuntu@ubuntu:~$ sudo fsck /dev/sdb1
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
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/sdb1
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>
有人对我还有什么其他的尝试来恢复我的数据有什么建议吗?
答案1
您的分区表似乎被弄乱了。如果驱动器是使用 7 年左右以前的任何软件进行分区的,则分区应该从扇区 2048 开始,而不是扇区 63。根据 gpart,这确实是您的文件系统的起始位置,因此您需要更正分区表。使用 fdisk 删除并重新创建分区,但起始扇区为 2048。