Snapshot warning even with root privileges

I’m new to duplicati and i have it installed in a headless Ubuntu server 18.04 box. I have enabled the the advanced option --snapshot-policy=on which means that if Duplicati has a problem creating the snapshots then it will produce a warning. The online documentation indicates that, in order to use this option, duplicati needs root privileges.

According to these posts
Installing Duplicati on Linux (Ubuntu / LinuxLite)
How to give duplicati root permision on ubuntu

in order to start duplicati as a service i need to run the following commands

sudo systemctl start duplicati.service
Sudo systemctl enable duplicati.service

Which i have done. So, my understanding is that duplicati should be running as a service.

However, after i performed my initial backup i got the following waring message:

2021-06-26 09:09:49 -04 - [Warning-Duplicati.Library.Main.Operation.BackupHandler-SnapshotFailed]: Failed to create a snapshot: The external command failed to start. Error message: Duplicati.Library.Interface.UserInformationException: The script returned exit code 255, but 0 was expected: Exit code: 255 Error: unable to determine volume group (VG) for /files/backup/ at Duplicati.Library.Snapshots.LinuxSnapshot+SnapShot.ExecuteCommand (System.String program, System.String commandline, System.Int32 expectedExitCode) [0x000e4] in :0 Command: /usr/lib/duplicati/lvm-scripts/find-volume.sh “/files/backup/”

Can anybody help me start decrypting this message?

It appears that duplicati cannot determine the volume group for /files/backup which is the target folder in an external USB drive.

Besides that, i have no idea how to troubleshoot this warning message.

You are using LVM, correct?

snapshot-policy

On Linux this uses Logical Volume Management (LVM) and requires root privileges.

If you think you have LVM set up (I don’t, so will stay in somewhat generic mode), then

could be examined or run under bash -x to see what it’s tripping over. Here’s a bogus run that I tried:

$ bash -x /usr/lib/duplicati/lvm-scripts/find-volume.sh /tmp
+ NAME=/tmp
++ awk '{ print $1}'
++ tail -1
++ df -P /tmp
+ VOLUME=/dev/sda1
+ '[' 0 -ne 0 ']'
+ '[' -z /dev/sda1 ']'
++ awk '{ print $NF}'
++ tail -1
++ df -P /tmp
+ MOUNTPOINT=/
+ '[' 0 -ne 0 ']'
+ '[' -z / ']'
+ get_lvmid /dev/sda1
++ awk '{ print $1 "/" $2}'
++ tail -1
++ lvs /dev/sda1 --options vg_name,lv_name --noheadings
+ LVMID=
+ '[' 0 -ne 0 ']'
+ export LVMID
+ '[' -z '' ']'
++ awk '($3 == "/") {print $1}'
++ mount
+ VOLUME=/dev/sda1
+ get_lvmid /dev/sda1
++ awk '{ print $1 "/" $2}'
++ tail -1
++ lvs /dev/sda1 --options vg_name,lv_name --noheadings
+ LVMID=
+ '[' 0 -ne 0 ']'
+ export LVMID
+ '[' -z '' ']'
+ EXIT_CODE=-1
+ echo 'Error: unable to determine volume group (VG) for /tmp'
Error: unable to determine volume group (VG) for /tmp
+ exit -1
$ echo $?
255
$ 

drwtsn32 & ts678 thank you so much for your responses. I think you identified my problem.

No, I’m not using LVM. For some reason when I read the Duplicati documentation about snapshots, I focused on the “Root” requirement and completely ignored the “LVM” portion.

I admidetly don’t know much about LVM.

My source is a disk array that uses snapraid for redundancy, mergerfs for pooling and all the disks are formatted as ext4.
My target is an external usb HDD formatted as exFAT for portability to other systems if I ever have to migrate the data.

Now I know that my setup is not compatible with the “Snapshot” option of Duplicati since it relies on LVM which I’m not using.

Interestingly, this is very similar to UrBackup in the sense that the software itself doesn’t have a snapshot function but rather access/manages the snapshots function offered by the file system (ZFS in the case or UrBackup).

In any event, I will just set the snapshots to OFF since, not only my system is not compatible, but I have setup my backups to run at 1 AM when there are no users accessing the files so I shouldn’t need it.

1 Like