Everything2
Near Matches
Ignore Exact
Full Text
Everything2

inode

"inode" is also a: user, usergroup

created by iterative

(thing) by -brazil- (2.7 y) (print)   ?   (I like it!) Fri Jun 29 2001 at 9:48:26

Inodes are not necessarily a feature particular to unix-like operating systems. They are a distinctive feature of a particular family of file systems that is most often used under Unix.

An inode contains basically all the information about file, with one surprising exception: its name. Filenames are defined through directory entries, so the same file can appear in different places in the directory hiearchy, with different names (see hardlink).

Apart from meta information such as access times, the inode in modern filesystems (after the Berkeley FFS) also contains the numbers of the disk blocks that contain the actual file data - or the numbers of disk blocks that contain the numbers of disk blocks where the actual file data is, for larger files (there are also second and third levels of indirection, for really large files). This is important because it means you can access any position within a file with relatively little overhead - something that made the Berkeley FFS much faster than previous file systems.


(thing) by ssd (7.6 mon) (print)   ?   (I like it!) Tue Mar 12 2002 at 2:01:22

In unix, the inode is the central concept of the filesystem, and contains all the interesting file attributes, all of which can be read by the user using the stat or fstat system calls.

The inode also lists other data less interesting to the user that can't be read with stat, including the location of the first 12 data blocks of the file, and the first indirect, double indirect, and tripple indirect blocks. (The first indirect block is a list of the next BLOCKSIZE/4 blocks, and the first double indirect block is the list of the next BLOCKSIZE/4 indirect blocks, etc..., assuming 32 bit block numbers.) This pattern of direct and indirect blocks has not really changed since the first unix file system, and limits the maximum file size to (12+BLOCKSIZE/4 + (BLOCKSIZE/4)**2 + (BLOCKSIZE/4)**3) blocks, which is usually much larger than st_size anyway, so st_size limits the real maximum file size (if the size of your disk doesn't first).

The inode and indirect blocks contain all the metadata and attributes for the file. (The filename is not part of the file nor an attribute of the file in unix. Some files don't have names at all.) All files in unix have inodes; if the underlying filesystem does not have inodes, the file will still have one in memory. (Some unixes call an inode cached in memory a vnode.)

The inode may also contain other unix flavor specific information, such as fragmentation maps, extended attributes, or pointers to extended attributes.


printable version
chaos

UNIX file system layout ext2 filesystem basics vnode superblock
Unix hardlink Enter root password for maintenance BeOS
e2fsck /bin/rm stat VFAT
UFS metadata indole namei
hard link ext2 How to answer a telephone Pi in the Bible
How to Fall Out of Love As you graduate from college, you are the most conservative you will ever be ltools EFS
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes to live by:
American football
Our Exagmination Round His Factification for Incamination of Work in Progress
Bloom County
the world is gone, I must carry you
Frank Zappa
Arthur Dent's Eulogy for Douglas Adams
The Shawshank Redemption
Everything is relative, but some things are more relative than others
code red
There's a Hole in my Bucket
The Bride Stripped Bare by Her Bachelors, Even
Chronology of the Crusades
Homosexual adoption
New Writeups
Glowing Fish
Tualatin River(place)
The Jacket
Words of Advice(idea)
keepinitreal
Why buy the cow when you can get the milk for free?(idea)
John_Fox
Good Intentions Gone Wrong(person)
Cuckowski
Slavonic Princess(poetry)
Heitah
Posthumous Oscar(thing)
ignis_glaciesque
University of South Florida(place)
ignis_glaciesque
Flogstaskriket(idea)
liveforever
Caesar's last breath(idea)
dagnyswaggart
she wants to believe(personal)
antigravpussy
he doesn't know, but her eyes widen too far(thing)
dagnyswaggart
Wild tides guard her secrets(poetry)
Lord Brawl
Caesar's last breath(poetry)
locke baron
Forgotten things in space(fiction)
sitaraika
Colours(idea)
This page courtesy of The Everything Development Company