How to Create Exact Copy of Your Linux Server Disk Drive and Restore it
Use lsblk to locate location of your hard disk.
if your hard disk is located at /dev/sdb then use the following command to make a replica image of your entire disk into an image, which you can restore on
- Another hard disk
- USB Flash Drive ( if big enough )
- Another Linux Server
Copy entire disk over SSH
ssh -p 22 -C root@my-server "dd if=/dev/sdb bs=1024k conv=noerror,sync" | \
dd of=MyServerDisk.iso
This will create an entire copy of your disk to your local machine using -C Compression.
To restore it unto another disk or USB do:
Assuming new disk drive is located at /dev/sda, then do:
dd if=MyServerDisk.iso bs=1024k of=/dev/sda conv=noerror,sync