Hi guys, You can enable compression on a (ZFS) filesystem when already filled with files. However, it is my understanding that the previously-existing files are not compressed, only the file added afterwards. Is there any way to force a "recompression" of the existing files not already compressed? And of course, same stuff for the other way around (when disabling compression). Thanks
J?r?me Warnier wrote:> Hi guys, > > You can enable compression on a (ZFS) filesystem when already filled > with files. However, it is my understanding that the previously-existing > files are not compressed, only the file added afterwards. > Is there any way to force a "recompression" of the existing files not > already compressed?Currently no simple way to do it. You basically have to rewrite every block of every file. A reasonably safe and simple way to do it is like this, however this assumes you have sufficient space. First set the new value for compression. zfs set compression=on tank/fs Send a snapshot to a temporary name zfs snapshot tank/fs at 1 zfs send -R tank/fs at 1 | zfs recv -vFd tank/fs-recompressed Mark the original as readonly and send anything newly written since the ''zfs send'' above started. zfs set readonly=on tank/fs zfs snapshot tank/fs at 2 zfs send -i tank/fs at 1 tank/fs at 2 | zfs recv -v tank/fs-recompressed Now delete the original and rename the newone into its place. zfs delete tank/fs zfs rename tank/fs-recompressed tank/fs Note that the new tank/fs will have all the the snapshots of the original as well since -R was used with the zfs send. -- Darren J Moffat
On Tue, Aug 25, 2009 at 5:07 AM, Darren J Moffat<darrenm at opensolaris.org> wrote:> A reasonably safe and simple way to do it is like this, however this > assumes you have sufficient space. > > First set the new value for compression.Can this be used to enable normalization on a filesystem too? I have a filesystem that should have been created with utf8only and normalization enabled, but ... well wasn''t. These can only be changed when the fs is created, so do I need to create a new fs and rsync, losing all my snapshots, or will a send | recv pipe help? -B -- Brandon High : bhigh at freaks.com