Talk:Ext2

This is an old revision of this page, as edited by Ekscrypto (talk | contribs) at 22:14, 4 February 2009 (Filename length). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


Latest comment: 15 years ago by Ekscrypto in topic Design

Volume size and kernel versions

I'm pretty sure the 2TiB limit only applies to 2.4 kernels and earlier, since that is the maximum block size (see, eg, [1]). I've edited to reflect this.

That's correct, actually this is documented in the Linux kernel sources under Documentation/Filesystems/Ext2.txt: 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).

Ekscrypto (talk) 21:34, 3 February 2009 (UTC)Reply

ctime

I changed the description of ctime to "change time of inode", and it was reverted on the basis of what ext2_fs.h says. I disagree with this, so I have put my change back again. PhilHibbs | talk 12:16, 2 Mar 2005 (UTC)

actually ctime is "creation time" and mtime is "modified time". If "ctime" is "change time" then both mtime and ctime should by extrapolation be the same and they are not. Ekscrypto (talk) 21:47, 3 February 2009 (UTC)Reply

Berkeley Fast File System background

The guys who wrote Unix System Administration Handbook page 151 mentions somewhere that Ext2 borrows its concepts from FFS. How true is this claim? After googling a bit, i came across a couple of links and it looks like they generalized it too far. See [2] specifically "ext2 file system is an intellectual descendant of the Berkeley Fast File System". I just mentioned it as it wouldn't hurt leveraging views from different sources.

(unsigned)

Ext2 is mostly a UFS filesystem with some VAX-era cruft stripped out.

UFS was designed for disks that actually used cylinder-head-sector addressing with a known interleave. You could set up UFS to be aware of this, avoiding some delays related to disk rotation. Such hacks are essentially impossible on modern hardware. When ext2 was being developed, UFS lost performance in a futile effort to optimize for something it could not know. Modern UFS doesn't try to play such games, but still retains the now-worthless on-disk data structures.

UFS traditionally used 8 K blocks with 1 K sub-blocks for file tails. More recently, the sizes are half of that. Ext2's normal block size range is 1 K, 2 K, or 4 K. Plans to implement fragments for Linux have been cancelled because the feature adds complexity and, unsurprisingly, fragmentation.

UFS has the 3 traditional UNIX file timestamps. Ext2 adds a fourth, the deletion time. This helps the filesystem checker to be more reliable. It costs an extra seek when a file is deleted.

Ext2 replicates the superblock in many places for extra reliability. During recovery from a disaster, the filesystem checker can locate a backup superblock if needed.

In the HURD variant, there is an author ID.

The file flags are a bit different.

Recent enhancements include ACLs, OS/2-style extended attributes (small named forks), security data tags, file type info in directory entries, growable filesystems, journalling (ext3), and hashed directories.

Non-standard kenhancements include compression, extent-based block allocation, phase-tree commits, and tree-structured tail packing.

The ext2 driver never seriously attempted to support sync operation. Despite this, recovery from crashes was generally superior to that of UFS because the ext2.fsck program was a truly excellent piece of software.

24.110.60.225 06:27, 1 January 2006 (UTC)Reply

GNU & Kernel

Instead "used on the Linux operating system", how about "used in the Linux kernel". This is probably more accurate than "Linux operating system" or "GNU/Linux operating system". Jebba 06:51, 25 July 2005 (UTC) Also, this article is probably no longer a stub.Reply

Design

The incomplete "Design" section was a bit of an eyesore. I'm moving its contents in here until I can find time for a full write-up. —Ghakko 22:35, 27 July 2005 (UTC)Reply

Please note that with the introduction of sparse superblock in revision 1 of Ext2, not all block groups have a copy of the superblock and group descriptors. It should also be pointed throughout the design document the various changes between Revision 0 and Revision 1 of ext2 has it had impacts on inode size, extended attributes and many other features. Ekscrypto (talk) 21:50, 3 February 2009 (UTC)Reply
Block group
Every ext2 filesystem is divided up into block groups, each of which has its own:
  • Superblock
  • Group descriptors
  • Block bitmap
  • Inode bitmap
  • Inode table
  • Data blocks
Block groups are similar to cylinder groups in Berkeley FFS, where they were introduced to retard file fragmentation.
Superblock
The superblock contains metadata describing the entire filesystem:
  • Number of inodes
  • Number of blocks
  • Reserved block count
  • First data block number
  • Block size
  • Fragment size
  • Number of blocks per group
  • Number of fragments per group
  • Number of inodes per group
  • Mount time
  • Write time
  • Mount count
  • Maximal mount count
  • Magic signature
  • File system state: valid (unmounted cleanly) or error
  • Error detection behavior
  • Minor revision level
  • Time the file system was last checked
  • Maximum time between checks
  • Default user & group ID for reserved blocks
Inodes
Inodes contain file metadata:
  • File mode
  • User ID (uid)
  • Group ID (gid)
  • File size, in bytes
  • Last file access time (atime)
  • Inode change time (ctime)
  • Last file modification time (mtime)
  • Deletion time (dtime)
  • Link count
  • Block count
  • File type
  • File attributes
  • List of block addresses, each of which may to:
    • A block containing raw file data (direct address)
    • An indirect block containing direct addresses (indirect address)
    • A doubly-indirect block containing indirect addresses (doubly-indirect address)
    • A triply-indirect block containing doubly-indirect addresses (triply-indirect address)
Directories
Represented as a list of directory entries, each of which contains an inode number and a filename.
Files
Regular files
Represented as a list of blocks, pointers for which go into indirect nodes. Blocks are headerless and contain raw data.
Links
  • Hard links
  • Symbolic links
Special files
  • Block devices
  • Character devices
  • FIFOs

Filename length

The article claims "maximum filename length of 255 characters" , while the article Comparison_of_file_systems claims "255 bytes".

xerces8 --86.61.44.206 21:22, 4 March 2006 (UTC)Reply

A byte is the same size as a character so it is the same thing is it not? -Billy Leo
I think it just depends on what you define a character as. Strictly speaking, I'm pretty sure it's any byte except NULL. This set is not ASCII nor UTF-8 since 127 through 159 are not permitted in UTF-8 and ASCII only uses the first 7 bits. So I guess I don't know what character set your would define it as, which would lead me to say call it 255 bytes. Cburnett 03:20, 13 March 2006 (UTC)Reply
Linux expects ISO-Latin-1 characters in filenames which uses 1 byte per character; but regardless of whether future support for full UTF-8, due the 8bit name_len record in the inode any filename is limited to 255 bytes. Ekscrypto (talk) 21:29, 3 February 2009 (UTC)Reply

Article Title

To my knowledge, the official name for ext2 is the Second Extended Filesystem. Please correct me if i'm wrong, but shouldn't we change the article title to that? -- De Zeurkous (zeurkous@lichee.nichten.info), Mon Mar 20 17:03:48 UTC 2006

WP has a naming convention to use the common name over the "official" name. ext2 is definitely the most common. Cburnett 02:34, 21 March 2006 (UTC)Reply

How It Works

I like the idea of going into more detail about what makes ext2 special (features, performance, whatever), but just adding a section header won't magically cause the rest of the internet to fill in the section. Crag 15:48, 21 November 2006 (UTC)Reply