Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Inode
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Details== [[File:File table and inode table.svg|thumb|[[File descriptor]]s, file table and inode table in Unix<ref><!-- Inspired by, not coped from... -->{{Cite book|first=Maurice J.|last=Bach |date=1986 |title =The Design of the UNIX Operating System|publisher=Prentice Hall|page=94|bibcode=1986duos.book.....B }}</ref>]] A file system relies on data structures ''about'' the files, as opposed to the contents of that file. The former are called ''[[metadata]]''βdata that describes data. Each file is associated with an ''inode'', which is identified by an integer, often referred to as an ''i-number'' or ''inode number''. Inodes store information about files and directories (folders), such as file ownership, access mode (read, write, execute permissions), and file type. The data may be called stat data, in reference to the <code>[[stat (Unix)|stat]]</code> [[system call]] that provides the data to programs. The inode number indexes a table of inodes on the file system. From the inode number, the kernel's file system driver can access the inode contents, including the location of the file, thereby allowing access to the file. A file's inode number can be found using the <code>ls -i</code> command. The <code>ls -i</code> command prints the inode number in the first column of the report. On many older file systems, inodes are stored in one or more fixed-size areas that are set up at file system creation time, so the maximum number of inodes is fixed at file system creation, limiting the maximum number of files the file system can hold. A typical allocation heuristic for inodes in a file system is one inode for every 2K bytes contained in the filesystem.<ref>{{cite web |title=linfo |url=http://www.linfo.org/inode.html |website=The Linux Information Project |access-date=11 March 2020}}</ref> Some Unix-style file systems such as [[JFS (file system)|JFS]], [[XFS]], [[ZFS]], [[OpenZFS]], [[ReiserFS]], [[btrfs]], and [[APFS]] omit a fixed-size inode table, but must store equivalent data in order to provide equivalent capabilities. Common alternatives to the fixed-size table include [[B-tree]]s and the derived [[B+ tree]]s. File names and directory implications: * Inodes do not contain their [[hard link]] names, only other file metadata. * Unix directories are lists of association structures, each of which contains one filename and one inode number. * The file system driver must search a directory for a particular filename and then convert the filename to the correct corresponding inode number. The operating system kernel's in-memory representation of this data is called <code>struct inode</code> in [[Linux]]. Systems derived from [[BSD]] use the term <code>vnode</code> (the "v" refers to the kernel's [[virtual file system]] layer).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)