Partclone: ​​an application for cloning and restoring partitions

PartClone

If you've ever used Clonezilla to back up your operating system, you've already experienced the power of Partclone . Unlike other tools like dd, Partclone knows how to interact with specific file systems, so it can create much smaller backups by cloning only the used space on the partition.

Partclone is a free and open-source tool designed to allow users to create and clone partition images, introduced by the developers of Clonezilla. In fact, Partclone is one of the tools on which Clonezilla is based.

To explain a little better how Partclone works by taking the dd command as a reference, this is very useful, but dd does not know anything about file systems since it only replicates each block of a disk or partition, creating a perfect clone 1: 1 for example if we want to clone a 40 GB disk this will copy each sector and it will give us a 40GB file.

You could say, well it is logical, but the behavior of Partclone is different, since it can intelligently interact with the most common types of filesystem, making backup copies only of the used blocks of a partition, obtaining backup copies a lot smaller.

In short, if we are going to clone a 40GB disk but it only has 20GB occupied, the resulting file will only be 20GB and not 40GB. So we avoid occupying space that is blank.

Supported file systems

Partclone is compatible with all commonly used file systems , such as: ext2, ext3, ext4, hfs+, reiserfs, xfs, jfs, ntfs, fat (12/16/32), exfat, etc. The backup file system will determine the suffix to use with the program, following the syntax utility.

For example, to back up an ext2 filesystem, we will use the parclone.ext2 command. Also, if some specific file system is not supported by Partclone, we can use the command partclone.dd.

Among the rest that we can highlight from Partclone is the following:

Functions in Partclone

Open source : Partclone was released under the GNU GPL license and is open to contributions on GitHub.

Cross-platform: Available on Linux, Windows, MAC, ESX file system backup / restore, and FreeBSD.

Clone partitions to image files.

Restore image files to partitions.

Duplicate partitions quickly.

Shows the transfer speed and elapsed time.

Supports vmfs for vmware ESX server and ufs for FreeBSD file system.

How to install Partclone on Linux?

If you want to install this cloning software, it's easy because it's included in the repositories of almost all Linux distributions ; you just need to open a terminal and run the corresponding command for your system.

To install Partclone on Debian, Ubuntu and derivatives, run :

sudo apt install partclone

To install it on CentOS, RHEL, Fedora or derivatives, we run :

sudo yum install partclone

For openSUSE we only need to run :

sudo zypper install partclone

Finally, for Arch Linux and derivatives :

sudo pacman -S partclone

How to use Partclone?

partclone

At this point it is important to know that in order to use Partclone the volumes on which you will work must be unmounted, so if it is your disk where you have your system installed it is recommended that you work on a Live version.

A practical example would be, I want to back up my main disk and it has the ext4 file system, the command would be the following:

partclone.ext4 -c -s /dev/sda1 -o ~ /image_sda1.pcl

Where the parameters -c allows us to specify that the action we want to do is clone while -s allows us to specify the source we want to clone.

Finally -o tells Partclone where we want to store the backup image.

Note that the .pcl extension here is completely arbitrary - we use it for convenience.

To restore it:

partclone.ext4 -r -s ~ /image_sda1.pcl -o /dev/sda1

Here we only explain that the -r parameter is to tell Partclone that we are going to restore.


Add as preferred source in Google