Recover deleted file from ZFS snapshot (still viewable vith lsof)

zfs

I have a ZFS volume on a Linux Debian.
A snapshot is took each night on this volume.
For whatever reason, a big file (virtual disk) was deleted several days ago. This file is still in use (by kvm). lsof shows this file as deleted.

If I pause the kvm process, I can recover the deleted file with cp /proc/<pid>/fd/21 myfile.bak and use it in another virtual machine. But I don't need this current file.

I need the 2 days old version of this file.
As this file was deleted several days ago, it is not in the backups.
I think the file is present in the ZFS snapshots, but not sure. I don't see it in /zpool/.zfs/snapshotname/path/to/file

Does anyone knows a way to get a not-really-deleted file from a ZFS snapshot?

Best Answer

look in /zpool/.zfs/snapshot/$NAMEOFSNAPSHOT/path/to/file

Related Question