> From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss- > boun...@opensolaris.org] On Behalf Of Edward Ned Harvey > > Look up the inode number of README. (for example, ls -i README) > (suppose its inode 12345) > find /tank/.zfs/snapshot -inum 12345 > > Problem is, the find command will run for a long time. > > Is there any faster way to find the file name(s) when all you know is > the inode number? (Actually, all you know is all the info thats in > the present directory, which is not limited to inode number; but, inode > number is the only information that I personally know could be useful.)
Due to lack of response, and based on my personal knowledge, and lack of any useful response anywhere else I've asked this question, I'm drawing the conclusion it's not possible to quickly lookup the name(s) of an inode. Which means in ZFS, if you want to find the previous snapshots of some file/directory that was renamed/moved, there are only two possibilities: Assume the name and location didn't change. So you can quickly "ls" or "stat" specific already-known name(s) in the snapshot directories. - or - Walk all the trees of all the snapshots searching for inode X. Which would be probably extremely slow. (Probably many hours to complete, in a typical small business fileserver, linearly dependent on number of files in the filesystem and number of snapshots to traverse.) BTW, this is not an issue for Ontap. Which is to say, yes it's absolutely possible to maintain reverse inode lookup tables too, but apparently not implemented in ... other filesystems including ZFS. I think an inode --> name lookup table would be useful in something like zhist. And it's one way of solving this problem without violating any Ontap-style .snapshot directory patents. So maybe this would be a good thing to request in future versions of ZFS. _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss