finish support for backup point LVM options, add new LVM mount option #205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CentOS/RHEL 7 defaults to using the xfs filesystem. When mounting a snapshot of an xfs filesystem, it is required to pass the '-o nouuid' option to the mount command. While this option could be added to the end of the mount command in rsnapshot.conf, this will only work if the LVM volumes being backed up are all xfs. If you happen to have a mixture of ext4 and xfs under LVM, there is no way to pass nouuid to only the xfs volumes.
The first commit finishes what appeared to me to be incomplete code for passing per-backup-point LVM options. This was a necessary first step before adding a new LVM option named linux_lvm_mountargs. With this change it is now possible to override the linux LVM vgpath, snapshotname, snapshotsize, and mountpath on each backup point.
linux_lvm_mountargs was added to allow arguments to be passed to the mount command on a per-backup-point basis. With this option, a user who has mostly one type of filesystem can set the global value of linux_lvm_mountargs as appropriate, and then override it for the outlier filesystems.
Because the mount command uses commas to separate options (e.g. -o noatime,nouuid,...), I made use of Perl's ParseWords to deal with the required quoting.
I'll note that I'm not much of a Perl coder, so it would be wise to take a close look at my code for mistakes. That said, I have run this code and it appears to function properly on my CentOS 7 system, backing up an msdos EFI partition, an xfs boot partition, and a couple of xfs logical volumes.