I setup my system using btrfs and timeshift for easier snapshotting and restoration however I noticed that docker (/var/llib/docker) is being included in these snapshots and I’ve noticed some weird behaviour like certain images having my host mounted into them
Can you more clearly identify what the problem you are facing is?
The reddit article you linked is that timeshift isn’t properly rolling back snapshots with nested subvolumes. It isn’t clear how that is related to the issues you are describing.
Ahhh perhaps I misread it - I was facing the same issue there though that when rolling back my docker setup was broken.
I assumed it was because they are includedas subvolume list yields:
malachi@puslar-work monitoring $ sudo btrfs subvolume list /
ID 256 gen 248205 top level 5 path timeshift-btrfs/snapshots/2022-06-20_09-12-29/@
ID 257 gen 248306 top level 5 path @home
ID 258 gen 248205 top level 5 path @cache
ID 259 gen 248306 top level 5 path @log
ID 260 gen 51142 top level 256 path timeshift-btrfs/snapshots/2022-06-20_09-12-29/@/var/lib/portables
ID 261 gen 51142 top level 256 path timeshift-btrfs/snapshots/2022-06-20_09-12-29/@/var/lib/machines
ID 262 gen 248205 top level 5 path @var-cache-pacman-pkg
ID 263 gen 247666 top level 5 path @swap
ID 264 gen 248205 top level 5 path timeshift-btrfs/snapshots/2022-03-10_14-15-23/@
ID 312 gen 51142 top level 256 path timeshift-btrfs/snapshots/2022-06-20_09-12-29/@/var/lib/docker/btrfs/subvolumes/a37bbf90e5a5760a60058057339157863acf0dc9172920ccd03945dc58f0b2f6
ID 313 gen 51142 top level 256 path timeshift-btrfs/snapshots/2022-06-20_09-12-29/@/var/lib/docker/btrfs/subvolumes/c8145e4593b893fafcca106376fdd6df62781a22a3cdeb039504c3e93cb86197
ID 314 gen 51142 top level 256 path timeshift-btrfs/snapshots/2022-06-20_09-12-29/@/var/lib/docker/btrfs/subvolumes/d03089f074c95ca178aa8eaf7cfc5c2ff9079326518aa4c167eb69c8150eadba
...
I assumed I would need to create a named volume called @docker to the path /var/lib/docker and it would make working with timeshift + docker better but my knowledge of btrfs is not good.
Yes, what that is showing is that your snapshots do not include your docker subvolumes.
The real issue here is that timeshift fails to handle nested subvolumes properly.
Yes, that would help. However, it won’t fix those existing docker subvolumes. You would have to move those around after creating and mounting the non-nested docker subvolume.
Yes you should remove the 3 duplicate lines from that file.
I am also not sure I see the point in creating a separate subvolume for /var/cache/pacman/pkg since you already have /var/cache on a separate subvolume but it doesn’t hurt anything.