If one considers some of the filesystems that are now available in support of containers, and maybe even network filesystems such as NFS, a test of inodes will not work. I am not sure that there exists a 100%-certain way to do this that will work everywhere.