BTRFS subvolume structure question

Hey all again,
while I’m trying to solve another and bigger problem in another topic, I’ve noticed this situation.

Restoring my btrfs system I’ve now this subvolume structure

ID 256 gen 58923 top level 5 path @.broken
ID 257 gen 58961 top level 5 path @home
ID 258 gen 58927 top level 5 path @cache
ID 259 gen 58961 top level 5 path @log
ID 262 gen 58891 top level 256 path @.broken/var/lib/portables
ID 263 gen 58891 top level 256 path @.broken/var/lib/machines
ID 269 gen 58880 top level 256 path @.broken/.snapshots
ID 974 gen 48499 top level 269 path @.broken/.snapshots/371/snapshot
ID 1016 gen 48978 top level 269 path @.broken/.snapshots/374/snapshot
ID 1054 gen 50460 top level 269 path @.broken/.snapshots/386/snapshot
ID 1056 gen 50696 top level 269 path @.broken/.snapshots/388/snapshot
ID 1059 gen 51085 top level 269 path @.broken/.snapshots/391/snapshot
ID 1062 gen 51321 top level 269 path @.broken/.snapshots/392/snapshot
ID 1066 gen 51907 top level 269 path @.broken/.snapshots/396/snapshot
ID 1081 gen 53510 top level 269 path @.broken/.snapshots/409/snapshot
ID 1092 gen 54689 top level 269 path @.broken/.snapshots/418/snapshot
ID 1095 gen 54926 top level 269 path @.broken/.snapshots/420/snapshot
ID 1099 gen 55288 top level 269 path @.broken/.snapshots/423/snapshot
ID 1104 gen 55614 top level 269 path @.broken/.snapshots/426/snapshot
ID 1107 gen 55894 top level 269 path @.broken/.snapshots/428/snapshot
ID 1109 gen 56103 top level 269 path @.broken/.snapshots/430/snapshot
ID 1117 gen 57181 top level 269 path @.broken/.snapshots/438/snapshot
ID 1126 gen 58924 top level 269 path @.broken/.snapshots/447/snapshot
ID 1157 gen 58959 top level 5 path @

the @.broken is the one is the old one that I’ve renamed and @ is the new one snapshotted from the 447 snapshot.
My question is that now my recovered system cannot take snapshot anymore because it complains that .snapshot is not a subvolume. I think is because it is under @.broken that is not is original path. The original structure was the one created by calamares when installing the system. I basically would like to have a @snapshots separate subvolume so that I can recover and then delete the old @ without losing all other snapshots in the process.

Can someone help?

Thanks in advance

You just need to mount the root of your btrfs partition somewhere. For this example I will assume it is mounted on on /mnt. Then you can do:

sudo mv /mnt/@.broken/.snapshots /mnt/@/.

That is it. You just need to move the .snapshots subvolume back where it belongs.

That should be part of your restore process.

There is no good reason to do that. It will just make things more complicated.

1 Like

Ok so I’ll do that. Also just another question: I’ve to do the same for /var/lib/portables and /var/lib/machines because I haven’t created those and I cannot understand if I need those or not. Right now they are in @.broken and the system seems to work correctly

I believe those are automatically created by systemd. If you aren’t using them, it won’t matter if you move them or not. On the other hand, there is no harm in moving them so it is up to you.

1 Like

The fact is, i don’t know if I’m using those. I’ve those, right now the broken snapshot is not in use and I’m not noticing any problem on the system that I can relate to those. Oh well, I’ll see. Thank you so much.

On the @snapshots note, this is actually the recommended setup - and default install option - on openSUSE, who was the first major distro to switch to BTRFS. I have always setup my systems this way, although I’ve never had a need to restore a snapshot…yet.

Hopefully this won’t be a stumbling block as what @ParanoidNemo has gone through.

That is true but opensuse uses snapper in a very unique way that is tied to their nested layout and the way they handle default subvolumes.

IMO, it makes less sense on an Arch-based distro with a flat layout.

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