Using DD to backup your drive
This post was last updated on July 9th, 2020 at 03:47 pm
How to backup your hard drive (the type of format doesn’t matter) using dd.
Boot to some rescue mode by using the install media (generally “linux rescue”) otherwise enter rescue mode manually: //www.explorelinux.com/recovery.html
Make sure not to be booted to your hard drive, nor to have any of those partitions mounted.
Now use any combination of dd, ssh or rsh, gzip or bzip2 to backup the drive (I recommend using ssh versus rsh; however, ssh is generally not available during the rescue mode, whereas rsh is available):
You can backup the whole drive (if you have enough space on your destination system) as follows (This method also grabs the MBR):
dd if=/dev/sda | rsh [email protected] “gzip -9 >20030220-backup-sda.dd.gz”
A restore using this method would be as follows:
rsh [email protected] “cat 20030220-backup-sda.dd.gz | gunzip” | dd of=/dev/sda
To backup individual partitions, be sure to grab the MBR because it contains the partition table, as well as any partitions you want to backup:
A restore would go as follows – be sure to restore the MBR, reboot, then restore the other partitions.
rsh [email protected] “cat 20030220-backup-mbr.dd” | dd of=/dev/sda
reboot to re-read partition table (come back into rescue mode)
rsh [email protected] “cat 20030220-backup-sda1.dd.gz | gunzip” | dd of=/dev/sda1
Depending on which machine is the fastest and how fast your network is, you need to decide when you will do the compression. Your choices are to compress before sending over the network, but if this machine is much slower than the server you are sending to, then it may be better to send the uncompressed data over the network to the destination server and compress as the data arrives. Just keep in mind that the transfer over the network will be a little slower if sending uncompressed data rather than compressed — also the network speed affects this too — 10 Mbit vs. 100 Mbit. Use your best judgement.
You might also like
This post was last updated on May 27th, 2020 at 05:04 pm Contents1 Samba startup guide checklist:2 Getting SWAT to work in RH70 Samba startup guide checklist: This applies to
This post was last updated on August 3rd, 2020 at 02:20 pmContents1 Virtualization Technology2 Hardware Virtualization2.1 1. Full virtualization –2.2 2. Paravirtualization–2.3 3. OS level virtualization –2.4 4. Hybrid virtualization