I have had some success using zfs send recv into a child of a  
compressed filesystem to do this although you have the disadvantage  
of losing your settings.

basically :
zfs create tank/foo
mv a bunch of files into foo
zfs create tank/bar
zfs set compression=on bar
zfs snapshot tank/[EMAIL PROTECTED]
zfs send tank/[EMAIL PROTECTED] | zfs recv tank/bar/foosmall
zfs destroy tank/foo
zfs set compression=on  tank/bar/foosmall
zfs rename tank/bar/foosmall tank/foo


kinda clunky and you have to have twice as much space available and  
there are probably other issues with it as I am not a pro zfs user  
here but, worked for me =)

Asa


On Jul 2, 2007, at 5:32 AM, Carson Gaspar wrote:

> roland wrote:
>
>> is there a reliable method of re-compressing a whole zfs volume  
>> after turning on compression or changing compression scheme ?
>
> It would be slow, and the file system would need to be idle to avoid
> race conditions, and it wouldn't be very fast,  but you _could_ do the
> following (POSIX shell syntax). I haven't tested this, so it could  
> have
> typos or other problems:
>
> find . -type f -print | while read n; do
>     TF="$(mktemp ${n%/*}/.tmpXXXXXX)"
>     if cp -p "$n" "$TF"; then
>         if ! mv "$TF" "$n"; then
>             echo "failed to re-write $n in mv"
>             rm "$TF"
>         fi
>     else
>         echo "failed to re-write $n in cp"
>         rm "$TF"
>     fi
> done
>
> -- 
> Carson
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss@opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss



_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to