Backup method: 1, Backup partition table information sudo fdisk-l >hda.txt # partition Table information redirected output to a file 2, backup Mbr[email protected]:~/ex$sudo dd if=/dev/sda of=mbr bs=512 count=1# input file/dev/sda, output file MBR (own definition), input (out) block size 512 bytes, copy once, because MBR is 512 bytes, so read write to MBR file 1+0 records in1+0 records out512 bytes (512 B) copied,4.0728e-05 sec, 12.6 mb/s [email protected]:~/ex$ ls # view backup successful hda.txt MBR master boot record 512 bytes, first 446 is program code, 64 bytes contains partition table information, The last 2 byte ID is MBR 3, recovery partition table
dd if=mbr of=/dev/sda bs=1 skip=446 count=66 #输入文件mbr, Output/DEV/SDA, block size 1 bytes, input skips 446 bytes, recovers 66 bytes, appears to recover only 66 bytes
If none of the logical partitions are available, then use Fdisk to follow the Hda.txt information again.
In addition, DD can clone the entire hard disk and partition, no matter what type of file system you can, but because of the slow speed, it is generally not recommended, cloning USB stick is recommended, you can also convert the CD-ROM to ISO
Cloning a hard disk
Code:DD IF=/DEV/SDA of=/sda.img
Clone partition
Code:DD if=/dev/sda1 of=/sda1/img
Making a disc image
Code:DD If=/dev/cdrom Of=/cdrom.iso
Backup partition Table MBR