[Blog] NFS Strangeness - Duplicate inodes / file names

Craig Maloney at 2017-11-25T16:00:07Z

(http://feedproxy.google.com/~r/CraigMaloney/~3/Pd9QknRqj2Y/)

I just noticed some strangeness in a NFS mounted device on my Ubuntu machine.

I have duplicity running on my machines to back up to a few Synology Diskstation RAID devices. Recently I noticed that Duplicity was complaining about an assertion error. I now realize that it was complaining about having two files with the same name on the drive.

I did some digging this morning and noticed that two files were sharing the same name / inode. I did a ls -i and got the inode of the files (they were the same):

root@lister:/mnt/backup_music/backup_files/music# find . -inum 9306120
./duplicity-full.20171011T090009Z.vol4554.difftar.gz
./duplicity-full.20171011T090009Z.vol4554.difftar.gz

Huh. What's going on here?

I immediately thought "well, I'll need to fsck the disk" but then I rmembered that you can't fsck an NFS mount. So I logged into the Synology Diskstation to see if it was showing two files. To my surprise the Synology didn't show anything was awry.

After a little poking and prodding online I wondered what would happen if I renamed the file:

mv duplicity-full.20171011T090009Z.vol4554.difftar.gz duplicity-full.20171011T090009Z.vol4554.difftar.gz.old

and then rename it back:

mv duplicity-full.20171011T090009Z.vol4554.difftar.gz.old duplicity-full.20171011T090009Z.vol4554.difftar.gz

That seemed to work. ls -i shows one file.

But here's the strange part: That find command? Still shows two files pointing at the same file.

I'm wondering if it'll survive a re-mount / reboot.

[Time passes]

Yep. Looks like there's still something in NFS that thinks there's still two files with the same inode, but only one file in ls.

I'm a little stumped on how to ultimately fix this (save for a complete "nuke it from orbit" reformatting. And that's no guarantee that it won't come back.

If you have some ideas on what's going on (I'm pretty sure it's a buggy NFS issue as this has shown up before) I'd love to know. Better yet: if you know how to fix this that wold be awesome as well.