Bor*_*ion 20 mount ext4 hard-drive data-recovery
我在安装恢复映像时遇到问题。我尝试以多种方式安装图像。
quark@DS9 ~ $ sudo mount -t ext4 /media/jump1/1recover/sdb1.img /mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
quark@DS9 ~ $ sudo mount -r -o loop /media/jump1/1recover/sdb1.img recover
mount: you must specify the filesystem type
quark@DS9 ~ $ sudo mount /media/jump1/1recover/sdb1.img mnt
mount: you must specify the filesystem type
Run Code Online (Sandbox Code Playgroud)
它甚至没有提供我刚刚制作的文件的详细信息,nautilus 说它是 160GB。
quark@DS9 ~ $ file /media/jump1/1recover/sdb1.img
/media/jump1/1recover/sdb1.img: data
quark@DS9 ~ $ mmls /media/jump1/1recover/sdb1.img
Cannot determine partition type
Run Code Online (Sandbox Code Playgroud)
我不确定我做错了什么,或者我是否从一开始就错误地开始了这个过程。我已经在下面概述了我到目前为止所做的事情。我一无所知,如果有人为我提供一些意见,我将不胜感激。
我的笔记本电脑有两个硬盘。
一个有双启动Win7/Linux Mint系统文件。第二个包含我的 /home 文件夹。
笔记本电脑受到震动,/home 磁盘损坏。我尝试了 LiveCD 恢复,但失败了。甚至不会在安装了磁盘的情况下加载 Live 会话。所以我转向ddrescue。
quark@DS9 ~ $ sudo fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009fc18
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 112642047 56320000 7 HPFS/NTFS/exFAT
/dev/sda2 138033152 312580095 87273472 83 Linux
/dev/sda3 112644094 138033151 12694529 5 Extended
/dev/sda5 112644096 132173823 9764864 83 Linux
/dev/sda6 132175872 138033151 2928640 82 Linux swap / Solaris
Partition table entries are not in disk order
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002a8ea
Device Boot Start End Blocks Id System
/dev/sdb1 * 63 312576704 156288321 83 Linux
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xed6d054b
Device Boot Start End Blocks Id System
/dev/sdc1 63 1953520064 976760001 7 HPFS/NTFS/exFAT
Run Code Online (Sandbox Code Playgroud)
从这个网站,https://apps.education.ucsb.edu/wiki/Ddrescue
我使用这个脚本来创建损坏的硬盘驱动器的图像。我将目的地更改为外部 USB 驱动器。
#!/bin/sh
prt=sdb1
src=/dev/$prt
dst=/media/jump1/1recover/$prt.img
log=$dst.log
sudo time ddrescue --no-split $src $dst $log
sudo time ddrescue --direct --max-retries=3 $src $dst $log
sudo time ddrescue --direct --retrim --max-retries=3 $src $dst $log
Run Code Online (Sandbox Code Playgroud)
一切看起来都很顺利:
quark@DS9 ~ $ sudo bash recover1
Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued: 0 B, errsize: 0 B, errors: 0
Current status
rescued: 160039 MB, errsize: 4096 B, current rate: 35588 B/s
ipos: 3584 B, errors: 1, average rate: 22859 kB/s
opos: 3584 B, time from last successful read: 0 s
Finished
12.78user 1060.42system 1:56:41elapsed 15%CPU (0avgtext+0avgdata 4944maxresident)k
312580958inputs+0outputs (1major+601minor)pagefaults 0swaps
Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued: 160039 MB, errsize: 4096 B, errors: 1
Current status
rescued: 160039 MB, errsize: 1024 B, current rate: 0 B/s
ipos: 1536 B, errors: 1, average rate: 13 B/s
opos: 1536 B, time from last successful read: 1.3 m
Finished
0.00user 0.00system 3:43.95elapsed 0%CPU (0avgtext+0avgdata 4944maxresident)k
238inputs+0outputs (3major+374minor)pagefaults 0swaps
Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued: 160039 MB, errsize: 1024 B, errors: 1
Current status
rescued: 160039 MB, errsize: 1024 B, current rate: 0 B/s
ipos: 1536 B, errors: 1, average rate: 0 B/s
opos: 1536 B, time from last successful read: 3.7 m
Finished
0.00user 0.00system 3:43.56elapsed 0%CPU (0avgtext+0avgdata 4944maxresident)k
8inputs+0outputs (0major+376minor)pagefaults 0swaps
Run Code Online (Sandbox Code Playgroud)
看起来,从我站着的地方看,它工作得很好。这是日志:
# Rescue Logfile. Created by GNU ddrescue version 1.14
# Command line: ddrescue --direct --retrim --max-retries=3 /dev/sdb1 /media/jump1/1recover/sdb1.img /media/jump1/1recover/sdb1.img.log
# current_pos current_status
0x00000600 +
# pos size status
0x00000000 0x00000400 +
0x00000400 0x00000400 -
0x00000800 0x254314FC00 +
Run Code Online (Sandbox Code Playgroud)
我不知道如何继续。这是否意味着我的所有数据都丢失了???????
感谢任何输入!
我找到了解决方案,并且因为错过了这个而感到有点愚蠢。非常感谢你们的回复!
我检查了图像是否有错误,然后安装没有问题!
sudo fsck -y /dev/sda2/backup.img
Run Code Online (Sandbox Code Playgroud)
它修复了错误,然后安装没有问题:
sudo mount /dev/sda2/backup.img /mnt/recoverydata
Run Code Online (Sandbox Code Playgroud)
您创建的映像将包含原始磁盘的所有故障。因此,您可能无法安装或读取它。继续的方法是将此图像加载到您最喜欢的数据恢复工具中。
我们在Testdisk/PhotoRec方面有很好的经验,但还有其他值得一提的工具,例如 Foremost。
也可以看看:
小智 5
这是我在类似情况下必须做的事情 - 以防有人像我一样偶然发现这个问题。
我的图像也无法安装,产生相同的错误(坏超级块)。但是,fsck 也失败并出现以下错误:
fsck from util-linux 2.20.1
e2fsck 1.42 (29-Nov-2011)
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /mnt/download/rescue.img
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
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>
Run Code Online (Sandbox Code Playgroud)
阅读完DataRecovery(Takkat 提供的链接,谢谢!)后,我尝试了以下方法并且成功了:
apt-get install sleuthkit
mmls /path/to/image
Run Code Online (Sandbox Code Playgroud)
这产生了以下输出:
DOS Partition Table
Offset Sector: 0
Units are in 512-byte sectors
Slot Start End Length Description
00: Meta 0000000000 0000000000 0000000001 Primary Table (#0)
01: ----- 0000000000 0000000062 0000000063 Unallocated
02: 00:00 0000000063 2930272064 2930272002 Linux (0x83)
03: ----- 2930272065 2930277167 0000005103 Unallocated
Run Code Online (Sandbox Code Playgroud)
然后我将 63 乘以 512 得到 32256 并安装图像,如下所示:
mount -o loop,offset=32256 /path/to/image /mnt/temp
Run Code Online (Sandbox Code Playgroud)
我希望这对其他人也有帮助。