BlkSnap Kernel Patches Posted For Creating Snapshots Of Linux Block Devices

Written by Michael Larabel in Linux Storage on 3 November 2022 at 11:49 AM EDT. 17 Comments
LINUX STORAGE --
A set of patches were posted on Wednesdasy for "blksnap", a proposed kernel driver to allow creating non-persistent snapshots of arbitrary kernel block devices. Among the possible uses with blksnap would be for creating backups at the block storage device level.

BlkSnap has been developed by Veeam, a company specializing in data backup, recovery, and data management solutions. The Ohio-based company developed the BlkSnap kernel module along with an associated Veeam agent for Linux with added functionality. They are hoping to see BlkSnap upstreamed into the Linux kernel.


BlkSnap allows efficiently creating snapshots of block devices and can be done simultaneously for multiple block devices if wanting mutual consistency. BlkSnap also allows tracking block device level changes between snapshots for carrying out incremental/differential backups.

While BlkSnap originated with Veeam's commercial product, this code is said to be open-source and accompanied by open user-space tests and documentation on GitHub.
To create images of snapshots of block devices, the module stores blocks of the original block device that have been changed since the snapshot was taken. To do this, the module intercepts write requests and reads blocks that need to be overwritten. This algorithm guarantees the safety of the data of the original block device in case of overflow of the snapshot and even in case of unpredictable critical errors.

To connect and disconnect the module to the block layer, the concept of a block device filter is introduced. Functions for connecting filters are added to the block layer and the ability to intercept I/O requests is provided.

The blksnap module was created specifically for upstream based on the experience of operating the out-of-tree veeamsnap module, which is part of the Veeam Agent for Linux product. I am sure that the module will be in demand by other creators of backup tools and will save them from having to use their out-of-tree kernel modules.

Those wishing to learn more about this proposed BlkSnap kernel module for snapshots of Linux block devices can see this patch series where the latest open-source kernel work currently resides. We'll see if it gets enough interest and traction for ultimately going upstream into the Linux kernel.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week