inode #1

Ed Gould ed at mtxinu.COM
Sat Apr 15 11:09:14 AEST 1989


>>Can anyone tell me why inode 1 is not used anywhere ?

>I heard a terrific explanation of this at the Winter Usenix. During a
>Sys5 tutorial, the speaker, who was from AT&T and apparantly very close 
>to the code, relayed the following story as an explanation for starting
>everything at inode 2:

>Back when Unix was being developed (while everyone else was banging rocks
>together :-), one of the guys wanted to prove that there were no 'magic
>cookies' in his code. At this time, inode 1 WAS the first inode used. To
>prove his point, he changed the definition of the first inode to be '2'.
>Well, he was right, everything worked fine. Problem is ... nobody set it
>back to '1' !!!

This is rediculous, and the stuff of which urban legends are made.

In the Sixth Edition and before, inode 1 was indeed the root of the
file system.  When the file system was modified (one of the changes
between the Sixth and Seventh edition), the root was moved to inode 2,
and inode 1 was reserved for bad block handling.  This method of
bad block management was never widely implemented, if anyone ever actually
did it at all.

The notion that there were "no magic cookies" might be interestig, but
does not relate to inode numbers.  There are certainly constants in Unix
that are difficult to change, even though they are always referenced
by name.

-- 
Ed Gould                    mt Xinu, 2560 Ninth St., Berkeley, CA  94710  USA
ed at mtxinu.COM		    +1 415 644 0146

"I'll fight them as a woman, not a lady.  I'll fight them as an engineer."



More information about the Comp.unix.wizards mailing list