btrbk icon indicating copy to clipboard operation
btrbk copied to clipboard

Question: How to properly restore from snapshot as to keep parent relation?

Open Nox996 opened this issue 3 years ago • 1 comments

On February 2nd 2021, I have restored from a snapshot using the following commands:

btrfs subvolume snapshot TO_BE_RESTORED_SNAPSHOT target
mv folder folder.OLD
mv target folder

As I found out now, btrbk list snapshots now does not find all the snapshots before this restore operation as related snapshots (I guess this is the "parent" relation". A "new chain" of snapshots started after my restoration.

What did I do wrong? How should this be normally done (restoring from snapshots)? Is there any solution to remedy my situation and make btrbk "find" the older snapshots before February 2nd 2021?

Thank you very much in advance!

Nox996 avatar Nov 04 '21 15:11 Nox996

As long as you did not delete your TO_BE_RESTORED_SNAPSHOT and folder.old, the parent relations should not be broken and btrbk should still "find" the chain.

The question is what you mean by "find": btrbk should add TO_BE_RESTORED_SNAPSHOT as a parent (or clone source) for the first backup of target (i.e. your new folder).

Note that even if the chain is broken, incremental backups will still work, as btrbk will then "guess" the best parent from the timestamp. For even more flexibility, use the current master which implements incremental_prefs option (which allows you to define how many incremenatl clones should be used)

You can manually check the relations using lsbtr -u (or btrfs sub list -q -u). Also btrbk origin might give you some insight.

digint avatar Nov 06 '21 16:11 digint