What is the principle of magical ghost? Is it data replication? The DD command under Linux is not the most powerful data replication tool!
That being the case, why should I use a complex tool like g4l? A DD command can help me achieve any complex image replication and recovery requirements? Whether he is grub, or ext4,btrfs,fat32,ntfs...dd before the equality of all sentient beings. Enter the Linux operating system, open the command line, execute the following command: sudo fdisk-u-l You can view the size and layout of all partitions on all disks. -U, the unit of the number in start and end is 512 bytes, which is the size of a sector sector. Suppose I have a/DEV/SDA disk with a size of 100GB. I have installed an Ubuntu operating system. The following partition is used:/DEV/SDA1 5gb/dev/sda2 1GB Extended partition/dev/sda5 1GB extended partition/dev/sda2 is all extended partitions, its size and/dev/sda5 coincident. /DEV/SDA1 is a file system in EXT4 format. Used to install the Ubuntu operating system. /dev/sda5 is a swap-formatted file system that acts as a swap partition. If I use the mentally g4l tool to make a mirror of the system, I need to back up the entire disk 100GB instead of the 6GB I need. G4L can also back up partitions separately, but when recovering, you need to install GRUB on the target computer and partition it appropriately. Very troublesome! I can use a DD command to generate a 6GB image. The complete system can then be recovered on any hard drive larger than 6GB, including the MBR and 3 partition Sda1,sda2,sda5. specific steps Find a USB flash drive to install the Ubuntulive CD system. "Specifically how to make a USB flash drive boot ubuntulive CD, you can refer to the official Ubuntu website Help." "Ubuntulive CD and windowsPE system are similar, is the CD/u disk boot Ubuntu operating system, do not need to install can be used directly." u disk start, enter the diskUbuntu system, open command line, execute: sudo fdisk-u-l/dev/sda View hardware partitioning. then executes the: DD bs=512 count=[fdisk command with the maximum end number +1] IF=/DEV/SDA of=/ghost.img this way, You can copy all the partition data I need into the ghost.img file. The image production is complete! Then, we can plug the USB stick to other systems, start with a USB stick, enter UBUNTULIVECD, open the command line, execute the following command: DD if=/ghost.img OF=/DEV/SDA After the completion, unplug the USB drive, start the computer, you can see our Linux system has been installed! Note: Do not perform a DD command to generate a mirror image of a local disk after booting the system with a local disk directly on the computer. Instead, you should use LIVECD to start the computer. So the computer is running with a lot of write operations on the system disk. Images generated directly from a running system disk are likely to fail to boot when restored to another hard drive! is the same for non-Linux operating systems using the DD command on Linux for system image backup and recovery, is it simple? for any system, such as windows, even Macs, you can actually use the DD command to backup and restore the system image. because the fdisk command of Linux can recognize the partition format under any system. Fdisk does not relate to file systems on partitions, and even file systems do not care. Fdisk can always report which sectors the partition occupies. The  DD command also does not care about the disk's file system format, it simply copies as many bytes of data as required from the specified location. DD command for mirrored backup and recovery is much simpler and more powerful than ghost software. With Ghost Software, users still need to enterComplex and dangerous disk partitioning operations. and with the two commands of Fdisk and DD, everything is FREE! Compression and decompression The partition we need to back up is large, and the image file generated with the DD command is very large. It is not convenient to store and transfer these images. We can also compress the generated image files using the compression program. Here, I choose to use the GZIP program to work with the DD command. gzip parameter:-C for output to stdout-d represents decompression-1 for the fastest compression-9 means that compression is best used by default-6 compression level. to generate a compressed image file using DD and gzip, you can execute the command: # DD Bs=512count=[fdisk the largest en in the command D number +1] IF=/DEV/SDA | gzip-6 >/ghost.img.gz When restoring, you can execute the following command: # gzip-dc/ghost.img.gz.gz | DD of=/dev/sda Reminder: If you restore the image to another computer, you may find that your network card is eth1, not eth0. This is because the/etc/udev/rules.d/70-persistent-net.rules file registers the network card of the computer that you do mirror as eth0. If your network script handles eth0 and does not process the eth1, you may not be able to surf the web without modifying the network scripts. You might want to delete the/etc/udev/rules.d/70-persistent-net.rules file before you do the mirroring. So when you restore the mirror, the name of the NIC is eth0. will not cause you to be unable to surf the internet on the restored computer.
Clone the entire system using the DD command