Cloning Disks using dd & cat commands for Linux systems

It always wise for a System Administrator to be prepared for the worst situation & having a backup/clones of servers, when such a day arrives will certainly make your job & life easy. Though there are a number of options to choose from to create a clones of your HDdrives like Clonezilla, Redo backup, Mondo Rescue etc but here in this post, we will not discuss 3rd party tools but will use dd command & cat command to complete cloning disks of the Linux systems.

(Recommended Read: Commands to check System & Hardware Information)

 

dd Command

dd command is the good Linux tool for cloning disks & is available on almost all Linux distributions. But beware a little mistake and you can end up destroying your partition, so be very sure to double check before executing the command.

So, the Syntax used to Clone a partition or whole drive is

 $ dd if=/dev/sda1 of=/dev/sdb1

 clone using dd command

 where,

dd is command

If is the input drive, from where files are to be cloned i.e./dev/sda1

Of is the output drive to which files are cloned i.e./dev/sdb1

It’s simple right but again i warn you to use the syntax properly as it can also delete your HDD.

 

cat Command

cat command has a number of functions i.e. it can be used create files, you can use it to read files or can also combine 2 files (read article HERE) but it can also be used to clone/backup a complete drive. Though dd is great command which has a number of options but cat command fares better when it comes to speed & performance.

Syntax for cat command :-

$ cat /dev/sda1 > /dev/sdb1

where, cat is the command,

/dev/sda1 is the input drive,

and, /dev/sdb1 is the output drive.

clone usign cat command

Both of these commands can accomplish the task i.e. to take backup/clone whole drive. Its upto your personal preference which one to choose from. In my future posts I will try to discuss some other backup/cloning solutions.

 

So this was our tutorial on for cloning disks using dd & cat commands. If having any queries/suggestions, do mention them below & I will surely address them. ADIOS !!!

 

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of you hard earned money:

Linux TechLab is thankful for your continued support.

Shusain

Passionate about Linux & open source. Loves to learn, read & write about Linux as well as new technologies.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *