How To Clone Linux Hard Drive [ Linux Backup Guide]

How To Clone Linux Hard Drive [ Linux Backup Guide]

How To Clone Your Linux Hard Drive

Either you are using Windows or Linux, you should have always have backup plan for your devices and the important data you might have. One of the best way to backup your data is by cloning your drives. In this tutorial, we will show you the process to clone Linux hard drive.

How To Clone Linux Hard Drive

In this tutorial, we will take help of various tools and inbuilt command to clone Linux hard drives.

1. Partclone: Images and Clones Linux Disk Partitions

Partclone is an easy to use Linux backup tool that let you to clone your Linux disk partitions.

sudo apt install partclone

After installing, run the following command to start Partclone in Linux. In following command, [fstype] is the type of the partition you wish to clone.

partclone.[fstype]

For example:

Run the following command to create a disk image of hard disk drive 1, partition 1 (hda1)  called hdaimage.img:

partclone.ext3 -c -d -s /dev/hda1 -o hdaimage.img

How To Restore Data using Partclone in Linux

You can easily restore the image by running following command:

partclone.extfs -r -d -s hdaimage.img -o /dev/hda1

2. dd: In Built Linux Disk Cloning Tool

You’ll find dd built into most Linux operating systems. Just in case if your Linux doesn’t have it then you can  install it from the package manager. Run the following command to clone your computer’s hard disk:

dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync

Let’s break this command down for clarity:

  • sdX is the source disk which you want to take backup
  • sdY is the destination where your backup image will be stored
  • bs is the block size command
  • 64K corresponds to bs
READ More Relevant Stuff:  How To Install RPM packages On Ubuntu 22.04 LTS [2023]

If you only want to clone a partition of your Linux disk drive, use:

dd if=/dev/sda2 of=/dev/sdb1 bs=64K conv=noerror,sync

In above command, dd will take backup of partition sda2 to sdb1. It is always wise to use  secondary, or external, disk drive to store the backup image.

Some other Linux tools that you can use to clone the Linux partitions are following:

  • balenaEtcher
  • Clonezilla
  • Partimage

 

 

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

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