What are the commands to use in btrfs in case I want to:
- create a (read-only) snapshot of a volume;
- (do some experiments in the volume);
- and then rollback the volume to the snapshot?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
# take a read-only snapshot: btrfs sub snap -r fs snapshot ... do things on fs # rolling back: btrfs sub del fs # at which point you'll lose those things you've done # if you want to preserve them, just rename fs instead btrfs sub snap snapshot fs # reinstate snapshot as a read+write fs btrfs sub del snapshot # delete the non-longer needed read-only snapshot
Try from the other side: create R/W snapshot, use it as new main one, do "some experiments" on old one, then just drop contents of old.
Article "BTRFS Fun" can be helpful.