CloudBerry Snapshot Driver for Linux 0.16 Beta

CloudBerry Snapshot Driver for Linux 0.16 Beta

CloudBerry Snapshot Driver for Linux 0.16 Beta

When backing up a file that is being written, it is impossible to guarantee the integrity of a backup copy of that file. This is typical for backing up documents that are actively being edited, etc. To handle these scenarios, Microsoft Windows uses the Volume Shadow Copy Service (VSS) technology that lets users make backup copies of files or volumes, even when they are in use.

VSS first creates a snapshot of the volume to back up. A snapshot (or shadow copy) is a read-only point-in-time replica of an original volume that has been taken directly before an application accessed the volume files. Therefore, this technology can maintain a consistent state of a file or volume.

Linux does not provide similar technology, so we have developed our own snapshot technology called CloudBerry Snapshot Driver for Linux. Our technology includes two parts: the snapshot device and the snapshot driver. The snapshot device is a mirror of the selected disk partition. If an application tries to modify a file that belongs to the selected disk partition, the snapshot driver automatically copies the parts of the file being read to the snapshot device. The application can then overwrite the data on the disk, while the snapshot device contains the original data. Thus, the snapshot device contains the state of all original files as they were when the snapshot was created.

Key Benefits

• Supports consistent backups of files that are being written during the backup operation
• Allows applications to continue to access and change files without affecting the backup
• Easy setup
• Supports several snapshot devices at a time to create shadow copies of several disk partitions simultaneously

System Requirements

Before installing CloudBerry Snapshot driver for Linux, ensure that your computer meets the following minimum software and hardware requirements.

Hardware Requirements

• 1.4 GHz 64-bit processor
• 512 MB RAM
• Minimum free disk space depends on a number of snapshot devices and their sizes

Software Requirements

• CentOS 6.10/7.6
• Debian 9.2.1/9.8
• Fedora 29
• OpenSUSE 15.0
• Ubuntu 16/17/18

Getting Started

Deployment Instructions

To deploy CloudBerry Snapshot driver, perform the following steps:

1. Download the driver installer archive from our website, and then unpack it

NOTE: By default, the system prompts you to unpack the driver installer archive to the
CLBB_driver folder. After unpacking the archive, this folder has the following
structure:

2. Build the snapshot driver
3. Create the snapshot device.
4. Start and mount the newly created snapshot device.
5. Optionally, perform steps to check whether the snapshot driver works properly.
The section that follows details the deployment procedure steps.

Detailed Steps

Building the Snapshot Driver

To build the snapshot driver, navigate to the CLBB_driver folder, and at the command
prompt, enter the following commands:

sudo ./install make

When prompted, enter the root password, and type in Y (Yes) to proceed with the installation process:

sudo ./install install

Installing the Snapshot Driver

Some of the installation commands use the current kernel name that you can get using the following command:
uname –r

Please, note the kernel name, such as 4.12.14-lp150.245-default in this scenario.

To install the snapshot driver, at the command prompt, enter the following command:

sudo insmod
/lib/modules/<CURRENT_KERNEL>/kernel/drivers/block/cblb_modul e.ko total=<N>

where <CURRENT_KERNEL> refers to the current kernel name, and <N> is the maximum number of the snapshot devices that can be created at a time.

NOTE: By default, N is equal to 4. An increase of N results in decreasing the driver performance.

Example: Install the Snapshot Driver

The following command installs the snapshot driver for the 4.12.14-lp150.245- default kernel; maximum number of the snapshot devices is 4:

sudo insmod /lib/modules/4.12.14-lp150.245-
default/kernel/drivers/block/cblb_module.ko

Creating the Snapshot Device

To create the snapshot device, use the following commands:

sudo sync && echo -n "create<device name><partition name>  begin end"> /sys/kernel/cblb/cmd

where <device name>  is the device name that is being created, and the <partition name> is the name of the disk partition for which you create a snapshot. The “begin” and “end” parameters mean that you want to create a snapshot for the whole disk partition.

Example: Create Snapshot Device

To clarify, consider the following sample command:

sudo sync && echo -n "create shadow-sda2 /dev/sda2 begin end"> /sys/kernel/cblb/cmd

NOTE: This command creates the shadow-sda2 snapshot device for the /dev/sda2 disk partition.

Starting and Mounting the Snapshot Device

To complete deploying the snapshot device, start and mount the newly created device.

NOTE: The snapshot driver stores temporary data to a file catalog you should create.

Create a catalog for storing temporary files:

mkdir <path to catalog>

NOTE: Create a separate catalog for each snapshot device.

Start the snapshot device:

echo -n "start <device name><path to catalog><file size><max number of files>" > /sys/kernel/cblb/cmd

where <device name> is the created snapshot device name;<path to catalog> is the path to the catalog for temporary files;<file size> is the temporary file size (in blocks, such as 512, 2024, 4048, etc.), and <max number of files> is the maximum number of created temporary files.

Example: Start Snapshot Device

mkdir /tmp/shadow-sda2
echo -n "start shadow-sda2 /tmp/shadow-sda2409600 20" >
/sys/kernel/cblb/cmd

NOTE: These commands start the shadow-sda2 device that uses the /tmp/shadow-sda2 catalog for storing temporary files. The size of temporary files is 409600 blocks, and
the maximum number of files is 20.

Create a catalog for mounting the snapshot device:

mkdir<path to catalog>

Mount the snapshot device:

sudo mount -o ro,noload /dev/<device name><path to catalog for mounting the snapshot device>

Example: Mounting Snapshot Device

Consider the following sample commands that mount the shadow-sda2 snapshot device
to the /tmp/mshadow-sda2 catalog:

mkdir /tmp/mshadow-sda2
sudo mount -o ro,noload /dev/shadow-sda2 /tmp/mshadow-sda2

Validating Driver Installation

To ensure that you have properly installed the snapshot driver, consult the following
checklist:

  • The /tmp/mshadow-sda2 catalog contains a copy of the /dev/sda2 disk partition.
  • The file system /sys includes the /sys/kernel/cblb catalog that contains the cmd
    and debug files, and sub-catalogs for each created snapshot device:

Removing Snapshot Device

To remove the snapshot device:

1. Unmount the snapshot device:

umount <device name>

2. Remove the snapshot device:

echo –n “remove <device name>” > /sys/kernel/cblb/cmd

Additional Resources

You can get the latest information on our products, various tutorials, and other
pertinent information in our blog and at our Help Center.

Also, check out our knowledge base that features various workarounds for frequently
experienced issues as well as some tips on how to enhance your interaction with our
flagship backup solution at our knowledge base

Not found what you're looking for?

Contact our customer care team here.