inode numbers

Guy Harris guy at sun.uucp
Thu Jun 6 15:06:38 AEST 1985


> Can anyone tell me what inode number 1 is?  I know 2 is root, and 0 is
> the superblock, but I can't figure out what 1 is.

Inode 0 isn't the superblock; there is no inode 0 (some UNIX implementations
have a slot 0 in the ilist, but it's unused).

Inode 1 is the "bad-block" inode.  If you look at the "mkfs" code, it was
intended that when you built a file system you could specify a set of bad
blocks.  These would be the "data" blocks of inode 1; "dump" starts with
inode 2, so it won't try to read the blocks of inode 1 (and get I/O errors).
(This same idea appears in other file systems, like DEC's FILES-11.)
However, the routine in "mkfs" which says whether a block is bad or not
always says the block is good, so the bad block file is always zero-length.
(Also, "fsck" would have to be taught that this file should not have any
links to it, and that it shouldn't complain if it doesn't or make a link to
it in lost+found.)

	Guy Harris



More information about the Comp.unix.wizards mailing list