ZFS - Uncompress raw LZ4 data

Adam Nowacki nowakpl at platinum.linux.pl
Fri Jan 31 18:53:23 UTC 2014


On 2014-01-31 12:11, Antonis Anastasiadis wrote:
> Hi everyone,
> 
> I'm trying to recover a deleted file from a single disk LZ4 compressed
> dataset. The pool is in fine condition.
> 
> I tried printing the uberblock history via zdb, but the file had been
> deleted before the oldest uberblock I could find. So I guess I can't
> roll back into that pool state.
> 
> The file was very small (90-120 kb) so it should fit in a single ZFS
> block. I do not know the deleted block's DVA in order to restore it via
> zdb -R. But I have similar files on the disk, so I can get the file header.
> 
> As a last resort, I'm thinking going brute force and somehow find all
> ZFS blocks (even deleted ones) from the raw partition, decompress the
> data and check the binary data for the file header. Is there a tool that
> decompresses raw LZ4 data out there? Max Bruning has written a utility
> called "zuncompress" but it doesn't support LZ4
> (http://mbruning.blogspot.gr/2009/12/zfs-raidz-data-walk.html)

You'll find the code to decompress in
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c,
LZ4_uncompress_unknownOutputSize.

> 
> I know 'm shooting in the dark here, but I would appreciate any other
> ideas from the ZFS gurus out there.
> 
> Thanks,
> 
> Antonis Anastasiadis
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
> 



More information about the freebsd-fs mailing list