Article 5MYKZ BTRFS snapper - simple manual creation and rollback.

BTRFS snapper - simple manual creation and rollback.

by
ddenial
from LinuxQuestions.org on (#5MYKZ)
Hello All,

I've installed the snapper package in Fedora 34 with Btrfs. As I've come from LVM-XFS background, I want a simple snapshot feature from snapper. No Pre-Post, scheduled, etc snapshots.

I'd want to take a manual snapshot before making any changes. If I'm not happy, I'd like to roll back, and if I'm satisfied, I'd like to commit the changes.

So this is what I've done after installing snapper.

Code:# btrfs subvolume list /
ID 256 gen 14442 top level 5 path root
ID 258 gen 14443 top level 5 path home
ID 259 gen 14443 top level 5 path var
ID 264 gen 13558 top level 259 path var/lib/machines
ID 272 gen 13645 top level 5 path snapshots

# snapper -c root create-config /
# snapper -c home create-config /home

# grep TIMELINE_CREATE /etc/snapper/configs/root
TIMELINE_CREATE="no"

# grep TIMELINE_CREATE /etc/snapper/configs/home
TIMELINE_CREATE="no"

# snapper -c root ls
# | Type | Pre # | Date | User | Cleanup | Description | Userdata
---+--------+-------+------+------+---------+-------------+---------
0 | single | | | root | | current |

# snapper -c home ls
# | Type | Pre # | Date | User | Cleanup | Description | Userdata
---+--------+-------+------+------+---------+-------------+---------
0 | single | | | root | | current |Now, this is how "I BELIEVE" manual snapshots are taken, rolled back, or committed. Please correct me if it is not so.

1. Create a manual snapshot of /home subvolume:
Code:# snapper -c home create -d "Before I change stuffs"

# snapper -c home ls
# | Type | Pre # | Date | User | Cleanup | Description | Userdata
---+--------+-------+--------------------------------------+------+---------+------------------------+---------
0 | single | | | root | | current |
1 | single | | Wednesday 04 August 2021 02:31:24 PM | root | | Before I change stuffs |2. Create some temp files in user's Documents folder:
Code:$ touch tmp_files{1..5}

$ ls
tmp_files1 tmp_files2 tmp_files3 tmp_files4 tmp_files53. To rollback, I do this:
Code:# snapper -c home undochange 1..0
create:4 modify:50 delete:63

# snapper -c home delete 1

# snapper -c home ls
# | Type | Pre # | Date | User | Cleanup | Description | Userdata
---+--------+-------+------+------+---------+-------------+---------
0 | single | | | root | | current |4. If I want to keep the change, I'd make the commit as follows (Just delete the snapshot):
Code:# snapper -c home delete 1Is this the proper way to manually create, rollback, and commit snapshots?

Thankslatest?d=yIl2AUoC8zA latest?i=Q3wciiTygOU:WiHkBZ4DFNs:F7zBnMy latest?i=Q3wciiTygOU:WiHkBZ4DFNs:V_sGLiP latest?d=qj6IDK7rITs latest?i=Q3wciiTygOU:WiHkBZ4DFNs:gIN9vFwQ3wciiTygOU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments