Hide Forgot
Description of problem: I have a btrfs disk mounted to /var/lib/machines on the host (no subvol, just the root of the btrfs), and something creates additional snapshots inside /var/lib/machines Version-Release number of selected component (if applicable): systemd.x86_64 222-14.fc23 @@commandline kernel 4.5 How reproducible: always Steps to Reproduce: 1. mount btrfs to /var/lib/machines 2. create a subvolume,let's say "testcontainer", so you have /var/lib/machines/testcontainer 3. After some time, I don't know when or what's causing it, but issuing: "btrfs subvolume list -a /var/lib/machines" results in: ID 279 gen 5904 top level 5 path testcontainer ID 285 gen 5904 top level 277 path <FS_TREE>/testcontainer/var/lib/machines Additional info: Note the additional subvolume that exists inside the container, the snapshot is of /var/lib/machines/testcontainer/var/lib/machines
I think it is systemd-tmpfiles which creates sub-volume inside the container once you boot it.
You're right, I think this fixed it: cp /usr/lib/tmpfiles.d/systemd-nspawn.conf /var/lib/machines/etc/tmpfiles.d/ vim /var/lib/machines/etc/tmpfiles.d/systemd-nspawn.conf And comment out the line "v /var/lib/machines 0700 - - -" The "v" according to "man tmpfiles.d", makes it create a snapshot. It still shouldn't be the default behavior to create snapshots, since it creates a btrfs subvolume mess with stuff you don't want.
Creating the directory /var/lib/machines inside the container, seems to also fix it, since tmpfiles.d will see that the directory exists and not invoke a btrfs subvolume/snapshot create to create it.