技术解析
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 挂载成功了,然而里面是空的。
求助怎么处理?