Emergency - restore a deleted zfs snapshot

Hi, I deleted a zfs snapshot because it was as big as the original zfs. After the snapshot was removed, all the data in the original zfs is gone. How this happened? Can I restore the snapshot? Please help. Thanks a lot!

How did you delete the snapshot? Using zfs destroy?

Yes. I used zfs destroy.

Anyway to get it back?

It would help if you provide more details about what you (really) did. Destroying a snapshot shouldn't have destroyed the associated file system.

Please post the last lines of:

zpool history 

Here is what I've found:

Before deleting the snapshot, both the original ZFS Z and its snapshot showed 130 GB used. After Z's snapshot was deleted, Z shows 500KB used.

Actually our DBA removed almost all of the data in Z. That must be why the snapshot showed as much space as Z used.

After its snapshot was deleted, Z was nearly empty.

Make sense??

Btw, 'zpool history' does not show zfs command history.

Okay, so as I suspected almost all of the data was removed from the Z file system. As long as you were having a snapshot available, the removed data was still on disk and reachable through it. Destroying the snapshot was the bad move. There is probably not that much you can do now (easily) to recover your data. Perhaps something could have been done should you have exported the pool immediately after the zfs destroy.

meaning you aren't running a recent Solaris 10 update. I believe logging zfs logging was added four years ago.

1 Like