Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Almost everybody with some Linux experience knows that the file name is not stored on the inode. It's not this part that makes the question bad.

What makes the question bad is that nobody can guess what answer he wants, and anything else, as correct as it may be, will be understood as a mistake (what is evident by the OP's answers that were perfectly correct).

"What number am I thinking right now" may be a really strict question that fails your expected number of people, but it's not a good interview question.



My first linux install was Redhat 5.2 bought at a bookstore in ~1997. I have not always been a primary linux user, but I have been using it in some capacity for over 20 years now- though as a means to an end primarily- in the bad old days I mucked around with drivers and X configs and have even recompiled a custom kernel on occasion. Never once has it come up that the filename is not stored in the inode.

I am actually just curious as to why this would ever even be a thing you come across unless dealing with filesystems directly?


You'd never need to know anything about it as a user. I don't know how anyone could seriously make the argument otherwise.

In fact the only reason I know anything about inode and dentry specifics is because they are 'very clever' interviewer favorites! I've been a professional UNIX admin for 15 years and I've dealt with inode issues literally once in my life lol


Thanks. Its comments like the GPs that makes me wonder how I have avoided learning some very commonplace issue and its these types of comments that foment imposter syndrome.

I have even read books on linux architecture and remember discussions about filesystems and inodes and remember the general structure and form, but a detail around what is and what is not stored in the actual inode... seems like an absurd detail to memorize.

The only way I could see this being commonplace is if I somehow missed out on a widespread bug that somehow caused inodes to be corrupted and requiring manual intervention/surgery to prevent data loss.


It's easy to remember that inode = the stuff that shows up in 'ls -l'


Probably the most common case where this comes up is in the context of hard links: two (or more) files with different names that point to the same inode. I guess actual usage of hard links is rare enough that it doesn't come up all that often, but I'm actually surprised you didn't know this – not judging you, just something I thought most more experienced Linux/Unix users knew, but it seems not.

Hard links can be a somewhat notorious footgun due to this by the way; with a soft link you know you're only deleting a link, but with "rm hard-link" this is a bit trickier: if you think there's another link but actually, it turns out you made an error and there's not then you've lost that file. A "hard link" isn't really a thing on its own: it's just another reference to an inode. This is why symbolic links are used in most cases, but you can hard links are still used from time to time in e.g. /bin and some other places.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: