#819932 ncdu: counts reflinks multiple times

Package:
ncdu
Source:
ncdu
Description:
ncurses disk usage viewer
Submitter:
Adam Borowski
Date:
2026-07-13 17:35:15 UTC
Severity:
normal
Tags:
#819932#5
Date:
2016-04-04 00:07:27 UTC
From:
To:
Hi!
On filesystems that support copy-on-write, such as btrfs, ocfs2, zfs, ncdu
will count shared space multiple times.

This is akin to already implemented hardlink detection, although for most
filesystems it operates on extent rather than file level: if you reflink a
20GB file (like a VM image) then do 1MB worth of writes to one of the
replicas, the total usage will be 20GB+1MB rather than 40GB.

On Linux, you can get this information using FIEMAP.

Use of "cp --reflink" isn't very widespread, but whole-subvolume snapshots
are something most btrfs and zfs users do, so lacking this support in ncdu
is quite jarring.

#819932#10
Date:
2016-07-24 09:46:28 UTC
From:
To:
Hello,

Sorry for the late answer.

I've now reported it to the upstream bug tracker.

#819932#17
Date:
2016-07-24 10:08:23 UTC
From:
To:
Cool, thanks!

xfs is about to get reflink support, too.