sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget$/translations/zh_CN/filesystems/ext2modnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/zh_TW/filesystems/ext2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/it_IT/filesystems/ext2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ja_JP/filesystems/ext2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ko_KR/filesystems/ext2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/sp_SP/filesystems/ext2modnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh>/var/lib/git/docbuild/linux/Documentation/filesystems/ext2.rsthKubhsection)}(hhh](htitle)}(hThe Second Extended Filesystemh]hThe Second Extended Filesystem}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hX]ext2 was originally released in January 1993. Written by R\'emy Card, Theodore Ts'o and Stephen Tweedie, it was a major rewrite of the Extended Filesystem. It is currently still (April 2001) the predominant filesystem in use by Linux. There are also implementations available for NetBSD, FreeBSD, the GNU HURD, Windows 95/98/NT, OS/2 and RISC OS.h]hX_ext2 was originally released in January 1993. Written by R'emy Card, Theodore Ts’o and Stephen Tweedie, it was a major rewrite of the Extended Filesystem. It is currently still (April 2001) the predominant filesystem in use by Linux. There are also implementations available for NetBSD, FreeBSD, the GNU HURD, Windows 95/98/NT, OS/2 and RISC OS.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hOptionsh]hOptions}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hMost defaults are determined by the filesystem superblock, and can be set using tune2fs(8). Kernel-determined defaults are indicated by (*).h]hMost defaults are determined by the filesystem superblock, and can be set using tune2fs(8). Kernel-determined defaults are indicated by (*).}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhhubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhhubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK0uh1jhhubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(hbsddfh]hbsddf}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj.ubah}(h]h ]h"]h$]h&]uh1j,hj)ubj-)}(hhh]h)}(h(*)h]h(*)}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjEubah}(h]h ]h"]h$]h&]uh1j,hj)ubj-)}(hhh]h)}(hMakes ``df`` act like BSD.h](hMakes }(hj_hhhNhNubhliteral)}(h``df``h]hdf}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jghj_ubh act like BSD.}(hj_hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj\ubah}(h]h ]h"]h$]h&]uh1j,hj)ubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hminixdfh]hminixdf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(hMakes ``df`` act like Minix.h](hMakes }(hjhhhNhNubjh)}(h``df``h]hdf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jghjubh act like Minix.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hcheck=none, nocheckh]hcheck=none, nocheck}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h(*)h]h(*)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h[Don't do extra checking of bitmaps on mount (check=normal and check=strict options removed)h]h]Don’t do extra checking of bitmaps on mount (check=normal and check=strict options removed)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hdaxh]hdax}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj0ubah}(h]h ]h"]h$]h&]uh1j,hj-ubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hj-ubj-)}(hhh]h)}(hJUse direct access (no page cache). See Documentation/filesystems/dax.rst.h]hJUse direct access (no page cache). See Documentation/filesystems/dax.rst.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjPubah}(h]h ]h"]h$]h&]uh1j,hj-ubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hdebugh]hdebug}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjpubah}(h]h ]h"]h$]h&]uh1j,hjmubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjmubj-)}(hhh]h)}(hQExtra debugging information is sent to the kernel syslog. Useful for developers.h]hQExtra debugging information is sent to the kernel syslog. Useful for developers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjmubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(herrors=continueh]herrors=continue}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h!Keep going on a filesystem error.h]h!Keep going on a filesystem error.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(herrors=remount-roh]herrors=remount-ro}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK"hjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h-Remount the filesystem read-only on an error.h]h-Remount the filesystem read-only on an error.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK"hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(h errors=panich]h errors=panic}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hj0ubah}(h]h ]h"]h$]h&]uh1j,hj-ubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hj-ubj-)}(hhh]h)}(h.Panic and halt the machine if an error occurs.h]h.Panic and halt the machine if an error occurs.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjPubah}(h]h ]h"]h$]h&]uh1j,hj-ubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hgrpid, bsdgroupsh]hgrpid, bsdgroups}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjpubah}(h]h ]h"]h$]h&]uh1j,hjmubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjmubj-)}(hhh]h)}(h/Give objects the same group ID as their parent.h]h/Give objects the same group ID as their parent.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjubah}(h]h ]h"]h$]h&]uh1j,hjmubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hnogrpid, sysvgroupsh]hnogrpid, sysvgroups}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h/New objects have the group ID of their creator.h]h/New objects have the group ID of their creator.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hnouid32h]hnouid32}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(hUse 16-bit UIDs and GIDs.h]hUse 16-bit UIDs and GIDs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(holdalloch]holdalloc}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hj0ubah}(h]h ]h"]h$]h&]uh1j,hj-ubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hj-ubj-)}(hhh]h)}(hEnable the old block allocator. Orlov should have better performance, we'd like to get some feedback if it's the contrary for you.h]hEnable the old block allocator. Orlov should have better performance, we’d like to get some feedback if it’s the contrary for you.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjPubah}(h]h ]h"]h$]h&]uh1j,hj-ubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(horlovh]horlov}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjpubah}(h]h ]h"]h$]h&]uh1j,hjmubj-)}(hhh]h)}(h(*)h]h(*)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjubah}(h]h ]h"]h$]h&]uh1j,hjmubj-)}(hhh]h)}(hgUse the Orlov block allocator. (See http://lwn.net/Articles/14633/ and http://lwn.net/Articles/14446/.)h](h$Use the Orlov block allocator. (See }(hjhhhNhNubh reference)}(hhttp://lwn.net/Articles/14633/h]hhttp://lwn.net/Articles/14633/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubh and }(hjhhhNhNubj)}(hhttp://lwn.net/Articles/14446/h]hhttp://lwn.net/Articles/14446/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubh.)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK-hjubah}(h]h ]h"]h$]h&]uh1j,hjmubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hresuid=nh]hresuid=n}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h.The user ID which may use the reserved blocks.h]h.The user ID which may use the reserved blocks.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hresgid=nh]hresgid=n}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hj&ubah}(h]h ]h"]h$]h&]uh1j,hj#ubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hj#ubj-)}(hhh]h)}(h/The group ID which may use the reserved blocks.h]h/The group ID which may use the reserved blocks.}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjFubah}(h]h ]h"]h$]h&]uh1j,hj#ubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hsb=nh]hsb=n}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjfubah}(h]h ]h"]h$]h&]uh1j,hjcubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjcubj-)}(hhh]h)}(h*Use alternate superblock at this location.h]h*Use alternate superblock at this location.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1j,hjcubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(h user_xattrh]h user_xattr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(hIEnable "user." POSIX Extended Attributes (requires CONFIG_EXT2_FS_XATTR).h]hMEnable “user.” POSIX Extended Attributes (requires CONFIG_EXT2_FS_XATTR).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(h nouser_xattrh]h nouser_xattr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h*Don't support "user." extended attributes.h]h0Don’t support “user.” extended attributes.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(haclh]hacl}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hj&ubah}(h]h ]h"]h$]h&]uh1j,hj#ubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hj#ubj-)}(hhh]h)}(hNEnable POSIX Access Control Lists support (requires CONFIG_EXT2_FS_POSIX_ACL).h]hNEnable POSIX Access Control Lists support (requires CONFIG_EXT2_FS_POSIX_ACL).}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjFubah}(h]h ]h"]h$]h&]uh1j,hj#ubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hnoaclh]hnoacl}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h7Enable user disk quota support (requires CONFIG_QUOTA).h]h7Enable user disk quota support (requires CONFIG_QUOTA).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubj()}(hhh](j-)}(hhh]h)}(hgrpquotah]hgrpquota}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h8Enable group disk quota support (requires CONFIG_QUOTA).h]h8Enable group disk quota support (requires CONFIG_QUOTA).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hj$ubeh}(h]h ]h"]h$]h&]uh1j"hhubeh}(h]h ]h"]h$]h&]colsKuh1hhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(h+noquota option ls silently ignored by ext2.h]h+noquota option ls silently ignored by ext2.}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhhhhubeh}(h]optionsah ]h"]optionsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Specificationh]h Specification}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLhhhhhKIubh)}(hXext2 shares many properties with traditional Unix filesystems. It has the concepts of blocks, inodes and directories. It has space in the specification for Access Control Lists (ACLs), fragments, undeletion and compression though these are not yet implemented (some are available as separate patches). There is also a versioning mechanism to allow new features (such as journalling) to be added in a maximally compatible manner.h]hXext2 shares many properties with traditional Unix filesystems. It has the concepts of blocks, inodes and directories. It has space in the specification for Access Control Lists (ACLs), fragments, undeletion and compression though these are not yet implemented (some are available as separate patches). There is also a versioning mechanism to allow new features (such as journalling) to be added in a maximally compatible manner.}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhjLhhubh)}(hhh](h)}(hBlocksh]hBlocks}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjkhhhhhKTubh)}(hXcThe space in the device or file is split up into blocks. These are a fixed size, of 1024, 2048 or 4096 bytes (8192 bytes on Alpha systems), which is decided when the filesystem is created. Smaller blocks mean less wasted space per file, but require slightly more accounting overhead, and also impose other limits on the size of files and the filesystem.h]hXcThe space in the device or file is split up into blocks. These are a fixed size, of 1024, 2048 or 4096 bytes (8192 bytes on Alpha systems), which is decided when the filesystem is created. Smaller blocks mean less wasted space per file, but require slightly more accounting overhead, and also impose other limits on the size of files and the filesystem.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhjkhhubeh}(h]blocksah ]h"]blocksah$]h&]uh1hhjLhhhhhKTubh)}(hhh](h)}(h Block Groupsh]h Block Groups}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK]ubh)}(hX8Blocks are clustered into block groups in order to reduce fragmentation and minimise the amount of head seeking when reading a large amount of consecutive data. Information about each block group is kept in a descriptor table stored in the block(s) immediately after the superblock. Two blocks near the start of each group are reserved for the block usage bitmap and the inode usage bitmap which show which blocks and inodes are in use. Since each bitmap is limited to a single block, this means that the maximum size of a block group is 8 times the size of a block.h]hX8Blocks are clustered into block groups in order to reduce fragmentation and minimise the amount of head seeking when reading a large amount of consecutive data. Information about each block group is kept in a descriptor table stored in the block(s) immediately after the superblock. Two blocks near the start of each group are reserved for the block usage bitmap and the inode usage bitmap which show which blocks and inodes are in use. Since each bitmap is limited to a single block, this means that the maximum size of a block group is 8 times the size of a block.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjhhubh)}(hXThe block(s) following the bitmaps in each block group are designated as the inode table for that block group and the remainder are the data blocks. The block allocation algorithm attempts to allocate data blocks in the same block group as the inode which contains them.h]hXThe block(s) following the bitmaps in each block group are designated as the inode table for that block group and the remainder are the data blocks. The block allocation algorithm attempts to allocate data blocks in the same block group as the inode which contains them.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjhhubeh}(h] block-groupsah ]h"] block groupsah$]h&]uh1hhjLhhhhhK]ubh)}(hhh](h)}(hThe Superblockh]hThe Superblock}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKnubh)}(hX The superblock contains all the information about the configuration of the filing system. The primary copy of the superblock is stored at an offset of 1024 bytes from the start of the device, and it is essential to mounting the filesystem. Since it is so important, backup copies of the superblock are stored in block groups throughout the filesystem. The first version of ext2 (revision 0) stores a copy at the start of every block group, along with backups of the group descriptor block(s). Because this can consume a considerable amount of space for large filesystems, later revisions can optionally reduce the number of backup copies by only putting backups in specific groups (this is the sparse superblock feature). The groups chosen are 0, 1 and powers of 3, 5 and 7.h]hX The superblock contains all the information about the configuration of the filing system. The primary copy of the superblock is stored at an offset of 1024 bytes from the start of the device, and it is essential to mounting the filesystem. Since it is so important, backup copies of the superblock are stored in block groups throughout the filesystem. The first version of ext2 (revision 0) stores a copy at the start of every block group, along with backups of the group descriptor block(s). Because this can consume a considerable amount of space for large filesystems, later revisions can optionally reduce the number of backup copies by only putting backups in specific groups (this is the sparse superblock feature). The groups chosen are 0, 1 and powers of 3, 5 and 7.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjhhubh)}(hXuThe information in the superblock contains fields such as the total number of inodes and blocks in the filesystem and how many are free, how many inodes and blocks are in each block group, when the filesystem was mounted (and if it was cleanly unmounted), when it was modified, what version of the filesystem it is (see the Revisions section below) and which OS created it.h]hXuThe information in the superblock contains fields such as the total number of inodes and blocks in the filesystem and how many are free, how many inodes and blocks are in each block group, when the filesystem was mounted (and if it was cleanly unmounted), when it was modified, what version of the filesystem it is (see the Revisions section below) and which OS created it.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjhhubh)}(hIf the filesystem is revision 1 or higher, then there are extra fields, such as a volume name, a unique identification number, the inode size, and space for optional filesystem features to store configuration info.h]hIf the filesystem is revision 1 or higher, then there are extra fields, such as a volume name, a unique identification number, the inode size, and space for optional filesystem features to store configuration info.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hAll fields in the superblock (as in all other ext2 structures) are stored on the disc in little endian format, so a filesystem is portable between machines without having to know what machine it was created on.h]hAll fields in the superblock (as in all other ext2 structures) are stored on the disc in little endian format, so a filesystem is portable between machines without having to know what machine it was created on.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]the-superblockah ]h"]the superblockah$]h&]uh1hhjLhhhhhKnubh)}(hhh](h)}(hInodesh]hInodes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX:The inode (index node) is a fundamental concept in the ext2 filesystem. Each object in the filesystem is represented by an inode. The inode structure contains pointers to the filesystem blocks which contain the data held in the object and all of the metadata about an object except its name. The metadata about an object includes the permissions, owner, group, flags, size, number of blocks used, access time, change time, modification time, deletion time, number of links, fragments, version (for NFS) and extended attributes (EAs) and/or Access Control Lists (ACLs).h]hX:The inode (index node) is a fundamental concept in the ext2 filesystem. Each object in the filesystem is represented by an inode. The inode structure contains pointers to the filesystem blocks which contain the data held in the object and all of the metadata about an object except its name. The metadata about an object includes the permissions, owner, group, flags, size, number of blocks used, access time, change time, modification time, deletion time, number of links, fragments, version (for NFS) and extended attributes (EAs) and/or Access Control Lists (ACLs).}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThere are some reserved fields which are currently unused in the inode structure and several which are overloaded. One field is reserved for the directory ACL if the inode is a directory and alternately for the top 32 bits of the file size if the inode is a regular file (allowing file sizes larger than 2GB). The translator field is unused under Linux, but is used by the HURD to reference the inode of a program which will be used to interpret this object. Most of the remaining reserved fields have been used up for both Linux and the HURD for larger owner and group fields, The HURD also has a larger mode field so it uses another of the remaining fields to store the extra more bits.h]hXThere are some reserved fields which are currently unused in the inode structure and several which are overloaded. One field is reserved for the directory ACL if the inode is a directory and alternately for the top 32 bits of the file size if the inode is a regular file (allowing file sizes larger than 2GB). The translator field is unused under Linux, but is used by the HURD to reference the inode of a program which will be used to interpret this object. Most of the remaining reserved fields have been used up for both Linux and the HURD for larger owner and group fields, The HURD also has a larger mode field so it uses another of the remaining fields to store the extra more bits.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXcThere are pointers to the first 12 blocks which contain the file's data in the inode. There is a pointer to an indirect block (which contains pointers to the next set of blocks), a pointer to a doubly-indirect block (which contains pointers to indirect blocks) and a pointer to a trebly-indirect block (which contains pointers to doubly-indirect blocks).h]hXeThere are pointers to the first 12 blocks which contain the file’s data in the inode. There is a pointer to an indirect block (which contains pointers to the next set of blocks), a pointer to a doubly-indirect block (which contains pointers to indirect blocks) and a pointer to a trebly-indirect block (which contains pointers to doubly-indirect blocks).}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe flags field contains some ext2-specific flags which aren't catered for by the standard chmod flags. These flags can be listed with lsattr and changed with the chattr command, and allow specific filesystem behaviour on a per-file basis. There are flags for secure deletion, undeletable, compression, synchronous updates, immutability, append-only, dumpable, no-atime, indexed directories, and data-journaling. Not all of these are supported yet.h]hXThe flags field contains some ext2-specific flags which aren’t catered for by the standard chmod flags. These flags can be listed with lsattr and changed with the chattr command, and allow specific filesystem behaviour on a per-file basis. There are flags for secure deletion, undeletable, compression, synchronous updates, immutability, append-only, dumpable, no-atime, indexed directories, and data-journaling. Not all of these are supported yet.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]inodesah ]h"]inodesah$]h&]uh1hhjLhhhhhKubh)}(hhh](h)}(h Directoriesh]h Directories}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihhhhhKubh)}(hXA directory is a filesystem object and has an inode just like a file. It is a specially formatted file containing records which associate each name with an inode number. Later revisions of the filesystem also encode the type of the object (file, directory, symlink, device, fifo, socket) to avoid the need to check the inode itself for this information (support for taking advantage of this feature does not yet exist in Glibc 2.2).h]hXA directory is a filesystem object and has an inode just like a file. It is a specially formatted file containing records which associate each name with an inode number. Later revisions of the filesystem also encode the type of the object (file, directory, symlink, device, fifo, socket) to avoid the need to check the inode itself for this information (support for taking advantage of this feature does not yet exist in Glibc 2.2).}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjihhubh)}(hThe inode allocation code tries to assign inodes which are in the same block group as the directory in which they are first created.h]hThe inode allocation code tries to assign inodes which are in the same block group as the directory in which they are first created.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjihhubh)}(hThe current implementation of ext2 uses a singly-linked list to store the filenames in the directory; a pending enhancement uses hashing of the filenames to allow lookup without the need to scan the entire directory.h]hThe current implementation of ext2 uses a singly-linked list to store the filenames in the directory; a pending enhancement uses hashing of the filenames to allow lookup without the need to scan the entire directory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjihhubh)}(hqThe current implementation never removes empty directory blocks once they have been allocated to hold more files.h]hqThe current implementation never removes empty directory blocks once they have been allocated to hold more files.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjihhubeh}(h] directoriesah ]h"] directoriesah$]h&]uh1hhjLhhhhhKubh)}(hhh](h)}(h Special filesh]h Special files}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXSymbolic links are also filesystem objects with inodes. They deserve special mention because the data for them is stored within the inode itself if the symlink is less than 60 bytes long. It uses the fields which would normally be used to store the pointers to data blocks. This is a worthwhile optimisation as it we avoid allocating a full block for the symlink, and most symlinks are less than 60 characters long.h]hXSymbolic links are also filesystem objects with inodes. They deserve special mention because the data for them is stored within the inode itself if the symlink is less than 60 bytes long. It uses the fields which would normally be used to store the pointers to data blocks. This is a worthwhile optimisation as it we avoid allocating a full block for the symlink, and most symlinks are less than 60 characters long.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hCharacter and block special devices never have data blocks assigned to them. Instead, their device number is stored in the inode, again reusing the fields which would be used to point to the data blocks.h]hCharacter and block special devices never have data blocks assigned to them. Instead, their device number is stored in the inode, again reusing the fields which would be used to point to the data blocks.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] special-filesah ]h"] special filesah$]h&]uh1hhjLhhhhhKubh)}(hhh](h)}(hReserved Spaceh]hReserved Space}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXIn ext2, there is a mechanism for reserving a certain number of blocks for a particular user (normally the super-user). This is intended to allow for the system to continue functioning even if non-privileged users fill up all the space available to them (this is independent of filesystem quotas). It also keeps the filesystem from filling up entirely which helps combat fragmentation.h]hXIn ext2, there is a mechanism for reserving a certain number of blocks for a particular user (normally the super-user). This is intended to allow for the system to continue functioning even if non-privileged users fill up all the space available to them (this is independent of filesystem quotas). It also keeps the filesystem from filling up entirely which helps combat fragmentation.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]reserved-spaceah ]h"]reserved spaceah$]h&]uh1hhjLhhhhhKubh)}(hhh](h)}(hFilesystem checkh]hFilesystem check}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hXAt boot time, most systems run a consistency check (e2fsck) on their filesystems. The superblock of the ext2 filesystem contains several fields which indicate whether fsck should actually run (since checking the filesystem at boot can take a long time if it is large). fsck will run if the filesystem was not cleanly unmounted, if the maximum mount count has been exceeded or if the maximum time between checks has been exceeded.h]hXAt boot time, most systems run a consistency check (e2fsck) on their filesystems. The superblock of the ext2 filesystem contains several fields which indicate whether fsck should actually run (since checking the filesystem at boot can take a long time if it is large). fsck will run if the filesystem was not cleanly unmounted, if the maximum mount count has been exceeded or if the maximum time between checks has been exceeded.}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h]filesystem-checkah ]h"]filesystem checkah$]h&]uh1hhjLhhhhhKubh)}(hhh](h)}(hFeature Compatibilityh]hFeature Compatibility}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj= hhhhhKubh)}(hX The compatibility feature mechanism used in ext2 is sophisticated. It safely allows features to be added to the filesystem, without unnecessarily sacrificing compatibility with older versions of the filesystem code. The feature compatibility mechanism is not supported by the original revision 0 (EXT2_GOOD_OLD_REV) of ext2, but was introduced in revision 1. There are three 32-bit fields, one for compatible features (COMPAT), one for read-only compatible (RO_COMPAT) features and one for incompatible (INCOMPAT) features.h]hX The compatibility feature mechanism used in ext2 is sophisticated. It safely allows features to be added to the filesystem, without unnecessarily sacrificing compatibility with older versions of the filesystem code. The feature compatibility mechanism is not supported by the original revision 0 (EXT2_GOOD_OLD_REV) of ext2, but was introduced in revision 1. There are three 32-bit fields, one for compatible features (COMPAT), one for read-only compatible (RO_COMPAT) features and one for incompatible (INCOMPAT) features.}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj= hhubh)}(hEThese feature flags have specific meanings for the kernel as follows:h]hEThese feature flags have specific meanings for the kernel as follows:}(hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj= hhubh)}(hXA COMPAT flag indicates that a feature is present in the filesystem, but the on-disk format is 100% compatible with older on-disk formats, so a kernel which didn't know anything about this feature could read/write the filesystem without any chance of corrupting the filesystem (or even making it inconsistent). This is essentially just a flag which says "this filesystem has a (hidden) feature" that the kernel or e2fsck may want to be aware of (more on e2fsck and feature flags later). The ext3 HAS_JOURNAL feature is a COMPAT flag because the ext3 journal is simply a regular file with data blocks in it so the kernel does not need to take any special notice of it if it doesn't understand ext3 journaling.h]hXA COMPAT flag indicates that a feature is present in the filesystem, but the on-disk format is 100% compatible with older on-disk formats, so a kernel which didn’t know anything about this feature could read/write the filesystem without any chance of corrupting the filesystem (or even making it inconsistent). This is essentially just a flag which says “this filesystem has a (hidden) feature” that the kernel or e2fsck may want to be aware of (more on e2fsck and feature flags later). The ext3 HAS_JOURNAL feature is a COMPAT flag because the ext3 journal is simply a regular file with data blocks in it so the kernel does not need to take any special notice of it if it doesn’t understand ext3 journaling.}(hjj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj= hhubh)}(hXAn RO_COMPAT flag indicates that the on-disk format is 100% compatible with older on-disk formats for reading (i.e. the feature does not change the visible on-disk format). However, an old kernel writing to such a filesystem would/could corrupt the filesystem, so this is prevented. The most common such feature, SPARSE_SUPER, is an RO_COMPAT feature because sparse groups allow file data blocks where superblock/group descriptor backups used to live, and ext2_free_blocks() refuses to free these blocks, which would leading to inconsistent bitmaps. An old kernel would also get an error if it tried to free a series of blocks which crossed a group boundary, but this is a legitimate layout in a SPARSE_SUPER filesystem.h]hXAn RO_COMPAT flag indicates that the on-disk format is 100% compatible with older on-disk formats for reading (i.e. the feature does not change the visible on-disk format). However, an old kernel writing to such a filesystem would/could corrupt the filesystem, so this is prevented. The most common such feature, SPARSE_SUPER, is an RO_COMPAT feature because sparse groups allow file data blocks where superblock/group descriptor backups used to live, and ext2_free_blocks() refuses to free these blocks, which would leading to inconsistent bitmaps. An old kernel would also get an error if it tried to free a series of blocks which crossed a group boundary, but this is a legitimate layout in a SPARSE_SUPER filesystem.}(hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj= hhubh)}(hXAn INCOMPAT flag indicates the on-disk format has changed in some way that makes it unreadable by older kernels, or would otherwise cause a problem if an old kernel tried to mount it. FILETYPE is an INCOMPAT flag because older kernels would think a filename was longer than 256 characters, which would lead to corrupt directory listings. The COMPRESSION flag is an obvious INCOMPAT flag - if the kernel doesn't understand compression, you would just get garbage back from read() instead of it automatically decompressing your data. The ext3 RECOVER flag is needed to prevent a kernel which does not understand the ext3 journal from mounting the filesystem without replaying the journal.h]hXAn INCOMPAT flag indicates the on-disk format has changed in some way that makes it unreadable by older kernels, or would otherwise cause a problem if an old kernel tried to mount it. FILETYPE is an INCOMPAT flag because older kernels would think a filename was longer than 256 characters, which would lead to corrupt directory listings. The COMPRESSION flag is an obvious INCOMPAT flag - if the kernel doesn’t understand compression, you would just get garbage back from read() instead of it automatically decompressing your data. The ext3 RECOVER flag is needed to prevent a kernel which does not understand the ext3 journal from mounting the filesystem without replaying the journal.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj= hhubh)}(hXlFor e2fsck, it needs to be more strict with the handling of these flags than the kernel. If it doesn't understand ANY of the COMPAT, RO_COMPAT, or INCOMPAT flags it will refuse to check the filesystem, because it has no way of verifying whether a given feature is valid or not. Allowing e2fsck to succeed on a filesystem with an unknown feature is a false sense of security for the user. Refusing to check a filesystem with unknown features is a good incentive for the user to update to the latest e2fsck. This also means that anyone adding feature flags to ext2 also needs to update e2fsck to verify these features.h]hXnFor e2fsck, it needs to be more strict with the handling of these flags than the kernel. If it doesn’t understand ANY of the COMPAT, RO_COMPAT, or INCOMPAT flags it will refuse to check the filesystem, because it has no way of verifying whether a given feature is valid or not. Allowing e2fsck to succeed on a filesystem with an unknown feature is a false sense of security for the user. Refusing to check a filesystem with unknown features is a good incentive for the user to update to the latest e2fsck. This also means that anyone adding feature flags to ext2 also needs to update e2fsck to verify these features.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj= hhubeh}(h]feature-compatibilityah ]h"]feature compatibilityah$]h&]uh1hhjLhhhhhKubh)}(hhh](h)}(hMetadatah]hMetadata}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM"ubh)}(hIt is frequently claimed that the ext2 implementation of writing asynchronous metadata is faster than the ffs synchronous metadata scheme but less reliable. Both methods are equally resolvable by their respective fsck programs.h]hIt is frequently claimed that the ext2 implementation of writing asynchronous metadata is faster than the ffs synchronous metadata scheme but less reliable. Both methods are equally resolvable by their respective fsck programs.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$hj hhubh)}(haIf you're exceptionally paranoid, there are 3 ways of making metadata writes synchronous on ext2:h]hcIf you’re exceptionally paranoid, there are 3 ways of making metadata writes synchronous on ext2:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM)hj hhubh bullet_list)}(hhh](h list_item)}(hFper-file if you have the program source: use the O_SYNC flag to open()h]h)}(hj h]hFper-file if you have the program source: use the O_SYNC flag to open()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM,hj ubah}(h]h ]h"]h$]h&]uh1j hj hhhhhNubj )}(hBper-file if you don't have the source: use "chattr +S" on the fileh]h)}(hj h]hHper-file if you don’t have the source: use “chattr +S” on the file}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hj ubah}(h]h ]h"]h$]h&]uh1j hj hhhhhNubj )}(hBper-filesystem: add the "sync" option to mount (or in /etc/fstab) h]h)}(hAper-filesystem: add the "sync" option to mount (or in /etc/fstab)h]hEper-filesystem: add the “sync” option to mount (or in /etc/fstab)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hj ubah}(h]h ]h"]h$]h&]uh1j hj hhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1j hhhM,hj hhubh)}(h{the first and last are not ext2 specific but do force the metadata to be written synchronously. See also Journaling below.h]h{the first and last are not ext2 specific but do force the metadata to be written synchronously. See also Journaling below.}(hj, hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM0hj hhubeh}(h]metadataah ]h"]metadataah$]h&]uh1hhjLhhhhhM"ubh)}(hhh](h)}(h Limitationsh]h Limitations}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjB hhhhhM4ubh)}(hXThere are various limits imposed by the on-disk layout of ext2. Other limits are imposed by the current implementation of the kernel code. Many of the limits are determined at the time the filesystem is first created, and depend upon the block size chosen. The ratio of inodes to data blocks is fixed at filesystem creation time, so the only way to increase the number of inodes is to increase the size of the filesystem. No tools currently exist which can change the ratio of inodes to blocks.h]hXThere are various limits imposed by the on-disk layout of ext2. Other limits are imposed by the current implementation of the kernel code. Many of the limits are determined at the time the filesystem is first created, and depend upon the block size chosen. The ratio of inodes to data blocks is fixed at filesystem creation time, so the only way to increase the number of inodes is to increase the size of the filesystem. No tools currently exist which can change the ratio of inodes to blocks.}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hjB hhubh)}(hMost of these limits could be overcome with slight changes in the on-disk format and using a compatibility flag to signal the format change (at the expense of some compatibility).h]hMost of these limits could be overcome with slight changes in the on-disk format and using a compatibility flag to signal the format change (at the expense of some compatibility).}(hja hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hjB hhubh)}(hhh]h)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjr ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjr ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjr ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjr ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjr ubhthead)}(hhh]j()}(hhh](j-)}(hhh]h)}(hFilesystem block sizeh]hFilesystem block size}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h1kBh]h1kB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h2kBh]h2kB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h4kBh]h4kB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h8kBh]h8kB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChj ubah}(h]h ]h"]h$]h&]uh1j,hj ubeh}(h]h ]h"]h$]h&]uh1j'hj ubah}(h]h ]h"]h$]h&]uh1j hjr ubj#)}(hhh](j()}(hhh](j-)}(hhh]h)}(hFile size limith]hFile size limit}(hj7 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhj4 ubah}(h]h ]h"]h$]h&]uh1j,hj1 ubj-)}(hhh]h)}(h16GBh]h16GB}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhjK ubah}(h]h ]h"]h$]h&]uh1j,hj1 ubj-)}(hhh]h)}(h256GBh]h256GB}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhjb ubah}(h]h ]h"]h$]h&]uh1j,hj1 ubj-)}(hhh]h)}(h2048GBh]h2048GB}(hj| hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhjy ubah}(h]h ]h"]h$]h&]uh1j,hj1 ubj-)}(hhh]h)}(h2048GBh]h2048GB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhj ubah}(h]h ]h"]h$]h&]uh1j,hj1 ubeh}(h]h ]h"]h$]h&]uh1j'hj. ubj()}(hhh](j-)}(hhh]h)}(hFilesystem size limith]hFilesystem size limit}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h2047GBh]h2047GB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h8192GBh]h8192GB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h16384GBh]h16384GB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h32768GBh]h32768GB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhj ubah}(h]h ]h"]h$]h&]uh1j,hj ubeh}(h]h ]h"]h$]h&]uh1j'hj. ubeh}(h]h ]h"]h$]h&]uh1j"hjr ubeh}(h]h ]h"]h$]h&]colsKuh1hhjo ubah}(h]h ]h"]h$]h&]uh1hhjB hhhhhNubh)}(hX=There is a 2.4 kernel limit of 2048GB for a single block device, so no filesystem larger than that can be created at this time. There is also an upper limit on the block size imposed by the page size of the kernel, so 8kB blocks are only allowed on Alpha systems (and other architectures which support larger pages).h]hX=There is a 2.4 kernel limit of 2048GB for a single block device, so no filesystem larger than that can be created at this time. There is also an upper limit on the block size imposed by the page size of the kernel, so 8kB blocks are only allowed on Alpha systems (and other architectures which support larger pages).}(hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMIhjB hhubh)}(hFThere is an upper limit of 32000 subdirectories in a single directory.h]hFThere is an upper limit of 32000 subdirectories in a single directory.}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMOhjB hhubh)}(hXThere is a "soft" upper limit of about 10-15k files in a single directory with the current linear linked-list directory implementation. This limit stems from performance problems when creating and deleting (and also finding) files in such large directories. Using a hashed directory index (under development) allows 100k-1M+ files in a single directory without performance problems (although RAM size becomes an issue at this point).h]hXThere is a “soft” upper limit of about 10-15k files in a single directory with the current linear linked-list directory implementation. This limit stems from performance problems when creating and deleting (and also finding) files in such large directories. Using a hashed directory index (under development) allows 100k-1M+ files in a single directory without performance problems (although RAM size becomes an issue at this point).}(hjX hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMQhjB hhubh)}(hX{The (meaningless) absolute upper limit of files in a single directory (imposed by the file size, the realistic limit is obviously much less) is over 130 trillion files. It would be higher except there are not enough 4-character names to make up unique directory entries, so they have to be 8 character filenames, even then we are fairly close to running out of unique filenames.h]hX{The (meaningless) absolute upper limit of files in a single directory (imposed by the file size, the realistic limit is obviously much less) is over 130 trillion files. It would be higher except there are not enough 4-character names to make up unique directory entries, so they have to be 8 character filenames, even then we are fairly close to running out of unique filenames.}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhjB hhubeh}(h] limitationsah ]h"] limitationsah$]h&]uh1hhjLhhhhhM4ubh)}(hhh](h)}(h Journalingh]h Journaling}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj| hhhhhM`ubh)}(hXA journaling extension to the ext2 code has been developed by Stephen Tweedie. It avoids the risks of metadata corruption and the need to wait for e2fsck to complete after a crash, without requiring a change to the on-disk ext2 layout. In a nutshell, the journal is a regular file which stores whole metadata (and optionally data) blocks that have been modified, prior to writing them into the filesystem. This means it is possible to add a journal to an existing ext2 filesystem without the need for data conversion.h]hXA journaling extension to the ext2 code has been developed by Stephen Tweedie. It avoids the risks of metadata corruption and the need to wait for e2fsck to complete after a crash, without requiring a change to the on-disk ext2 layout. In a nutshell, the journal is a regular file which stores whole metadata (and optionally data) blocks that have been modified, prior to writing them into the filesystem. This means it is possible to add a journal to an existing ext2 filesystem without the need for data conversion.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMbhj| hhubh)}(hXWhen changes to the filesystem (e.g. a file is renamed) they are stored in a transaction in the journal and can either be complete or incomplete at the time of a crash. If a transaction is complete at the time of a crash (or in the normal case where the system does not crash), then any blocks in that transaction are guaranteed to represent a valid filesystem state, and are copied into the filesystem. If a transaction is incomplete at the time of the crash, then there is no guarantee of consistency for the blocks in that transaction so they are discarded (which means any filesystem changes they represent are also lost). Check Documentation/filesystems/ext4/ if you want to read more about ext4 and journaling.h]hXWhen changes to the filesystem (e.g. a file is renamed) they are stored in a transaction in the journal and can either be complete or incomplete at the time of a crash. If a transaction is complete at the time of a crash (or in the normal case where the system does not crash), then any blocks in that transaction are guaranteed to represent a valid filesystem state, and are copied into the filesystem. If a transaction is incomplete at the time of the crash, then there is no guarantee of consistency for the blocks in that transaction so they are discarded (which means any filesystem changes they represent are also lost). Check Documentation/filesystems/ext4/ if you want to read more about ext4 and journaling.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMkhj| hhubeh}(h] journalingah ]h"] journalingah$]h&]uh1hhjLhhhhhM`ubeh}(h] specificationah ]h"] specificationah$]h&]uh1hhhhhhhhKIubh)}(hhh](h)}(h Referencesh]h References}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMxubh)}(hhh]h)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK/uh1jhj ubj#)}(hhh](j()}(hhh](j-)}(hhh]h)}(hThe kernel sourceh]hThe kernel source}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM{hj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(hfile:/usr/src/linux/fs/ext2/h]j)}(hj h]hfile:/usr/src/linux/fs/ext2/}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM{hj ubah}(h]h ]h"]h$]h&]uh1j,hj ubeh}(h]h ]h"]h$]h&]uh1j'hj ubj()}(hhh](j-)}(hhh]h)}(he2fsprogs (e2fsck)h]he2fsprogs (e2fsck)}(hj. hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM|hj+ ubah}(h]h ]h"]h$]h&]uh1j,hj( ubj-)}(hhh]h)}(h!http://e2fsprogs.sourceforge.net/h]j)}(hjG h]h!http://e2fsprogs.sourceforge.net/}(hjI hhhNhNubah}(h]h ]h"]h$]h&]refurijG uh1jhjE ubah}(h]h ]h"]h$]h&]uh1hhhhM|hjB ubah}(h]h ]h"]h$]h&]uh1j,hj( ubeh}(h]h ]h"]h$]h&]uh1j'hj ubj()}(hhh](j-)}(hhh]h)}(hDesign & Implementationh]hDesign & Implementation}(hjo hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM}hjl ubah}(h]h ]h"]h$]h&]uh1j,hji ubj-)}(hhh]h)}(h/http://e2fsprogs.sourceforge.net/ext2intro.htmlh]j)}(hj h]h/http://e2fsprogs.sourceforge.net/ext2intro.html}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM}hj ubah}(h]h ]h"]h$]h&]uh1j,hji ubeh}(h]h ]h"]h$]h&]uh1j'hj ubj()}(hhh](j-)}(hhh]h)}(hJournaling (ext3)h]hJournaling (ext3)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM~hj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h,ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/h]j)}(hj h]h,ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM~hj ubah}(h]h ]h"]h$]h&]uh1j,hj ubeh}(h]h ]h"]h$]h&]uh1j'hj ubj()}(hhh](j-)}(hhh]h)}(hFilesystem Resizingh]hFilesystem Resizing}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hhh]h)}(h"http://ext2resize.sourceforge.net/h]j)}(hj h]h"http://ext2resize.sourceforge.net/}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hj ubeh}(h]h ]h"]h$]h&]uh1j'hj ubj()}(hhh](j-)}(hhh]h)}(hCompression [1]_h](h Compression }(hj2hhhNhNubhfootnote_reference)}(h[1]_h]h1}(hj<hhhNhNubah}(h]id1ah ]h"]h$]h&]refidid5docnamefilesystems/ext2uh1j:hj2resolvedKubeh}(h]h ]h"]h$]h&]uh1hhhhMhj/ubah}(h]h ]h"]h$]h&]uh1j,hj,ubj-)}(hhh]h)}(hhttp://e2compr.sourceforge.net/h]j)}(hjah]hhttp://e2compr.sourceforge.net/}(hjchhhNhNubah}(h]h ]h"]h$]h&]refurijauh1jhj_ubah}(h]h ]h"]h$]h&]uh1hhhhMhj\ubah}(h]h ]h"]h$]h&]uh1j,hj,ubeh}(h]h ]h"]h$]h&]uh1j'hj ubeh}(h]h ]h"]h$]h&]uh1j"hj ubeh}(h]h ]h"]h$]h&]colsKuh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hImplementations for:h]hImplementations for:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hhh]h)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK;uh1jhjubj#)}(hhh](j()}(hhh](j-)}(hhh]h)}(hWindows 95/98/NT/2000h]hWindows 95/98/NT/2000}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h$http://www.chrysocome.net/explore2fsh]j)}(hjh]h$http://www.chrysocome.net/explore2fs}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hjubj()}(hhh](j-)}(hhh]h)}(hWindows 95 [1]_h](h Windows 95 }(hjhhhNhNubj;)}(h[1]_h]h1}(hjhhhNhNubah}(h]id2ah ]h"]h$]h&]jKjLjMjNuh1j:hjjOKubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h*http://www.yipton.net/content.html#FSDEXT2h]j)}(hj0h]h*http://www.yipton.net/content.html#FSDEXT2}(hj2hhhNhNubah}(h]h ]h"]h$]h&]refurij0uh1jhj.ubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hjubj()}(hhh](j-)}(hhh]h)}(hDOS client [1]_h](h DOS client }(hjXhhhNhNubj;)}(h[1]_h]h1}(hj`hhhNhNubah}(h]id3ah ]h"]h$]h&]jKjLjMjNuh1j:hjXjOKubeh}(h]h ]h"]h$]h&]uh1hhhhMhjUubah}(h]h ]h"]h$]h&]uh1j,hjRubj-)}(hhh]h)}(h8ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/h]j)}(hjh]h8ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhj~ubah}(h]h ]h"]h$]h&]uh1hhhhMhj{ubah}(h]h ]h"]h$]h&]uh1j,hjRubeh}(h]h ]h"]h$]h&]uh1j'hjubj()}(hhh](j-)}(hhh]h)}(h OS/2 [2]_h](hOS/2 }(hjhhhNhNubj;)}(h[2]_h]h2}(hjhhhNhNubah}(h]id4ah ]h"]h$]h&]jKid6jMjNuh1j:hjjOKubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h8ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/h]j)}(hjh]h8ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hjubj()}(hhh](j-)}(hhh]h)}(hRISC OS clienth]hRISC OS client}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hhh]h)}(h;http://www.esw-heim.tu-clausthal.de/~marco/smorbrod/IscaFS/h]j)}(hjh]h;http://www.esw-heim.tu-clausthal.de/~marco/smorbrod/IscaFS/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]uh1j"hjubeh}(h]h ]h"]h$]h&]colsKuh1hhjubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubhfootnote)}(h7no longer actively developed/supported (as of Apr 2001)h](hlabel)}(h1h]h1}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jMhjIubh)}(hjKh]h7no longer actively developed/supported (as of Apr 2001)}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjIubeh}(h]jLah ]h"]1ah$]h&](jFjjjejMjNuh1jGhhhMhj hhjOKubjH)}(h7no longer actively developed/supported (as of Mar 2009)h](jN)}(h2h]h2}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jMhjqubh)}(hjsh]h7no longer actively developed/supported (as of Mar 2009)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjqubeh}(h]jah ]h"]2ah$]h&]jajMjNuh1jGhhhMhj hhjOKubeh}(h] referencesah ]h"] referencesah$]h&]uh1hhhhhhhhMxubeh}(h]the-second-extended-filesystemah ]h"]the second extended filesystemah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksj,footnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}(1](j<jj`e2]jaurefids}nameids}(jjjIjFj j jjjjjjjfjcjjjjj j j: j7 j j j? j< jy jv j j jjjnjLjju nametypes}(jjIj jjjjfjjj j: j j? jy j jjnjuh}(jhjFhj jLjjkjjjjjcjjjijjj jj7 j j j= j< j jv jB j j| jj jFj<jjjjj`jjjLjIjjqu footnote_refs}(j ](j<jj`ej ]jau citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes](jIjqe citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jKsRparse_messages]transform_messages] transformerN include_log] decorationNhhub.