Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finish support for backup point LVM options, add new LVM mount option #205

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

galenseitz
Copy link
Contributor

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.

@bebehei
Copy link
Contributor

bebehei commented Feb 24, 2018

Thank you, @galenseitz. Without futher testing, I can say your code looks quite clean. Your commit messages are perfect. Are you aware, that rsnapshot searches a new maintainer? #191

@sgpinkus
Copy link
Member

sgpinkus commented Jun 3, 2021

@MTecknology Will leave open, but won't merge without basic tests.

@sgpinkus sgpinkus added the feature-enhancement Not a new feature but an enhancement of an existing one. label Jun 3, 2021
There was some code present for backup point LVM options, but it
was not complete.  This changeset completes the previous work.
Now it is possible to specify linux_lvm_mountpath,
linux_lvm_snapshotname, linux_lvm_snapshotsize, and/or
linux_lvm_vgpath for each backup point, overriding the default
value.
Use the parse_line function from Text::ParseWords when parsing
backup options.  This allows options to be quoted, which in turn
allows options to contain commas, which is needed for the mount
command used with LVM backups.
In order to allow backups of Linux LVM logical volumes containing
a mix of xfs and non-xfs filesystems, it is necessary to have the
ability to pass options to the mount command.  This commit adds
a linux_lvm_mountargs config variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-enhancement Not a new feature but an enhancement of an existing one. needs-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants