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

The LVMBackup module fails with XFS filesystems #24

Closed
bowlofeggs opened this issue Dec 9, 2015 · 7 comments
Closed

The LVMBackup module fails with XFS filesystems #24

bowlofeggs opened this issue Dec 9, 2015 · 7 comments

Comments

@bowlofeggs
Copy link
Collaborator

The LVMBackup module fails to mount the LVM snapshot of XFS filesystems with this error:

ari_backup (ohm) [ERROR] mount: wrong fs type, bad option, bad superblock on /dev/mapper/fedora_ohm-home--ari_backup,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

When I look in dmesg I see this:

[  400.459680] XFS (dm-6): Filesystem has duplicate UUID <uuid_here> - can't mount

It turns out that a workaround to this problem is to mount the filesystem with the -o nouuid option, but that option seems to be XFS specific. I suspect that non-XFS filesystems might complain if they are provided with the nouuid option (I haven't tested this yet), which makes the solution non-obvious. Would it be too "heavy" if ari-backup attempted to detect whether the filesystem were xfs and provided the nouuid option if it were? Any other ideas?

@bowlofeggs
Copy link
Collaborator Author

This seems to be a reasonable way to determine the filesystem type:

$ sudo file -sL /dev/fedora_ohm/home-ari_backup 
/dev/fedora_ohm/home-ari_backup: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)

If we have ari-backup perform that test and look for XFS I think I can fix this.

@bowlofeggs
Copy link
Collaborator Author

I found that there is a Python library that ships with Fedora that gives Python bindings to libmagic (which is what file uses under the hood):

http://www.darwinsys.com/file/

It can be used like this:

$ cat test.py 
import magic


m = magic.open(magic.MAGIC_SYMLINK | magic.MAGIC_DEVICES)
m.load()
print str(m.file('/dev/mapper/fedora_ohm-home'))
$ sudo python test.py 
SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)

However, this library seems to share its name with another Python library that is also called magic and also is bindings to libmagic, but has a different API ☹

Since I have a very targeted use case (determine whether the fs is or is not XFS, I think I may just call subprocess to run file on the block device and check for the string "SGI XFS" in the output. Does that sound reasonable? Doing it this way avoids adding a dependency, and it also avoids the confusion around specifying which of the two Python magic libraries is needed.

If it is preferred though I can do it with the library.

@bowlofeggs
Copy link
Collaborator Author

Ah, I just discovered that the LVMSnapshot does support mount_options. I could just have my backup jobs specify these options and we could close this issue. However, I do think it would be possible to detect the XFS filesystem and automatically add nouuid even if the user did not specify that.

What do you think, should we keep this open to automate that option, or close it with the resolution that the user must specify it when needed?

@jpwoodbu
Copy link
Owner

I'm more inclined to leave this be perhaps with some additional documentation that suggests using some particular mount options for XFS. I'm reluctant to add functionality around detecting file systems as well as implicitly using any particular mount options. And given that the audience for this package is sysadmins, it's probably not risking much to depend on them to set up their own mount options as needed.

@RobertBuhren
Copy link

Hi,

I've just stumbled over the exact same issue. Can anyone tell me how to set the mount_options?

Regards,

Robert

@jpwoodbu
Copy link
Owner

@RobertBuhren, I've updated the README.md file to include instructions on how to pass mount options. Let me know if those instructions are clear.

Closing this issue since I think documentation best solves it.

@RobertBuhren
Copy link

Thanks ;) I should have figured that out by my-self

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants