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
SLES12 with no snapshots failed to recreate/mount btrfs FS during recovery. #1435
Conversation
…es_exclude_pattern variable. - When running SLES without snapper, $snapshot_subvolumes_pattern will be empty which cause a $subvolumes_exclude_pattern="|@.snapshot" which will exclude everything!
Sweet, if this works (and I really believe it does) it should solve #1036 as well... V. |
@jsmeix, your feedback is really welcomed as it is related to SLES with btrfs. |
Hello @schabrolles, I just successfully run test restore of SLES12 SP1 with disabled snapper and no snapshots with your patch. V. |
Align code with the code below. But now I do no longer understand what went wrong because I already tested in the code below for <pre> if test -z "$snapshot_subvolumes_pattern" ; then </pre> I only commit this one to make it clear what I mean. Currently I do not understand what goes on.
@schabrolles @gozora First: Second: if test -z "$snapshot_subvolumes_pattern" ; then so that the test above from @schabrolles should @schabrolles @gozora if test -z "$snapshot_subvolumes_pattern" ; then seems to not work as intended? |
Hi @jsmeix Just from plain look on your patch
Is the space in the end of "$snapshot_subvolumes_pattern " used on purpose? V. |
Always - really always - when I have to work with Meanwhile even I can see how it had failed before: # Output btrfs normal subvolumes: if test -z "$subvolumes_exclude_pattern" ; then that does not work as intended in case of subvolumes_exclude_pattern='|@/.snapshots' so that the test above from @schabrolles Accordingly I think everything is right with this pull request |
Aaaaaaaaaaaarrrrrrrrrrrrrrggggggggggggghhhhhhhhhhhhh! |
Removed meaningful emptiness that is wrong (a.k.a. "one space too much" at a certain place) which would have let the would stuff fail again.
@jsmeix HeHeHe .... Glad to see I'm not the only one ;) |
Use double quotes for "$snapper_base_subvolume" to be safer against possible blanks therein.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still works for me on SLES12-SP2
with the default btrfs structure
that uses snapper snapshots
so that there are no regressions.
@schabrolles @schabrolles @gozora |
If you install SLES12 with btrfs support but without snapshots you should face some issue during recovery:
During layout creation, ReaR will fail to mount btrfs FS (because subvolumeID is empty)
Looking at
disklayout.conf
shows that NObtrfsnormalsubvol
are present (=> no subvol creation)This seems to come from
usr/share/rear/layout/save/GNU/Linux/230_filesystem_layout.sh
SLES12 without snapshot controlled by snapper will generate an empty
$snapshot_subvolumes_pattern
variable.because of that,
$subvolumes_exclude_pattern
variable generated looks like this:subvolumes_exclude_pattern="|@.snapshots"
=> This will filter ALL the subvolumes listed by
btrfs subvolume list -a /
We just need to test if the
$snapshot_subvolumes_pattern
is empty before setting the$subvolumes_exclude_pattern
Results after patch: (
disklayout.conf
) => (btrfsnormalsubvol
are present beforebtrfsmountedsubvol
)