13r*_*ren 9 linux usb troubleshooting partitioning usb-flash-drive
这是一个 8 GB Patriot 拇指驱动器,我广泛使用它来处理大量数据。今天检测到了,但是数据全没了:(EDIT至少有部分数据还在,但是分区表没了)
编辑@Sathya(谢谢)这是来自sudo fdisk -l
以下方面的相关输出:
Disk /dev/sdc: 8019 MB, 8019509248 bytes
247 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes
Disk /dev/sdc doesn't contain a valid partition table
Run Code Online (Sandbox Code Playgroud)
看起来它是 /dev/sdc,有 8 GB ......并且没有分区表。
我试图挂载 /dev/sdc (然后dmesg | tail
):
/media> sudo mount /dev/sdc mytmp
mount: wrong fs type, bad option, bad superblock on /dev/sdc,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
/media> dmesg | tail
[ 24.300000] sdc: unknown partition table
[ 24.320000] sd 2:0:0:0: Attached scsi removable disk sdc
[ 24.370000] usb-storage: device scan complete
[ 26.870000] EXT2-fs error (device sdc): ext2_check_descriptors: Block bitmap for group 1 not in group (block 0)!
[ 26.870000] EXT2-fs: group descriptors corrupted!
[ 50.420000] unhashed dentry being revalidated: .DCOPserver_eeepc-brendanma__0
[ 50.430000] unhashed dentry being revalidated: .DCOPserver_eeepc-brendanma__0
[ 50.430000] unhashed dentry being revalidated: .DCOPserver_eeepc-brendanma__0
[ 5565.470000] EXT2-fs error (device sdc): ext2_check_descriptors: Block bitmap for group 1 not in group (block 0)!
[ 5565.470000] EXT2-fs: group descriptors corrupted!
Run Code Online (Sandbox Code Playgroud)
编辑@Col:来自测试盘的结果
Disk /dev/sdc - 8013 MB / 7642 MiB - CHS 1022 247 62
Current partition structure:
Partition Start End Size in sectors
Partition sector doesn't have the endmark 0xAA55
Run Code Online (Sandbox Code Playgroud)
我点击后[proceed]
,它说:
Structure: Ok.
Keys A: add partition, L: load backup, Enter: to continue
Run Code Online (Sandbox Code Playgroud)
“结构:好的。” 似乎令人放心......“A:添加分区”会让我的旧数据可访问(如果它仍然存在),还是会创建一个新的新分区?
另一种选择是“ [ MBR Code ] Write TestDisk MBR code to first sector
” - 这样做会更好吗?
编辑我发现至少我的一些数据仍然在闪存驱动器上,通过使用下面的,并在less中搜索英文文本(如“the”):
cat /dev/sde | tr -cd '\11\12\40\1540-\176' | less
Run Code Online (Sandbox Code Playgroud)
(驱动器从“/dev/sdb”更改为“/dev/sde”,因为我今天连接了一些额外的驱动器)。我了解到“/dev/sde1”将是第一个分区;“/dev/sde”是整个驱动器。因为 unix 将这些设备视为文件,所以您可以对它们使用所有普通的 unix 文件命令,例如cat
,然后像处理任何其他数据流一样处理它们。在tr
上述中移除了不可打印的字符(“\ 40”是空间,这是我希望保留)。在less中,可以使用“/”进行搜索,类似于Vim。
我怎样才能取回我的数据(假设它仍然存在)?如果只是分区表损坏,有没有标准的“分区恢复工具”?有没有办法在不删除所有内容的情况下“重新分区”?