Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

zfs compression using zstd-5 - is this possible? How to set?

Featured Replies

Hi everyone,

 

Maybe I'm daft, but I'm not able to set zstd-5 compression on my zpool, or the datasets contained within the zpool.

 

I run "zfs set compression=zstd-5 mypool" and it runs without error.

I then run "zfs get compression" and it shows "zstd-5"

After reboot, I get a mixed bag.  I've seen "zfs get compression" return "on", and "off" seemingly without a repeatable pattern.

 

I checked and Unraid 6.12.14 is running > version 2 of zfs, so zstd-5 should be supported.

zfs -V
zfs-2.1.15-1
zfs-kmod-2.1.15-1

 

What am I missing here?

 

Thanks everyone,

Cal.

Edited by calvados

Solved by bmartino1

  • Community Expert

?

need pool name.

But yes this compression is possible. Usually done with the zfs master plugin at the main screen when making a data set.

 

image.thumb.png.85eb6cedea87adfeb066cd006fd7a7c9.png

 


commands

zfs set compression=zstd-5 mypool
zfs set compression=zstd-5 mypool/dataset


Check Dataset-Level Compression If your pool contains datasets, ensure they are inheriting or explicitly set to zstd-5:

zfs get compression mypool
zfs get compression mypool/dataset

 

Persist the Setting Across Reboots ZFS should persist settings automatically, but to confirm, verify your /etc/zfs/zpool.cache file is being updated correctly (this is typically handled automatically by ZFS). Ensure this cache file exists and is not corrupted:

ls -l /etc/zfs/zpool.cache




Other troubleshooting as if i recal correctly, I think this needs done at creation...
Troubleshooting zstd-5 Resetting to on or off:

 

Unsupported Compression Level: Even though ZFS 2.1+ supports zstd-5, some distributions might have limited support or restrictions in their builds. Run this command to check available compression options:

zfs get all | grep compression
modinfo zfs

 

otherwise you may need a go file / first array start script to set the compression.

Edited by bmartino1
Data - typo

  • Author
7 minutes ago, bmartino1 said:

But yes this compression is possible. Usually done with the zfs master plugin at the main screen when making a data set.

 

image.thumb.png.85eb6cedea87adfeb066cd006fd7a7c9.png

 

 

  Where do you see this page?  I'm not seeing it.  I have ZFS master installed, and I see the following:

 

image.thumb.png.ca3caf37f050fcd6973f7199b8f014ef.png

 

I got here by hitting "Add Pool" (below).  I didn't see any options under ZFS Master to create a new pool, so I did it via command line.

 

zpool create -O casesensitivity=insensitive -m /mnt/ur2pool ur2pool raidz1 ata-HUH721212ALE601_8DJ2S4ZH ata-HUH721212ALE601_8HKS73MY ata-HUH721212ALE601_AAGAX74H ata-HUH721212ALE601_AAGHK6WH

zfs set compression=zstd-5 ur2pool 
zfs set atime=off ur2pool
zfs create ur2pool/hotBackup

 

The zpool then showed up under ZFS Master:

 

image.thumb.png.05238902f8e4d54f4d68432622cc35da.png

 

What am I missing?

 

Thanks again @bmartino1,

Cal.

  • Community Expert

under the main tab.
image.thumb.png.4908d9a3e22ea06d77d03994b2138898.png

its a plugin
image.png.f19522379cfd7c28302042125e928543.png


review:

 

Edited by bmartino1
data

  • Author

Ahh thanks again @bmartino1.  I'll delete the dataset I created via terminal, then recreate it via the GUI.  I only see the basic zstd, but no option to set zstd-5.  Is there a way to set zstd-5?

Edited by calvados

  • Community Expert

so the compression is zstd the quota is 5 MiB per the zfs plugin to set that option.

image.thumb.png.f7295a82e0c5abeaffa27fb76b3052bd.png


you may also need to set each disk in the unraid web ui for the zfs pool for compression on:
image.png.2a1edb270f708e3eb66167d8889642d3.png


then in the dataset creation:

image.png.e4cacba665961148bc1e4993126b514b.png

 

image.png.e88c1d7d39b55d4d4054937a874576fe.png

 

its been a while.

  • Author
3 minutes ago, bmartino1 said:

so the compression is zstd the quota is 5 MiB per the zfs plugin to set that option.

image.thumb.png.f7295a82e0c5abeaffa27fb76b3052bd.png


you may also need to set each disk in the unraid web ui for the zfs pool for compression on:
image.png.2a1edb270f708e3eb66167d8889642d3.png


then in the dataset creation:

image.png.e4cacba665961148bc1e4993126b514b.png

 

image.png.e88c1d7d39b55d4d4054937a874576fe.png

 

its been a while.

 

Getting closer.  I followed these steps and now I'm getting:

zfs get compression
NAME               PROPERTY     VALUE           SOURCE
ur2pool            compression  on              local
ur2pool/hotBackup  compression  zstd            local

 

Any other thought as to how can I get zstd-5 or another zstd-# compression?

 

Thanks again @bmartino1,

Cal.

  • Community Expert
  • Solution

at this step I think this is when you run the terminal commands for

zfs set compression=zstd-5 mypool

zfs set compression=zstd-5 mypool/dataset

 

I honestly don't remember as I went though this with chatgpt/AI and others in the past.

 

that may be better asked here.


if running betat 7 rc2 i do know that pool needs to be upgraded.
zpool status

zpool upgrade mypool
 

  • Author
9 minutes ago, bmartino1 said:

at this step I think this is when you run the terminal commands for

zfs set compression=zstd-5 mypool

zfs set compression=zstd-5 mypool/dataset

 

I honestly don't remember as I went though this with chatgpt/AI and others in the past.

 

that may be better asked here.


if running betat 7 rc2 i do know that pool needs to be upgraded.
zpool status

zpool upgrade mypool
 

 

Thanks again @bmartino1.  Setting the compression again after reboot, then rebooting again has me at the closest point yet, that is probably good enough. Ideally I'd have the same zstd-5 at the pool level, but I guess this will work.

 

 zfs get compression
NAME               PROPERTY     VALUE           SOURCE
ur2pool            compression  on              local
ur2pool/hotBackup  compression  zstd-5          local

 

  • Author
2 hours ago, bmartino1 said:

 

Persist the Setting Across Reboots ZFS should persist settings automatically, but to confirm, verify your /etc/zfs/zpool.cache file is being updated correctly (this is typically handled automatically by ZFS). Ensure this cache file exists and is not corrupted:

ls -l /etc/zfs/zpool.cache




Other troubleshooting as if i recal correctly, I think this needs done at creation...
Troubleshooting zstd-5 Resetting to on or off:

 

Unsupported Compression Level: Even though ZFS 2.1+ supports zstd-5, some distributions might have limited support or restrictions in their builds. Run this command to check available compression options:

zfs get all | grep compression
modinfo zfs

 

otherwise you may need a go file / first array start script to set the compression.

Looks like I overlooked this part of your post.  I checked the zpool.cache file and it does exist, and looks like it has a timestamp that means it's been updated this eve.  When I Nano it, it looks like a binary file that I cannot read.  Is there something I should be doing to ensure it's not corrupted, and that is being updated correctly as you note?

 

On the second part, I ran "zfs get all | grep compression" and I see:

zfs get all | grep compression
ur2pool            compression           off                     local
ur2pool/hotBackup  compression           zstd-5                  local

 

When I run "modinfo zfs" I get a few pages of text.  Changing the command to be "modinfo zfs | grep comp" gets me:

modinfo zfs | grep comp
parm:           zio_slow_io_ms:Max I/O completion time (milliseconds) before marking it as slow (int)
parm:           zfs_sync_pass_dont_compress:Don't compress starting in this pass (int)
parm:           zfs_rebuild_scrub_enabled:Automatically scrub after sequential resilver completes (int)
parm:           zfs_compressed_arc_enabled:Disable compressed arc buffers (int)

 

If I try grep zstd, or grep lz4 I get no results.  Is there something specific I should be verifying or looking for here?

 

EDIT:  Can you explain what you mean by "otherwise you may need a go file / first array start script to set the compression."?

EDIT2:  I placed "zfs set compression=zstd-5 ur2pool" into my go file, but it had no impact:

zfs get compression
NAME               PROPERTY     VALUE           SOURCE
ur2pool            compression  on              local
ur2pool/hotBackup  compression  zstd-5          local

 

Thanks again @bmartino1,

Cal.

Edited by calvados

  • Author

Turns out this value "5" should not be set, as it is the quota for the dataset:

 

image.png.e88c1d7d39b55d4d4054937a874576fe.png.dc701949b9f2bc252fda2df574fa35af.png

  • Community Expert
4 hours ago, calvados said:

Turns out this value "5" should not be set, as it is the quota for the dataset:

 

image.png.e88c1d7d39b55d4d4054937a874576fe.png.dc701949b9f2bc252fda2df574fa35af.png

Thanks, Its been awhile, I didn't think that was right as trying to set a compression level.

as there were issues in the past with improting a zfspool from truenas to set some settings there that are hard to do on unraid.

 

ZFS Basic Terminal Commands for compression

https://www.unixtutorial.org/zfs-basics-enable-or-disable-compression/


in terms of the zfs.cache file if time is updated its fine. it's a more check if exist to confirm changes...
 

the pool compression is more or less contorted via unraids web ui. 
per your output, the datasets compression is leve5 zstd

as you may need to run the set compression levels via a user script at first array start. The go file is to early in the boot processes. this is why that failed.. So install and use the user script plugin.

 

 

Edited by bmartino1
Data - Typo

  • Author

Thank again @bmartino1.  I'll give this a try and let you know how it goes.

  • Community Expert

fyi unriad uses openzfs for its zfs stack adn disk management.

Due to kernel 6 and other software stack. opezfs isn't at lattest kernel 6 

 

 

Some feature may not be avable until openzfs supports that kerneal.

example. 

Similar with known issues in the release not on v7 rc1

not sure, but beta may have some things disabled.

https://docs.unraid.net/unraid-os/release-notes/7.0.0/#known-issues

 

thought I'd share. As this compression level should be working...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.