hidden snapshots

I’m running Tumbleweed, which was installed with the filesystem defaults, so I have a 40GB BTRFS root partition. That partition has now only 1GB of free space, so I can’t do a system update

In the past when I’ve had space problems on the root partition, it’s been because of accumulated snapshots, so I ran snapper:


laura:/home/laura # snapper list         
 # | Type   | Pre # | Date | User | Cleanup | Description | Userdata
---+--------+-------+------+------+---------+-------------+---------
0  | single |       |      | root |         | current     |         

However, listing /.snapshots directly gives:


laura:/home/laura # ls -la /.snapshots
total 20
drwxr-x--- 1 root root  52 Dec 29 13:57 **.**
drwxr-xr-x 1 root root 512 Oct  5  2018 **..**
drwxr-xr-x 1 root root  16 Nov 19 11:08 **2**
drwxr-xr-x 1 root root  38 Mar  4  2016 **55**
drwxr-xr-x 1 root root  38 Mar  4  2016 **56**
drwxr-xr-x 1 root root  52 Jun 14  2017 **70**
drwxr-xr-x 1 root root  52 Jun 14  2017 **73**
-rw-r----- 1 root root 184 Dec 29 13:57 grub-snapshot.cfg

And looking at the disk usage gives:


laura:/home/laura # btrfs filesystem du -s /.snapshots/*
     Total   Exclusive  Set shared  Filename
  28.30GiB     5.92GiB    22.38GiB  /.snapshots/2
     0.00B       0.00B       0.00B  /.snapshots/55
     0.00B       0.00B       0.00B  /.snapshots/56
   4.83MiB     4.83MiB       0.00B  /.snapshots/70
     0.00B       0.00B       0.00B  /.snapshots/73
     0.00B       0.00B       0.00B  /.snapshots/grub-snapshot.cfg

which leads me to believe that the phantom snapshot 2 might be the cause of my problems

I can’t use snapper to delete any of the listed snapshots, e.g.

laura:/home/laura # snapper delete 2
Snapshot '2' not found.

But when new snapshots are created, the first is numbered ‘1’ and the second is numbered ‘3’, so it recognises that ‘2’ is there

How do I get rid of the hidden snapshots? Can I just manually delete the subdirectories from /.snapshots? Can I check that the 28.3GB isn’t live data? How do I avoid getting in this situation again?

Any help greatly appreciated

TIA
Laura

Hi
That’s how snapshots work, it’s only consuming 5.92GiB… so have you run the btrfs maintenance tools to clean up manually (are the jobs running?)? Consider refining the snapshots kept vi editing /etc/snapper/configs/root to something that suits your needs.

For example;


systemctl status btrfs-balance.timer 
● btrfs-balance.timer - Balance block groups on a btrfs filesystem
   Loaded: loaded (/usr/lib/systemd/system/btrfs-balance.timer; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/btrfs-balance.timer.d
           └─schedule.conf
   Active: active (waiting) since Wed 2020-01-01 21:48:41 CST; 1 day 13h ago
  Trigger: Mon 2020-01-06 00:00:00 CST; 2 days left
     Docs: man:btrfs-balance

Jan 01 21:48:41 grover systemd[1]: Started Balance block groups on a btrfs filesystem.

Hi
Oh, don’t try and delete 2, that’s the running system… delete that and you will hose it… :wink:

You can’t use free memory; you only can use unallocated memory:

erlangen:~ # btrfs filesystem usage -T /
Overall:
    Device size:                  59.45GiB
    Device allocated:             15.03GiB
  **  Device unallocated:           44.42GiB**
    Device missing:                  0.00B
    Used:                         12.46GiB
    Free (estimated):             45.53GiB      (min: 45.53GiB)
    Data ratio:                       1.00
    Metadata ratio:                   1.00
    Global reserve:               37.22MiB      (used: 0.00B)

             Data     Metadata  System              
Id Path      single   single    single   Unallocated
-- --------- -------- --------- -------- -----------
 1 /dev/sdb5 13.00GiB   2.00GiB 32.00MiB    44.42GiB
-- --------- -------- --------- -------- -----------
   Total     13.00GiB   2.00GiB 32.00MiB    44.42GiB
   Used      11.89GiB 585.17MiB 16.00KiB            
erlangen:~ # 

Advice for deallocating memory: BTRFS and free space - emergency response • Oh The Huge Manatee!

Like you see you can’t delete snapshots that snapper no longer sees. But … you can do this, replace 180 by the snapshot no you want to delete from disk


btrfs subvolume delete /.snapshots/180/snapshot/
cd /.snapshots
rm -rf  180