Choosing a storage snapshot tool
Clone It
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.
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).
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.
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).
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
(incl. VAT)
Buy Linux Magazine
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.
News
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.