Choosing a storage snapshot tool

Clone It

Article from Issue 222/2019
Author(s):

Experts agree that you should keep a copy of your data, but restoring from incremental backups takes time and sometimes doesn't work as expected. Alternatively, you can capture your data in a snapshot. Read on for a review of some leading Linux snapshot tools.

Modern operating systems often include more than 100,000 files. In the event of system crash, bringing a system back online by restoring from incremental backups can be a complex and time consuming task. Data may even get lost along the way, if you forgot to back up certain directories or if you only created incremental backups without performing the occasional full backup.

Snapshots are a fast alternative to incremental backups. A snapshot is a copy of the dataset frozen at a point in time. This article compares several snapshot tools, including Clonezilla [1], CYA [2], Partimage [3], qt-fsarchiver [4], and Snapper [5]. See the "Not Considered" box for a few tools that did not make the list.

Not Considered

This article does not include doClone [6], because the last version was released four years ago, and the tool is not in the software repositories of the most popular Linux distributions.

The Duplicacy [7] command-line tool and rsnapshot [8] are also missing. Duplicity focuses on backups in the cloud; rsnapshot is similar in its functionality to more conventional incremental backup programs.

Requirements

Snapshot software differs greatly from backup software. A snapshot usually includes a drive partition. Unlike conventional backup sets, this unit cannot be supplemented and accelerated by differential or incremental partial backups.

Admins can thus reconstruct the complete system in a single pass in case of a crash. Unlike a backup solution, a snapshot image does not require importing several backup layers. One snapshot disadvantage is the increased time required for the application.

In contrast to backup applications, which are typically implemented in desktop environments and back up the current system, universally deployable snapshot programs have to be able to handle various filesystems. They also must be able to cope with heterogeneous IT infrastructures, as well as support common boot managers and the Master Boot Record (MBR) and GUID Partition Table (GPT) [9] layouts. In order to function in heterogeneous IT environments, the cloning programs also need to harmonize with older systems that still rely on conventional BIOS.

For systems with larger storage requirements, the applications also need to compress the generated images on the fly. In larger organizations with centralized data storage, it also helps if the generated system images can be stored on an NFS or SMB system via FTP transfer or an external storage option with SSH access if one exists. Network use is also good for rollouts, where the admin can fuel a large number of identically configured computer systems with the same operating system in a short time.

Clonezilla

The best known example of cloning software is the free live system Clonezilla [1]. Developed in Taiwan, Clonezilla is based on Debian Sid or alternatively on Ubuntu 18.04.1 LTS and has no graphical user interface (GUI). You control the complete system via ncurses menus.

Clonezilla is available in several variants. While the alternative Ubuntu version exclusively serves 64-bit systems, the Debian-based version also offers two 32-bit versions, one of which supports processors with the Physical Address Extension (PAE) [10].

The ISO images each are less than 300MB and fit easily on CD-ROMs, allowing the tool to run on very old computer systems [11]. The software is available as a hybrid image, which can therefore be launched from a USB-based storage medium. The developers stipulate a minimum of 196MB RAM for operation.

Clonezilla is also suitable for heterogeneous infrastructures: In addition to the filesystems commonly used under Linux, it also supports Windows, Apple's HFS+, and several BSD derivative filesystems. Also, Clonezilla can reinstall the current 2.x version of the GRUB bootloader (or the legacy version if required) and can cope with common older and newer BIOS versions.

On booting the Clonezilla disc, several startup options await the user in the GRUB boot manager. If there are problems with the screen resolution, Clonezilla also offers a generic VGA driver along with legacy SVGA and XGA resolutions. It is also possible to load the entire system into the computer's RAM, which noticeably accelerates work on older systems in particular.

When you select one of the start options, the system branches to an ncurses screen, where you can define the locale in the first step (Figure 1). Then, the actual Clonezilla tool starts. In the first window, it prompts you for the operating mode. This is where you say whether you want to clone a single partition or a complete disk.

Figure 1: Clonezilla uses an ncurses interface.

The software either copies the source to an identical target or creates an image of the source disk or partition. As a further alternative, there are also possibilities for cloning on the network. The network option is intended for large-scale software deployment, while the local option is more suitable for individual cloning operations or for creating snapshots for data backup.

In just a few steps, Clonezilla guides the user to the finished image. To do this, it first queries the target for saving. You can choose from a list, whether this is a local medium; an SSH, Samba, or NFS server; or whether Clonezilla should park the image in the Amazon cloud. Another possibility is a path in RAM, but its volatility can cause problems.

If you go for the local option, you can specify the target disk in the next step. For external options, you can then connect to the source computer. The system automatically detects a plugged-in USB data carrier. Next, choose the source; Clonezilla lists the different partitions on the local disk.

The following ncurses screen allows a filesystem check to ensure the filesystem's integrity. Clonezilla also offers to check an image's recoverability after it has been created. In the last dialog, the user can also select encryption according to the AES-256 standard.

After a final confirmation prompt, Clonezilla creates the image. When the software is finished, you can shut down the system, restart it, or create another image (Figure 2).

Figure 2: Clonezilla offers numerous snapshot possibilities.

If you use Clonezilla, you must make sure that the target partition is at least as big as the source partition when cloning a disk. In addition, the source drive must be unmounted while the cloning process is running or creating an image. Cloning does not work with the drive mounted.

Since version 2.5.2-31, the developers have also integrated a Clonezilla Lite server into the live system. The server is used to enable the rapid deployment of operating systems in a network environment; it can clone 40 plus computers simultaneously. The server functions and the corresponding dialogs are included in the previous routine's ncurses menus, so you don't need any additional training.

If you want to restore an image, just reverse the steps. After starting the live system, again set the locale. In Clonezilla, define the source medium where the images you want to transfer are located. In the next step, select the image repository in which the desired image is stored. In the last dialog, Clonezilla uses the restoredisk option to transfer the clone or image to the target disk.

CYA

US-based Cyberweb Solutions' Cover Your Assets (CYA) [2] is designed as an easy-to-use command-line program. It only takes single snapshots. Licensed under BSD 3 as free software, CYA is a bash script based on rsync [12].

To use the program, first install the Git version control system. Then download CYA with the following command:

git clone https://github.com/cleverwise/cya.git

In a final step, copy the application using the following command

sudo cp cya/cya <target directory>

to a directory of your choice. You can then launch it in a terminal.

In contrast to conventional backup solutions, CYA generates a system snapshot to restore a defective operating system. It does not back up user data. However, users can define their own file paths to exclude or include certain directories. For example, you can exclude the /var/log directory from the system snapshot. CYA is universally deployable, because it supports numerous filesystems, including ext2/3/4, XFS, UFS, JFS, ReiserFS, Btrfs, and ZFS. CYA will start from a USB stick if desired, which is recommended for mobile use.

CYA works with a recovery script that you need to generate before creating a snapshot. To do this, simply enter the cya script command at the prompt. The routine mounts drives and creates a chroot environment. Then the script ends up in the /home/cya directory (Figure 3). You will want to store the script on a USB memory stick if you are planning a mobile application.

Figure 3: CYA generates a recovery script before creating an image.

If you want to include your own file directories, it makes sense to set up profiles, which you store in /home/cya/cya.conf. The file, which is empty at the beginning, is only used to define any number of profiles for backup purposes. Calling a profile by its name starts the backup.

In the configuration file, define the individual files you want to include in your snapshot. Using the EXCLUDE_ parameter, you can specify additional paths to files that you do not want to see in your snapshot. This parameter also belongs in the /home/cya/cya.conf file. The CYA documentation [13] provides a useful guide.

By default, you start the program with the cya save command. CYA then executes the script and stores the data in the /home/cya/points directory. CYA shows the progress in a terminal window (Figure 4).

Figure 4: Because CYA works at the command line, the progress indicator is fairly simple.

To create a snapshot with a name of your choosing, enter

cya keep name <Name>

at the prompt. This backup cannot be overwritten. If later on you want to overwrite the existing backup with a newer version using the same name, you have to call the command with the overwrite parameter.

To archive a snapshot, enter

cya keep name <Name> archive

The command now creates, compresses, and archives the snapshot, saving the data in /home/cya/archives.

Restoring a snapshot is as easy as creating it. First, start the computer, which is no longer working with a live system. This should be as similar as possible to the installed system. Then mount the USB stick with the recovery.sh file on the running live system. The following command:

sudo /mnt/cya/home/cya/cya restore

starts a recovery, and CYA rebuilds the system.

If you want a computer to regularly create snapshots with CYA, you need to define a cronjob. Currently, CYA does not yet have the option of starting scheduled automated backups.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Snapper

    Thanks to Btrfs snapshots, Snapper lets you restore a system to a previous state in case of failure.

  • Snapper

    Snapper lets you restore a system to its previous state – with a little help from Btrfs snapshots.

  • Clonezilla SE

    Managing a network of computers can be an involved process. Clonezilla SE lets you image and roll out multiple machines with ease.

  • Cloning Hard Disks

    Is your hard disk making strange noises? Do you intend to make some major hardware changes? Maybe it’s high time to clone your disk. Four tools help Linux users and system administrators move their data and create one-to-one copies.

  • Clonezilla

    Clonezilla Live backs up and clones complete partitions or hard disks. The popular live system comes with an easy-to-use interface.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News