[OpenIndiana-discuss] ZFS restore from snapshot

Jim Klimov jimklimov at cos.ru
Mon Jun 4 10:20:46 UTC 2012


2012-06-03 8:14, Jay Heyl wrote:
> I have a file that shows as corrupted in the live file system and two
> snapshots. The file gives every indication of being valid in earlier
> snapshots. I've tried to restore it from the good snapshot but it doesn't
> seem to want to take. After several failed attempts to copy directly from
> the snapshot, I copied from the snapshot to my home directory. That copy
> appears to be good. (It's an image file and the image comes up fine.) I've
> deleted the file from the live directory and it seems to disappear. But
> every time I copy the file from my home directory into the target
> directory, the target directory copy appears corrupted.

Does your filesystem use dedup? If so, I discussed a bug
earlier this year, which would cause similar corruption.

If this is a likely cause, try to disable dedup, restore
(copy) the file, destroy the bad copy (if deduped - check
and fix all instances similarly) and scrub/clear the pool.
If you need the file(s) deduped, you can later enable dedup
and copy the file(s) over again - data would become deduped
upon write.

Anyhow, do the scrub as suggested - this might help (or
in case of the bug I dealt with - it could cause a kernel
panic when the zfs iteration hits the corrupt block and
tries to free it a few times too many; fix was in the
works). Some workarounds were possible for me at that
time with a manually recompiled kernel to allow leaking
the blocks so they don't bother the ZFS block tree as
invalid corruptions ;)

HTH,
//Jim Klimov



More information about the OpenIndiana-discuss mailing list