Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enabling compression on ZFS - a practical example
After enabling compression:
[dan@zuul:~] $ zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
system 452G 365G 87.5G - 52% 80% 1.00x ONLINE -
I had this large file:
-rw-r----- 1 rsyncer rsyncer 68630478685 Apr 3 09:12 bacula.dump
I copied it:
[rsyncer@zuul ~/backups/Bacula]$ cp bacula.dump bacula.dump.compressed
I checked space:
[dan@zuul:~] $ zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
system 452G 372G 79.5G - 54% 82% 1.00x ONLINE -
That's a 63GB file copied, and using only 8G or so.
Now lets move it back:
[rsyncer@zuul ~/backups/Bacula]$ mv bacula.dump.compressed bacula.dump
A short while later:
[dan@zuul:~] $ zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
system 452G 306G 146G - 46% 67% 1.00x ONLINE -
Wow! Another 66G of free space. We went from 82% full to 67% full.
Moral: Always turn compression on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment