How to verify that the Photos and iPhoto library are hard linking to the same disk data

hard driveiphotophotos.appstorage

So I've discovered Apple's mystical implementation of hard linking with the new Photos app library and the old iPhoto library. Although Finder reports that both take up a significant and similar number of GBs on the disk space, they apparently are pointing to the same data on my disk, so data hasn't been duplicated.

Question is, how can I verify this? If I check the size of the parent folder, it's also reporting double GB. I imagine I can check all the folders at the root level and find that the total adds up to more than what I have based on free space… but that doesn't actually pinpoint what files are hard linking.

Best Answer

Hard linked files share the same inode (which kind of identifies the file in the filesystem). So what you can do is to get the path of two photos which should be the same ("Reveal in Finder" in the old application, probably something similar in the new), open Terminal and run

ls -li /path/from/old/app.jpg /path/from/new/app.jpg

to see whether the number is really the same.