Var/lib/machines directory and timeshift issues

I think I know how to work around this issue but wanted to understand it better.

It seems that for some reason I don’t understand systemd creates 2 directory/subvolumes:

/var/lib/machines and /var/lib/portables

It seems that the subvolumes part of this is nested under @ subvolume and what I’ve noticed is that when you use timeshift to restore a snapshot you get an error about not being about to delete some directories. The error is not useful.

You can manually delete those snapshot directories by mounting the drive partition without it’s subvolumes and doing it the hard way.

You can avoid this by creating the 2 directories soon after install with:

sudo mkdir -p /var/lib/machines
sudo mkdir -p /var/lib/portables

Does anyone know why systemd needs to create these nested subvolumes and why if those directories already exist it does not create them?

Another work around is to use snapper and btrfs-assistant instead of Timeshift

Creating subvolumes instead of directories for containers has advantages. It keeps your containers out of your root snapshots and increases the portability of your machines.

If you don’t like that behavior, simply create the directories in advance as you have done.

IMO, the real issue here is that Timeshift doesn’t support nested subvolumes.

I agree with you about Timeshift. That is why I use snapper and btrfs-assistant for 99% of my installations. But I was playing with the new Debian 13 and thought I’d see how Timeshift worked with the latest stable. It’s still nothing to write home about.

I like the fact that snapper and btrfs-assistant are now in the Debian 13 repo, so no tricks getting it installed. Debian seems to have added snap-pac type features into their snapper so you get pre/post snapshots on apt updates/installs. They seems to have left out the descriptions of what got installed, which is a shame.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.