Hi,
Let me start of with a little bit of a back story on this:
Yesterday I added a new storage disk to a Tumbleweed server running the latest snapshot. The purpose of this disk is to store data for containerized applications, and for more important containers the data is bind mounted from the given subvolume in the container. I need to snapshot these subvolumes daily with snapper in case anything goes wrong - wrong build, wrong post etc - I can rapidly revert the change. The snapshot mechanism is double hating as a back solution as well (btrfs send | btrfs receive).
I currently have a main subvolume - DATA - and additional subvolumes as needed. That leaves me currently with 4 subvolumes making the strucuture the following:
ID 256 gen 763 top level 5 path DATA
ID 257 gen 766 top level 256 path portal_data
ID 258 gen 767 top level 256 path portal_db
ID 259 gen 764 top level 256 path docs_data
ID 260 gen 765 top level 256 path docs_db
Mounted from fstab:
UUID=478e3fe9-8a03-4f61-816a-85cc25a3ed21 /data btrfs compress=zstd:1,noatime,relatime,subvol=DATA 0 0
I enabled snapshoting with
snapper -c portal_data create-config /data/portal_data
and so on for the other subvolumes the same way just changing the names and paths. I took the first snapshots myself with
snapper -c portal_data create
and sure enough I had a snapshot done. Later followed by other timeline snapshots hourly.
The problem I ran into on this server is that really quickly the portal_data subvolume needed a rollback. I issued the # sudo snapper -c portal_data undochange 9…10 command, but to my surprise nothing happened. It listed what will be modified, created and deleted, but nothing happened within the folder it supposed to happen. I had to copy data from the snapshot manually.
Conducted a little test - before which I deleted a few snapshots to keep it clean - where I created a file called “justatest” under the /data/portal_data/_data/ (portal_data is the subvol) and issued the following commands:
portal-test:/data # snapper -c portal_data create -t single --description "test2"
portal-test:/data # snapper -c portal_data list
# | Type | Pre # | Date | User | Cleanup | Description | Userdata
----+--------+-------+--------------------------+------+----------+-------------+---------
0 | single | | | root | | current |
7 | single | | Wed Oct 6 15:00:25 2021 | root | timeline | timeline |
8 | single | | Wed Oct 6 16:00:27 2021 | root | timeline | timeline |
10 | single | | Wed Oct 6 17:00:26 2021 | root | timeline | timeline |
11 | single | | Wed Oct 6 17:32:38 2021 | root | | |
12 | single | | Wed Oct 6 17:46:34 2021 | root | | test |
13 | single | | Wed Oct 6 17:48:59 2021 | root | | test2 |
portal-test:/data # snapper -c portal_data status 12..13
+..... /data/portal_data/_data/justatest
portal-test:/data # snapper -c portal_data diff 12..13
--- /data/portal_data/.snapshots/12/snapshot/_data/justatest 1970-01-01 00:00:00.000000000 +0000
+++ /data/portal_data/.snapshots/13/snapshot/_data/justatest 2021-10-06 17:48:37.709550268 +0000
@@ -0,0 +1 @@
+/dev/random
portal-test:/data # snapper -c portal_data undochange 12..13
create:0 modify:0 delete:1
portal-test:/data #
Nothing happened. The file should’ve been deleted, but it wasn’t. What am I doing wrong here?