So, I’m been troubleshooting an issue with nc-snapshots. It seems that my btrfs-snp snapshots have been failing for quite a while. As I’ve been troubleshooting, it seems that the /usr/local/bin/btrfs-snp command erroring out when it’s trying to create the snapshot. Let me give a little background.
In config.php, my data directory is set as follows:
‘datadirectory’ => ‘/media/myData/ncdata’
Here’s now things are mounted (output of mount command):
/dev/sda1 on /media/myData type btrfs (rw,nosuid,nodev,relatime,space_cache,subvolid=5,subvol=/,uhelper=udisks2)
/dev/sdb1 on /media/myBackup1 type btrfs (rw,nosuid,nodev,relatime,space_cache,subvolid=5,subvol=/,uhelper=udisks2)
The problem appears to be in /etc/cron.hourly/btrfs-snp. Inside that script, it’s running the command:
/usr/local/bin/brtfs-snp /media/myData/ncdata hourly …
Here’s the error that it’s kicking:
/etc/cron.hourly/btrfs-snp:
Create a readonly snapshot of ‘/media/myData/ncdata’ in ‘/media/myData/ncp-snapshots/hourly_2020-11-10_111701’
ERROR: cannot snapshot ‘/media/myData/ncdata’: Invalid argument
Create a readonly snapshot of ‘/media/myData/ncdata’ in ‘/media/myData/ncp-snapshots/daily_2020-11-10_111702’
ERROR: cannot snapshot ‘/media/myData/ncdata’: Invalid argument
However, /media/myData/ncdata is NOT a mount point, it seems that the script should actually be executing:
/usr/local/bin/brtfs-snp /media/myData hourly…
I can’t figure out why the "stat -c “%m” “DATADIR” command is returning “/media/myData/ncdata” instead of “/media/myData”. It’s clear from the output from “mount” that /media/myData/ncdata isn’t a mount point.
stat -c “%m” /media/myData/ncdata
/media/myData/ncdata <- Not sure why this isn’t returning /media/myData
Any ideas? I’m completely stumped. If manually execute the “correct” command ("# /usr/local/bin/btrfs-snp /media/myData hourly 24 3600 /media/myData/ncp-snapshots/ "), everything works just fine.
Thanks!