Closed OliverO2 closed 5 years ago
@OliverO2 only a short initial notice:
The current btrfs support in ReaR is basically an add-on hack as needed for SLES and RHEL. In particular for SLES: ReaR works with the btrfs snapshotting as it is done there (via snapper).
I think 90% of what can be done individually with btrfs is currently not supported in ReaR.
Cf. https://github.com/rear/rear/issues/2028 in particular see https://github.com/rear/rear/issues/2028#issuecomment-463193378 and follow the links therein and see the "FYI" part in https://github.com/rear/rear/issues/791#issuecomment-406513969
Because of newest storage features in SLES like https://github.com/rear/rear/issues/2057 we may need to completely overhaul the layout code rather sonner than later...
@OliverO2 I assume since your https://github.com/rear/rear/pull/2079 is merged this issue was fixed for your use case and I hope it still works for you since my https://github.com/rear/rear/pull/2080 is merged so that I can close this issue hereby for now regardless that btrfs_subvolumes_setup_generic() needs some enhancements to make it work everywhere, cf. https://github.com/rear/rear/pull/2080#issuecomment-472448686 and subsequent comments - but that is something for the future.
@OliverO2 thank you for continuously testing ReaR on current Ubuntu versions and for your enhancements that make things work on new Ubuntu versions!
Versions
Scenario
Configuration:
/etc/fstab
:Sequence of events:
cd /volumes/01
mkdir release-upgrade
btrfs subvolume snapshot @ "release-upgrade/@-$(date -Isecond)-pre-release-upgrade"
do-release-upgrade
)cd /volumes/01
mv @ "release-upgrade/@-$(date -Isecond)-broken-release-upgrade"
btrfs subvolume snapshot release-upgrade/@-*-pre-release-upgrade @
Consequence: The system now has its root file system on a subvolume named
@
which has not been created bybtrfs subvolume create
but bybtrfs subvolume snapshot
.Trying to recover that system with ReaR produced the following results:
@
, which acted as/
.In #556, ReaR gained code to handle a similar situation, but this is limited to SLES12.
Background
From Manpage/btrfs-subvolume - btrfs Wiki:
From SysadminGuide - btrfs Wiki:
Suggestions
Since the above sequence of events is a perfectly legal way to roll back a system, ReaR should be able to handle such a system later on without extra intervention.
ReaR should not make assumptions about subvolumes the way it currently does:
ReaR should recreate Btrfs subvolumes which are mounted via
/etc/fstab
. Regardles of whether these were originally empty or started as a snapshot, they can be recreated withbtrfs subvolume create
and their contents expected to be restored from a backup.Hopefully, if we concentrate on recreating mounted Btrfs subvolumes only and ignore everything else, the entire Btrfs recreation code could be greatly simplified. Would this break anything currently useful?