I’m running Tumbleweed with Snapper/snapshots. X.org broke one time and I used the snapshots to recover my system (and wait until the nVidia drivers were fixed). However, I now seem to have a lot of space missing on my main partition, and I’m trying to work out how to recover it.
I think what has happened is that my original “/” subvolume and the snapshot subvolume that I’m now booting from have diverged a lot (because it’s Tumbleweed) but I don’t know if there’s a way to recover the space.
$ mount | grep ^/dev
/dev/mapper/main-root on / type btrfs (rw,relatime,ssd,space_cache,subvolid=1017,subvol=/@/.snapshots/685/snapshot)
/dev/mapper/main-root on /srv type btrfs (rw,relatime,ssd,space_cache,subvolid=259,subvol=/@/srv)
/dev/mapper/main-root on /boot/grub2/i386-pc type btrfs (rw,relatime,ssd,space_cache,subvolid=260,subvol=/@/boot/grub2/i386-pc)
/dev/mapper/main-root on /.snapshots type btrfs (rw,relatime,ssd,space_cache,subvolid=272,subvol=/@/.snapshots)
/dev/mapper/main-root on /opt type btrfs (rw,relatime,ssd,space_cache,subvolid=258,subvol=/@/opt)
/dev/mapper/main-root on /boot/grub2/x86_64-efi type btrfs (rw,relatime,ssd,space_cache,subvolid=261,subvol=/@/boot/grub2/x86_64-efi)
/dev/sdb4 on /boot/efi type vfat (rw,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/sdb3 on /var type ext4 (rw,relatime,data=ordered)
/dev/sdc1 on /mnt/backup type ext4 (rw,relatime,stripe=32750,data=ordered)
/dev/sdb2 on /mnt/media type ext4 (rw,relatime,stripe=32747,data=ordered)
/dev/sdb5 on /tmp type ext4 (rw,relatime,data=ordered)
/dev/mapper/main-home on /home type ext4 (rw,noatime,discard,stripe=32692,data=ordered)
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/main-root 25G 16G 9.1G 63% /
$ sudo snapper list
Type | # | Pre # | Date | User | Cleanup | Description | Userdata
-------+-----+-------+------------------------------+------+----------+-------------+---------
single | 0 | | | root | | current |
single | 685 | | Tue 13 Feb 2018 21:10:48 GMT | root | | |
single | 770 | | Fri 02 Mar 2018 09:00:01 GMT | root | timeline | timeline |
single | 771 | | Fri 02 Mar 2018 10:00:01 GMT | root | timeline | timeline |
$ sudo btrfs qgroup show -p /
qgroupid rfer excl parent
-------- ---- ---- ------
0/5 16.00KiB 16.00KiB ---
0/257 9.61GiB 5.06GiB ---
0/258 184.82MiB 184.82MiB ---
0/259 16.00KiB 16.00KiB ---
0/260 16.00KiB 16.00KiB ---
0/261 3.44MiB 3.44MiB ---
0/272 16.00KiB 16.00KiB ---
0/1017 9.71GiB 16.00KiB ---
0/1107 9.71GiB 1.58MiB ---
0/1108 9.71GiB 144.00KiB ---
0/1109 9.71GiB 16.00KiB ---
1/0 9.71GiB 1.83MiB 0/1107,0/1108,0/1109
$ sudo btrfs subvolume list /
ID 257 gen 29387 top level 5 path @
ID 258 gen 29300 top level 257 path @/opt
ID 259 gen 29166 top level 257 path @/srv
ID 260 gen 29332 top level 257 path @/boot/grub2/i386-pc
ID 261 gen 29332 top level 257 path @/boot/grub2/x86_64-efi
ID 272 gen 29392 top level 257 path @/.snapshots
ID 1017 gen 29391 top level 272 path @/.snapshots/685/snapshot
ID 1107 gen 29360 top level 272 path @/.snapshots/770/snapshot
ID 1108 gen 29379 top level 272 path @/.snapshots/771/snapshot
ID 1109 gen 29391 top level 272 path @/.snapshots/772/snapshot
$ sudo btrfs sub get-default /
ID 1017 gen 29391 top level 272 path @/.snapshots/685/snapshot
The quotas say that I’m using <10GB, but df says I’m using 16GB. Subvolume 0/257 is my old “/”, but 0/1017 is my new “/”. 0/257 now shows >5GB exclusive data. I’d like to recover that space, but I didn’t want to experiment and break anything! I thought I might be able to delete 0/257, but all of my subvolumes have it as their top level (directly or indirectly).
Is there a correct way to safely recover that 5GB of space? I’m happy to assume that I’ll never roll back to 0/257!
Thanks.
Note 1: I’ve got SSD and HDDs with partitions across them, hence the lack of some normal subvolumes.
Note 2: I’ve manually deleted most of the snapshots to try to see where the disk usage is and save what space I can, hence the short list