My root file system / is on an SSD while /var is on a “normal” hard disk. Today, I wanted to revert to a snapshot due to an Plasma 5 issue after update. While zypper and packagekitd created snapshots for /, there are only “timeline” snapshots of /var. Is there any way to incorporate the /var snapshot procedure into the default one of /? When I want to revert to an older snapshot, I want to do that for / and for /var.
Good question. Neither SLES documentation nor SLES training materials (which just quote documentation) describe what is included in installation snapshot. Looking in sources, it is always single configuration with fixed name “root”. As far as I understand each snapper configuration can only include single subvolume (at least, all documentation is using singular, not plural, form).
By default /var is on root subvolume and it has good reasons to remain so. May be you should reconsider your layout and only move selected subdirectories from /var to other disk.
I may be corrected, but my understanding is that the BTFRS snapshots have to be stored on the root partition because snapper only switches between images(And by default openSUSE configures only the root partition with BTRFS). If the images weren’t stored on the root partition, then you’d have some convoluted booting on a new location with unpredictable consequences. And, of course copying or moving images around on demand would cause some really bad latency.
Beyond that,
I haven’t personally looked more deeply into things like the relationship between /var and snapshots, a deeper understanding into what is possible only after understanding what is really there.
As I understand it. snapper simply keeps changed blocks and organizes them into snapshots. So they must all be on the same partition. This is not like doing a backup image it is simply not reusing used blocks that in other situations would be released for reuse by the file system. If you want a special partition for sections of root then you need to format BTRFS and set up snapper on them independent of root’s snapper.
Isn’t Snapper simply a utility that leverages the features of btrfs? Made specifically for suse?
Surely if you had /var and / on separate partitions (reasons why you would want to do this aside), as long as both were btrfs, you could keep snapshots of both - albeit separately.
Whether you could use Snapper as-is for /var partition I don’t know.
You might need some other btrfs utilities to manage the other partition. Not sure of Snapper could be configured to run on two partitions.
Maybe if someone has a VM they could try the partition manager on install and make multiple btrfs partitions to see if Snapper will “hook” to them all by default?
I’ve never noticed any options about selecting other partitions within Snapper…
OP I’m sure what you want is possible - but maybe not with Snapper utility specifically. Look for more generic btrfs utilities.
You should be able to use snapper for any subvolume on any partition. What snapper apparently does not support is multiple subvilumes in one “config”. Another consideration is, there is no way to create atomic consistent snapshots across different partitions (i.e. different btrfs filesystem). I do not think you can do it even for subvolumes inside a single filesystem.