5

Suppose I created a pool with compression=on, and later wanted to turn off compression in-place - is that possible and if so how?

I'm using Zevo CE on OS X in case that makes any difference (zpool version 28).

GJ.
  • 529
  • 1
  • 7
  • 21

2 Answers2

8

Sure - zfs set compression=off pool/filesystem (or just zfs set compression=off pool for the pool's root filesystem).

Note that this does not go back and decompress data that's already been written - you'll need to re-write the data to do that (zfs send and zfs recv can help with this).

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
  • In this question I have tried the replication you mention, and I doesn't seam to work. http://serverfault.com/questions/654933/how-to-migrate-a-zfs-filesystem-to-use-compression – Jasmine Lognnes Dec 27 '14 at 13:13
  • Is there a way to enable compression AND have the OS perform the compression *inplace* within the same zpool/zfs? I don't have enough space to run send/recv on a second zfs. – Pavel Feb 19 '15 at 11:55
  • @Pavel Unfortunately, no - not that I know of. – Shane Madden Feb 19 '15 at 20:24
2

Yes, you can do this live. You can even change the compression type...

Remember the distinction between zfs pools and filesystems. Compression properties are set at the zfs filesystem level.

New data to the pool will be uncompressed if you turn it off.

May I ask why you're interested in disabling compression? The recommendation for ZFS is to leave compression ON unless you know your dataset if going to be comprised of non-compressible data (e.g. .tiff files or other media files).

ewwhite
  • 197,159
  • 92
  • 443
  • 809