I was asked by a coworker about recovering destroyed datasets on ZFS - and whether it is possible at all? As a related question, if a filesystem dataset was recursively destroyed along with all its snapshots, is there some means to at least find some pointers whether it existed at all?
I remember "zpool import -D" can be used to import whole destroyed pools. But crawling around the disk with zdb did not yield any results so far. The colleague's situation in whole is as follows (although slightly an offtopic from ZFS forum's subject): 1) They have an OpenSolaris machine with some zones set up, each zone root being a filesystem dataset. Some zones also have delegated datasets for data. 2) The system was to be upgraded with liveupgrade. Apparently something did not go well during lucreate, so the botched ABE was ludelete'd. 3) During ludelete my colleague noticed some messages about inability to destroy some zones' ZFS pools because they are mounted (luckily, zones were booted), and aborted the ludelete operation. Apparently, ludelete attempts to roll back and destroy zfs-cloned zone roots. However, since they were not created by lucreate, it seems ludelete worked on the most recent FSes - being the live datasets. 4) Now, after the second liveupgrade went well, my colleague noticed that one of the zone's directories which had data, is now empty (directory mtime/ctime is dated last year, approximately when the system was set up). The zone has a delegated dataset and some sub-filesystems mounted off it. It is possible (he's not certain) that this now-empty directory was also a mounted sub-filesystem dataset in previous life, now all destroyed by ludelete. This zone was not mentioned among the errors of ludelete (inability to destroy), but that might not mean much: successful destructions would not give errors. On the other hand, (at least some) other FS'es of the delegated dataset are intact. Either he was lucky to abort ludelete before the whole zone was wasted, or ludelete hadn't approached it. Problem is, we seem to have no way of knowing whether there was a filesystem dataset in the first place. Nor whether there were some other such destroyed datasets, which haven't been noticed yet. Since the zfs mounts are not listed in vfstab, and zone snapshots were done when zones were down (so all available historical /etc/mnttabs don't list zfs mounts either), no files we have looked at point to these delegated datasets. The base delegated dataset was never mounted by itself, so it has no children's mountpoints either. So, to reiterate, the questions stand as: 1) Is it possible to find (with zdb or any other means) whether a specific zfs dataset has ever existed on the importable valid pool? 2) Is it possible to try and find and list all destroyed datasets on a pool? 3) Is it possible to recover a destroyed dataset as a whole, or its files (zdb -R) and/or pointers to file data (triplets which go as parameters to zdb -R)? //Thanks in advance, we're expecting a busy weekend ;( //Jim Klimov -- This message posted from opensolaris.org _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss