How to clone and migrate a Linux hard drive to another server?
Publisher: Psychz Networks, January 31,2019There are several ways to clone a Linux system drive using internal as well as third party tools. But it wouldn’t be incorrect of you to think using CAT command over other available options including the DD command. DD comes with a lot more options when it comes to copying the files however, CAT is much faster than DD when it comes to speed and performance.
DD comes with large number of options and are very useful in dealing with bigger backups such as Tape drives. But anyone with good experience with Linux environment would recommend CAT because it gets the job done quite successfully in copying the content of a partition to a new unformatted partition.
- Step 1: Install Secondary Drive
- Step 2: Initiate clone using "cat' command
- Step 3: Remove older drive
- Step 4: Boot server
Let us now take a look at the steps involved in cloning and migrate a Linux drive to another server using CAT command
Important Note: Provide a valid hard disk with the minimum size of the existing data and with no filesystem whatsoever.
Step 1.
Install a secondary drive of same size as the primary (one that needs to be cloned) drive in the current machine
Once you have inserted the drive you may need to boot the machine just to verify if the drive has been successfully accepted by the system. If the server allows hot swap of drive, you do not need to boot the machine.
Run following command to check the newly added disc
# df
You can notice the label of the newly added disc "sdb1"
Step 2.
We will now initiate the cloning process using the 'cat' command
# cat /dev/sda1 > /dev/sdb1
where, /dev/sda1 is the input drive, and, /dev/sdb1 is the output drive.
Step 3.
Your secondary drive is now a clone of your primary one. You can now remove the drive from the server and move to a new server
Step 4.
Once you have moved the drive to a new server, boot the new server and configure the network via IPMI
You are now good to go with your new server same as your old one.