elastio / elastio-snap

kernel module for taking block-level snapshots and incremental backups of Linux block devices
GNU General Public License v2.0
19 stars 7 forks source link

Reload snapshots and incrementals on reboot automatically #289

Closed e-kov closed 1 year ago

e-kov commented 1 year ago

elastio-snap as well as dattobd has possibility to continue chain of incremental backups without taking full (initial) snapshot after reboot. There is a reload IOCTL for this purpose. It should be called for a block device right on the boot before it is mounted writable. There are scripts in the dist/initramfs dedicated for this purpose. The reload script executes all /etc/elastio/dla/reload_* scripts which should call elioctl with the corresponding arguments like this:

/usr/bin/elioctl reload-[snapshot|incremental] [-i] /dev/device_name /path/to/cow/file MINOR

Without this call driver have no information about snapped devices before the reboot. And /proc/elastio-snap-info contains empty list of the devices.

We have to add a logic to generate `/etc/elastio/dla/reload_*.sh scripts automatically when calling setup-snapshot, transition-to-snapshot, transition-to-incremental commands/IOCTLs. These scripts should be removed on destroy IOCTL. So, the snapshots or incrementals will be reloaded if reboot happens at any time/ The most convenient place to put this logic is libelastio-snap. Because our goal is make this functionality available for elioctl and for other softwares like Elastio, which use elastio-snap driver via library. However, this software should install elastio-snap-utils package with elioctl utility as dependency to make reload possible.

As an option, we may need to implement possibility to call pre and post scripts before and after each reload script for better flexibility. Other softwares, probably, should may need to put them to the same location /etc/elastio/dla/ with another names pattern.

anelson commented 1 year ago

To be clear, the outcome of this work should be that customers can install Elastio with our install script, including the elastio-snap module, and reliably get incremental block backups on their Linux systems after reboot without any additional work or configuration. This property should hold across updates to new Elastio versions as well.

e-kov commented 1 year ago

To be clear, the outcome of this work should be that customers can install Elastio with our install script, including the elastio-snap module, and reliably get incremental block backups on their Linux systems after reboot without any additional work or configuration. This property should hold across updates to new Elastio versions as well.

@anelson correct.