size of snapshot folder is bigger than whole disk

hi,

I checked the size of /.snapshots folder and the output is below:

inux-8kr3:/.snapshots # pwd
/.snapshots
linux-8kr3:/.snapshots # du -hs .
157G .
linux-8kr3:/.snapshots #

it says 157 GB! but my whole disk is 64 GB.

what am I missing here?

thanks

Each snapshot is logically full filesystem. Most data blocks are shared, so snapshots require much less space on disk than it looks like. du does not know it so it counts each snapshot’s logical size.

is there an easy way to calculate the size of snapshots, I mean how much space does a snapshot take. I checked a few commands like “btrfs filesystem du” but thats been running forever.

No it all depends on how much data was changed between snapshots. TW has rather large amounts of changes thus tends to make larger snapshots then LEAP.

actually I don’t want to get an estimate on the size of next snapshot, I want to see how much space the snapshots already taken uses.

For example so far if I have 4 snaphots named 1-2-3-4, I want to see how much space does snapshot 4 or 3 alone costs. There must be a way to calculate it since its already on the disk.

so far what I do is

Size of snapshot folder = total_disk_size - (sum of all other folders) - free space

But I want to see how much space I would gain If I delete one of the snapshots.

Hi
Since btrfs uses quotas (default on Tumbleweed and openSUSE 42.2) this will show what each snapshot is using…


btrfs subvolume list /
btrfs qgroup show /

On Thu 27 Oct 2016 01:36:01 AM CDT, malcolmlewis wrote:

eyukselen;2797588 Wrote:
> actually I don’t want to get an estimate on the size of next
> snapshot, I want to see how much space the snapshots already taken
> uses.
>
> For example so far if I have 4 snaphots named 1-2-3-4, I want to see
> how much space does snapshot 4 or 3 alone costs. There must be a way
> to calculate it since its already on the disk.
>
> so far what I do is
>
> Size of snapshot folder = total_disk_size - (sum of all other
> folders) - free space
>
> But I want to see how much space I would gain If I delete one of the
> snapshots.
Hi
Since btrfs uses quotas (default on Tumbleweed and openSUSE 42.2) this
will show what each snapshot is using…

Code:

btrfs subvolume list /
btrfs qgroup show /


Hi
This user has a script that might make it easier to understand (rather
than having to look at the ID and compare…)


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.1|GNOME 3.16.2|4.1.34-33-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Ah, OK, I was not sure if this is enabled by default. Thank you (and for the script too :))!


btrfs subvolume list /
btrfs qgroup show /

[/QUOTE]

To answer OP question - space that would be available when subvolume is deleted is “Excl” column (i.e. blocks that are owned only by this subvolume).

But I get nonsensical 16EiB printed for some subvolumes …