Snapshots - space

I am using Tumbleweed on a btrfs partition of 120GB. About 95% of my data is on two other 1TB physical drives (ext4) which are mounted on my /.

There should be very little actual disk usage on the T-weed partition: ~ 9GB in the OS and ~ 6GB in /home.

I was shocked when, out of curiosity, I ran du on the .snapshots folder and it indicated 87GB!

Is btrfs ‘snapshotting’ my other (ext4) drives because they’re mounted on the /?

When I ran btrfs filesystem show / I got:

Label: none uuid: 1qvb4ad9-24b8-4d65-b0c5-60f068850fd1
Total devices 1 FS bytes used 14.84GiB
devid 1 size 111.76GiB used 21.02GiB path /dev/nvme0n1p2

Clearly I’m not clear of the btrfs & snapshots structure.

Anyone here have a solid grasp of this topic who can give me a relatively clear and relatively brief explanation?


  1. tl;dr
    Show actual disk usage (never rely on df):
erlangen:~ # btrfs filesystem df /
Data, single: total=635.00GiB, used=631.58GiB
System, DUP: total=32.00MiB, used=112.00KiB
Metadata, DUP: total=7.00GiB, used=6.03GiB
GlobalReserve, single: total=512.00MiB, used=0.00B
erlangen:~ #
  1. snapshots share data
    The internal backup disk of infamous host erlangen is a 2TB SSD. It readily holds some 330(!) full backups of erlangen’s 480GB home directory with a total size of 158TB. This indeed works because snapshots are sharing data. Disk usage of backup disk:
erlangen:~ # btrfs filesystem df /Backup
Data, single: total=577.01GiB, used=575.00GiB
System, DUP: total=8.00MiB, used=80.00KiB
Metadata, DUP: total=10.00GiB, used=9.71GiB
GlobalReserve, single: total=512.00MiB, used=0.00B
erlangen:~ # 

In addition to Karl’s advice on how to look at how much space you actually have on a btrfs volume, you can use the ‘snapper’ command to get information about the snapshots on the system and to manage them. By default, your user won’t have permissions to look at that - you’ll have to use sudo (or su -) to be root. You can modify the configuration to allow your user to have permission to manage snapshots without becoming root by editing /etc/snapper/configs/root - the file is well-commented and easy to understand for letting your non-root user account be able to make those changes.

You may well find some older snapshots that you want to get rid of - the snapper list command will show you the snapshots on the filesystem, and you can remove the ones you know you don’t need with snapper rm and the snapshot number (or a range).

Snapshots share disk space as long as data was not modified between them. Ten consecutive snapshots of a 1G file will consume exactly 1G on disk in total, not 10G.

You can compare it with hard links, except snapshots share space on sub-file granularity.