又作大死了,求助重新恢复硬盘

2017-05-22 00:29:25 +08:00
 colorwin

OS: Ubuntu 16.04

我打算备份系统到我的硬盘里,也是第一次。 然后选择了 dd, 然后看到一条命令:

$ sudo  dd if=/dev/sda of=/dev/sdb

sdb 就是我的硬盘啊,然后我作死地想,如果我直接 dd 到 /dev/sdb 会怎么样呢。 然后我就直接试了。。。。

我有点担心,就 ls 了一下当前目录也就是我的硬盘的根目录,悲催的事情发生了,空了!!!! 赶紧 cancel 掉。然后发现硬盘没有被挂载了。。。。

重启一下看有没有奇迹,什么也没发生。

$ sudo fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: 0x0004cba2

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         4096 104857599 104853504    50G  7 HPFS/NTFS/exFAT
/dev/sda2       104861694 976771071 871909378 415.8G  f W95 Ext'd (LBA)
/dev/sda5       104861696 396363775 291502080   139G  7 HPFS/NTFS/exFAT
/dev/sda6       687867904 699584511  11716608   5.6G 82 Linux swap / Solari
/dev/sda7       699586560 700364799    778240   380M 83 Linux
/dev/sda8       700366848 798021144  97654297  46.6G 83 Linux
/dev/sda9       798023680 976771071 178747392  85.2G 83 Linux

Partition 2 does not start on physical sector boundary.




Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Invalid flag 0x0eeb of EBR (for partition 5) will be corrected by w(rite).
Disk /dev/sdb: 1.4 TiB, 1500267937792 bytes, 2930210816 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
Disklabel type: dos
Disk identifier: 0x0004cba2

Device     Boot     Start        End    Sectors   Size Id Type
/dev/sdb1  *         4096  104857599  104853504    50G  7 HPFS/NTFS/exFAT
/dev/sdb2       104861694  976771071  871909378 415.8G  f W95 Ext'd (LBA)
/dev/sdb5       770403513 3291724251 2521320739   1.2T f4 SpeedStor

貌似我的数据还在。

然后试着手动挂载 sdb, sdb1, sdb2, sdb5。报错

$ sudo mount /dev/sdb test
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.

在装了” nfs-common “之后 sdb 挂载成功了,然而里面是空的。

求助怎么处理?

4954 次点击
所在节点    Linux
25 条回复
okudayukiko0
2017-05-25 14:18:05 +08:00
dd 估计是直接写 LBA 而不是删除文件,被 dd 覆盖的数据估计不能找回,dd 貌似可用来销毁数据。Disk Genius 主要针对 NTFS 等分区,用 DiskGenius 转换 Linux+Windows 的 MBR 到 GPT 结果失败。数据的恢复可以用 EasyRecovery,重要数据请找数据恢复
colorwin
2017-05-26 13:03:36 +08:00
@okudayukiko0 我现在已经格式化了这个硬盘,但是 MBR 损坏了,读不出来硬盘。我尝试在里面安装了一个 ubuntu 系统是可以被引导进入的。现在我只想恢复默认的 MBR,要怎么做呢?
okudayukiko0
2017-05-26 17:06:32 +08:00
MBR 只用于开机,你说的是分区表吧,NTFS 可以用 DiskGenius 恢复分区表。要 Rebuild 分区表,一是重新分区,二是用 Disk Genius 等找回
liuyanjun0826
2017-05-28 19:11:52 +08:00
dd 後並不會實時更新文件列表,所以你不應該 CTRL+C,而且 Linux 也不會實時更新掛載硬盤,你重啓一下就能看到硬盤了。數據丟了就在也找不會來了
redapple0204
2017-06-03 09:02:41 +08:00
我当时就被坑了,还以为 dd 会生成一个备份文件到硬盘里,结果是整个硬盘被清除了....

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/362851

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX