Getting and understanding free and allocated space stats

Status
Not open for further replies.

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
I'm trying to get my head wrapped around how to calculate disk space usage on a ZFS volume/dataset. There seems to be multiple ways to get disk information, some of which is before or after compression/deduplication but not specified.

For instance:

If I run "du -h -d 1 -A" I get the apparent or actual uncompressed file sizes. From the filesystem's point of view, not very interesting. From a user's perspective, with compression you can actually "use" more disk space than you actually have.

The GUI's "compression rate" and what comes out of "zdb -D dataset" I have found out can be wildly wrong when you have a file with a bunch of empty space.

So if a PHB asks "How fast is the NAS filling up?", how do I get meaningful stats like the following:
  • What is the actual compression ratio? (space used on the disk / space of original file)
  • How much is deduplication saving us? (space used on the disk / space of original files)
When you dump files onto an EXT4 file system, it is easy to calculate these numbers. On a ZFS file system, it seems complicated knowing where you stand free space wise and allocated disk space.

Thanks.
 
D

dlavigne

Guest
zfs get space | more gives a better indication of what is happening space-wise (rather than du). As for compression, the default of LZ4 compresses on the fly, but only when the data to be compressed benefits from compression.
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
zpool get all | more also returns useful information.
 
Status
Not open for further replies.
Top