6

Is there a command to get the on-disk size of a btrfs subvolume?

The file system was mounted with -o compressed and the subvolume contains a lot of files that should compress rather well. I could use du on the root folder but then I will only get the sum of the uncompressed sizes and it is also relatively slow compared to a df-like command.

(Note: This question is not about the size of the unique data contained in this subvolume and how much it derived from other snapshots in a COW fashion.)

Perseids
  • 213
  • 1
  • 3
  • 10
  • What abouit `btrfs filesystem df /subvol` ? – phoops May 10 '14 at 17:51
  • 4
    @edvinas.me: Nope, it shows me the same output as `btrfs filesystem df /` (the command called on the root of the btrfs file system). I should add that the version of my userspace tools is `v0.20-rc1` and that I use the current Ubuntu 13.10 kernel (`3.11.0-20-generic #35-Ubuntu`), though I don't want to narrow the question down to old versions if it is possible in current or future releases. – Perseids May 10 '14 at 22:45

1 Answers1

4

I can't help with the compressed size, but enabling quotas seems to be the only way to see how much space is us ed by a subvolume.

See : http://dustymabe.com/2013/09/22/btrfs-how-big-are-my-snapshots/

David Goodwin
  • 500
  • 3
  • 10
  • 2
    An interesting script which joins snapshot paths with sizes: https://poisonpacket.wordpress.com/2015/05/26/btrfs-snapshot-size-disk-usage/ - but you still have to enable quotas – Daniel Alder Oct 19 '18 at 17:54