Ok
I did it.
Little btrfs send and receive
a little work with fstab and grub and it seems that system works
During send and receive process NOCOW attribute disappeared from directories in my home folder.
Don’t know if this is normal.
I know. Remember. You helped me a lot too.
So maybe a little more help.
Now after every reboot when I do: btrfs subvolume list /
I get:
ID 461 gen 496 top level 5 path @
ID 462 gen 496 top level 5 path @home
ID 463 gen 490 top level 5 path @cache
ID 464 gen 490 top level 461 path var/lib/portables
ID 465 gen 490 top level 461 path var/lib/machines
The first 3 are ok. I created them.
Have no idea what are var/lib… subvolumes
I deleted them but after every reboot something is recreating them.
As I asked above.
What are:
ID 464 gen 490 top level 461 path var/lib/portables
ID 465 gen 490 top level 461 path var/lib/machines
At the source I have only @, @home, @cache
After doing send and receive form source to target I disconnected source disks and connected terget as the main one.
Now whel I list subvolumes I always get those additional two.
In timeshift, I had 3 snapshots
Two scheduled and one created on demand (before system upgrade)
After upgrade, I wanted to delete the third snapshot. I couldn’t because nested snapshots var/lib/portables var/lib/machines
What I did:
I mounted subvolume that I wanted to delete to /mnt
from /mnt I deleted subvolumes portables and machines
I unmounted /mnt and then I was able to delete the subvolume created befotre system upgrade.
What I noticed.
After reboot when I do: sudo btrfs subvolume list /
I don’t have subvolumes var/lib/portables var/lib/machines
I checked and in /var/lib there are directories portables and machines
So it seems that everything is exactly like before data migration. I’m happy but I don’t understand what happened. Why after reboot instead of subvolumes now there are directories.
Now I understood. You did it correctly!
/var/lib/machines is meant to contain virtual machines which you could set nocow or exclude from snapshots because the size.
/var/lib/portables are meant for portable service (simlar to containers), but not yet used AFAIK
I don’t understand what happened.
Before I tried to get rid of portables and machines subvolumes but after reboot system (if I understand correctly systemd) recreated them.
Now, when I deleted them from one of timeshift snapshots, after reboot system didn’t create subvolumes. Now there are directories.
I should (and am) be happy because I like order on my laptop and now I have it. But I like to understand things also. And I don’t understand what happened
By which command did you delete them? btrfs subvolume delete?
I suspect when you delete the nested subvolumes you don’t have the folders. When systemd nitices that those folders are missing it creates them, in case of btrfs fielsystem it creates subvolumes.
I never really came accross the issue, because I used to create snapshots of @ and then use to mount the snapshot on / by fstab. The snapshot had folders instead of nested subvolumes /var/lib/machines and portables.
I think now we are coming close to answering your question.