Partclone: ​​an application for cloning and restoring partitions

PartClone

If they ever used Clonezilla to create a backup of your operating system, you have already experienced the power of the Partclone. Unlike other tools like dd, Partclone knows how to interact with specific file systems, therefore it can create much smaller backups, cloning only the used space on the partition.

partclone is a free and open source tool intended to allow us to create and clone partition images submitted by the Clonezilla developers. In fact, Partclone is one of the tools that Clonezilla is based on.

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 supports all popular file systems, like: ext2, ext3, ext4, hfs +, reiserfs, xfs, jfs, ntfs, fat (12/16/32), exfat, etc. The backup file system will determine the suffix to be used 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 for contribution 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, we have the facility that it is included in the repositories of almost most Linux distributionsWe only have to open a terminal and execute the corresponding command of your system.

For install Partclone on Debian, Ubuntu and derivatives we run:

sudo apt install partclone

While, to install it on CentOS, RHEL, Fedora or derivatives we execute:

sudo yum install partclone

For openSUSE we just have to execute:

sudo zypper install partclone

Finally, for ArchLinux and derivatives:

sudo pacman -S partclone

How to use Partclone?

partclone

At this point it is important to know whate to be able to use Partclone, the volumes on which they are going to 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 Seriously, I want to make a backup of 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.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.