Default zfs compression

ieronymous

Well-Known Member
Apr 1, 2019
285
21
58
45
I d like to know which is the type of compression used when you set it to auto upon installation, since running the command
:~# zfs get compression rpool
NAME PROPERTY VALUE SOURCE
rpool compression on local
doesnt give any info.

PS I know that I can manually set it with zfs set compression=lz4 zpool_name but how can I check the type of compression afterwards

Thank you
 
From man zfsprops:

Code:
     compression=on|off|gzip|gzip-N|lz4|lzjb|zle|zstd|zstd-N|zstd-fast|zstd-fast-N
       Controls the compression algorithm used for this dataset.

       Setting compression to on indicates that the current default compression algorithm should be used.  The
       default balances compression and decompression speed, with compression ratio and is expected to work well
       on a wide variety of workloads.  Unlike all other settings for this property, on does not select a fixed
       compression type.  As new compression algorithms are added to ZFS and enabled on a pool, the default com‐
       pression algorithm may change.  The current default compression algorithm is either lzjb or, if the
       lz4_compress feature is enabled, lz4.

So the default should be lz4
 
  • Like
Reactions: ieronymous
From man zfsprops:

Code:
     compression=on|off|gzip|gzip-N|lz4|lzjb|zle|zstd|zstd-N|zstd-fast|zstd-fast-N
       Controls the compression algorithm used for this dataset.

       Setting compression to on indicates that the current default compression algorithm should be used.  The
       default balances compression and decompression speed, with compression ratio and is expected to work well
       on a wide variety of workloads.  Unlike all other settings for this property, on does not select a fixed
       compression type.  As new compression algorithms are added to ZFS and enabled on a pool, the default com‐
       pression algorithm may change.  The current default compression algorithm is either lzjb or, if the
       lz4_compress feature is enabled, lz4.

So the default should be lz4
Thanks but there got to be a way to check it
 
Thanks but there got to be a way to check it
I don't see the point. If you want to make sure that lz4 is used and not lzjb, why not setting "compression=lz4" for that pool directly? All childs will inherit that compression so you know what exactly will be used.

Edit:
If you really want to check it:
zpool get all YourPool | grep feature@lz4_compress
That will tell you if the "lz4_compress" feature is enabled. If it is enabled lz4 should be used by default if you refer to the documentation:
The current default compression algorithm is either lzjb or, if the lz4_compress feature is enabled, lz4.
 
Last edited:
;) Sometimes I return to old posts and think "This is fascinating!" only to find out that I posted the solution or a follow-up comment a couple years ago. :O :D Hah!
Yeah, sometimes when I search for a solution for a problem all google can find are thread posted by me in some forums along time ago.:D
 
  • Like
Reactions: Tmanok

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!