A Christmas update in case anyone finds themselves in the same situation: it was indeed caused by those snapshots. After lots of research and deliberation, I was able to recover the missing free space by deleting ALL of those snapshots. This is how I did it:
1) Running "mount" showed the various mountpoints for Volume1, including the main one in /var/subvols (in my case /var/subvols/8vEbTxkKvwa):
Code: Select all
master@Supernova:~# mount
/dev/md9 on / type ext4 (rw,noatime,nodiratime,data=ordered)
...
/dev/mapper/vg0-lv0 on /var/subvols/8vEbTxkKvwa type btrfs (rw,noatime,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/vg0-lv0 on /Volume1 type btrfs (rw,noatime,space_cache=v2,subvolid=766,subvol=/@)
/dev/mapper/vg0-lv0 on /home type btrfs (rw,noatime,space_cache=v2,subvolid=768,subvol=/@/homes)
...
2) Inside /var/subvols/8vEbTxkKvwa I found two directories: one named @ and one named @sysSnapShoot (sic).
@ is the "live" version of data, the other one contains the snapshots. I checked this by confirming that the files I had moved to the external volume were still available inside the snapshots directories, but not inside the live one. I also tested it by adding a file to the live version (via SMB) and checking that it was not found inside any of the snapshots.
3) I got a list of subvolumes by running "btrfs subvolume list /Volume1". This gave me all the snapshots, plus the live version of the data at the end. Remember, the live data resides in "@".
Code: Select all
master@Supernova:~# btrfs subvolume list -p /Volume1
ID 332 gen 19472 parent 5 top level 5 path @sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01
ID 333 gen 19467 parent 332 top level 332 path @sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/@apps
ID 334 gen 19468 parent 332 top level 332 path @sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/@cache
ID 335 gen 19469 parent 332 top level 332 path @sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/@desktop
ID 336 gen 19470 parent 332 top level 332 path @sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/@system
ID 337 gen 26144 parent 332 top level 332 path @sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/User
ID 338 gen 19472 parent 332 top level 332 path @sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/public
ID 339 gen 19482 parent 5 top level 5 path @sysSnapShoot/Snapshot/GMT+02-2024.09.30-01.00.01
ID 340 gen 19477 parent 339 top level 339 path @sysSnapShoot/Snapshot/GMT+02-2024.09.30-01.00.01/@apps
ID 341 gen 19478 parent 339 top level 339 path @sysSnapShoot/Snapshot/GMT+02-2024.09.30-01.00.01/@cache
ID 342 gen 19479 parent 339 top level 339 path @sysSnapShoot/Snapshot/GMT+02-2024.09.30-01.00.01/@desktop
ID 343 gen 19480 parent 339 top level 339 path @sysSnapShoot/Snapshot/GMT+02-2024.09.30-01.00.01/@system
ID 344 gen 26144 parent 339 top level 339 path @sysSnapShoot/Snapshot/GMT+02-2024.09.30-01.00.01/User
ID 345 gen 19482 parent 339 top level 339 path @sysSnapShoot/Snapshot/GMT+02-2024.09.30-01.00.01/public
...
ID 759 gen 22244 parent 5 top level 5 path @sysSnapShoot/Snapshot/GMT+01-2024.11.29-01.00.01
ID 760 gen 22239 parent 759 top level 759 path @sysSnapShoot/Snapshot/GMT+01-2024.11.29-01.00.01/@apps
ID 761 gen 22240 parent 759 top level 759 path @sysSnapShoot/Snapshot/GMT+01-2024.11.29-01.00.01/@cache
ID 762 gen 22241 parent 759 top level 759 path @sysSnapShoot/Snapshot/GMT+01-2024.11.29-01.00.01/@desktop
ID 763 gen 22242 parent 759 top level 759 path @sysSnapShoot/Snapshot/GMT+01-2024.11.29-01.00.01/@system
ID 764 gen 26144 parent 759 top level 759 path @sysSnapShoot/Snapshot/GMT+01-2024.11.29-01.00.01/User
ID 765 gen 22244 parent 759 top level 759 path @sysSnapShoot/Snapshot/GMT+01-2024.11.29-01.00.01/public
ID 766 gen 26123 parent 5 top level 5 path @
ID 767 gen 22691 parent 766 top level 766 path public
ID 768 gen 26144 parent 766 top level 766 path homes
ID 769 gen 22941 parent 766 top level 766 path @system
ID 770 gen 26144 parent 766 top level 766 path @apps
ID 772 gen 26123 parent 766 top level 766 path @desktop
ID 776 gen 26123 parent 766 top level 766 path @cache
4) At this point there were two things to consider. The first is that all the snapshots subvolumes are set as read-only, and the also contain sub-subvolumes (those listed below each "main" one). You can confirm this by taking note of the ID of each of the main snapshots, and checking that the next few ones have that ID as their parent; also, more simply, the directory structure shows them nested.
So, for each one of those, I had run these commands:
Code: Select all
btrfs property set -t subvol /var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01 ro false
btrfs subvolume delete /var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/@apps
btrfs subvolume delete /var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/@cache
btrfs subvolume delete /var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/@desktop
btrfs subvolume delete /var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/@system
btrfs subvolume delete /var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/User
btrfs subvolume delete /var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01/public
btrfs subvolume delete /var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.09.29-01.00.01
To avoid accidentally making a mess, and considering that most of the ones I had were in October, I wrote a little script to generate the commands for me to copy and paste.
Code: Select all
#!/usr/bin/env python3
base = "/var/subvols/8vEbTxkKvwa/@sysSnapShoot/Snapshot/GMT+02-2024.10.XYZ-01.00.01"
subs = ["@apps", "@cache", "@desktop", "@system", "User", "public"]
for i in range(1,28):
dirname = base.replace("XYZ", str(i).rjust(2, "0"))
print(f"btrfs property set -t subvol {dirname} ro false")
for sub in subs:
print(f"btrfs subvolume delete {dirname}/{sub}")
print(f"btrfs subvolume delete {dirname}")
print()
I still had one in November so I did that by hand, as I was quite terrified I had miscalculated something and was about to wipe everything. Thankfully I didn't.
6) After I deleted the last subvolume, nothing happened for a while. Then, a couple of minutes later, I noticed the free space increasing as I ran 'df' multiple times. I eventually went from this
Code: Select all
master@Supernova:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md9 7.5G 2.4G 4.7G 34% /
tmpfs 50M 28K 50M 1% /dev/shm
tmpfs 1.6G 8.7M 1.6G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 512M 1.4M 511M 1% /tmp
/dev/mapper/vg0-lv0 22T 18T 4.7T 79% /var/subvols/8vEbTxkKvwa
/dev/mapper/vg0-lv0 22T 18T 4.7T 79% /Volume1
/dev/mapper/vg0-lv0 22T 18T 4.7T 79% /home
tmpfs 779M 0 779M 0% /run/user/0
to this
Code: Select all
master@Supernova:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md9 7.5G 2.4G 4.7G 34% /
tmpfs 50M 28K 50M 1% /dev/shm
tmpfs 1.6G 21M 1.6G 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 512M 16M 497M 4% /tmp
/dev/mapper/vg0-lv0 22T 14T 7.9T 65% /var/subvols/8vEbTxkKvwa
/dev/mapper/vg0-lv0 22T 14T 7.9T 65% /Volume1
/dev/mapper/vg0-lv0 22T 14T 7.9T 65% /home
tmpfs 779M 0 779M 0% /run/user/0
7) At this point, I ran "btrfs filesystem show /Volume1" and saw that for some reason it still said that the used space was 18 TB. I think this is just an internal counter, as 'df' is what matters for the OS .
Code: Select all
master@Supernova:~# btrfs filesystem show /Volume1
Label: 'TOS_VOL_20240722' uuid: 9d2c5f6f-2269-4334-b117-cc89793eaa1a
Total devices 1 FS bytes used 18.42TiB
devid 1 size 21.80TiB used 18.66TiB path /dev/mapper/vg0-lv0
Still, wanting to get things clean, I ran the balance command: "btrfs balance start -v -dusage=50 /Volume1". This takes a while, but you can check its status in a different session by using the status subcommand, which tells you much is left. (I have no copy of that to show here, my bad).
After that — it took a while — the used space is correct everywhere:
Code: Select all
master@Supernova:~# btrfs filesystem show /Volume1
Label: 'TOS_VOL_20240722' uuid: 9d2c5f6f-2269-4334-b117-cc89793eaa1a
Total devices 1 FS bytes used 13.96TiB
devid 1 size 21.80TiB used 18.36TiB path /dev/mapper/vg0-lv0
I hope this may be helpful to anyone else who has the same problem. It's definitely nerve-wracking, but as long as you don't touch the "@" directory or volume, your live data is fine. Why those snapshots were created in the first place remains a mystery, probably some bug with TOS5? Still, all's well that ends well.
Happy holidays!