Rsnapshot does not remove LV snapshot when mount failed

Written by - 0 comments

Published on September 11th 2014 - Listed in Linux Backup


On a system running rsnapshot as local backup method, the rsnapshot process failed and the backup didn't run correctly.

After analyzing the logs, it appears that rsnapshot does not remove a logical volume snapshot if the snapshot could not be mounted successfully:

[10/Sep/2014:02:07:43] /sbin/lvcreate --snapshot --size 200M --name rsnapshot /dev/vgdata/mylv
[10/Sep/2014:02:07:44] /bin/mount /dev/vgdata/rsnapshot /mnt/lvm-snapshot
[10/Sep/2014:02:07:44] /usr/bin/rsnapshot -c /etc/rsnapshot.backup.conf daily: ERROR: Mount LVM snapshot failed: 8192
[10/Sep/2014:02:07:44] rm -f /var/run/rsnapshot.pid

Reason for the mount error was, that the defined mountpoint (/mnt/lvm-snapshot) did not exist. However, after the mount failed, the LV snapshot was not removed...

On the next run of,  the creation of the LV snapshot failed, because (obviously) it already existed (from the previous run):

[10/Sep/2014:09:30:08] /sbin/lvcreate --snapshot --size 200M --name rsnapshot /dev/vgdata/mylv
[10/Sep/2014:09:30:08] /usr/bin/rsnapshot -c /etc/rsnapshot.backup.conf daily: ERROR: Create LVM snapshot failed: 1280
[10/Sep/2014:09:30:08] rm -f /var/run/rsnapshot.pid

To solve this issue, the mountpoint must be created and the logical volume snapshot must be deleted manually. Afterwards, rsnapshot runs correctly again.

This seems to be a bug of rsnapshot, so I opened an issue in the github repository of rsnapshot.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.