2012-07-12 14:20, RichTea wrote:
I meant to use dd to copy an image (around 500Mb) to a USB disk but
instead wrote over a non raided zfs disk!

Below is various status output's: My question is how after a reboot did
the disk / zpool recover with from what I have seen so far no corruption
at all?

Well, from your outputs I can't say there are no corruptions -
the pool is suspended, its device is unavailable and partitions
are screwed ;)

How did you decide it is okay and that zfs saved you? Did you
NOT post some further progress in your recovery?

Purely speculating, I might however suggest that your disk was
dedicated to the pool completely, so its last blocks contain
spare uberblocks (zpool labels) and that might help ZFS detect
and import the pool - if it did indeed. Further on, this label
refers to the current root of blockpointer (metadata) tree,
which is stored with double or sometimes triple redundancy,
so much of you metadata which you tried reading is indeed
readable from at least one copy.

Likely some data was overwritten by your actions and lost,
but you can only detect that by trying to read all data from
the pool. If the checksums of read-in blocks mismatch the
expectations from block-pointers, ZFS will know there are
errors or even losses.
For example, "zpool scrub" does just that - so you should
run that on your pool, if it is now importable to you.

Good luck, HTH,
//Jim Klimov
zfs-discuss mailing list

Reply via email to