ArticleslgStudy

computer science

Ext2

Ext2 is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Ext2 rather than just read about it. In short: ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext).

Ext2 — main illustration
Ext2 — illustration

Key takeaways

  • Ext2 belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Ext2 to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Ext2 from memory before moving on to harder problems.

Reference excerpt

ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same principles as the Berkeley Fast File System from BSD, it was the first commercial-grade filesystem for Linux. The canonical implementation of ext2 is the "ext2fs" filesystem driver in the Linux kernel. Other implementations (of varying quality and completeness) exist in GNU Hurd, MINIX 3, some BSD kernels, in MiNT, Haiku and as third-party Microsoft Windows and macOS (via FUSE) drivers. This driver was deprecated in Linux version 6.9 in favor of the ext4 driver, as the ext4 driver works with ext2 filesystems. ext2 was the default filesystem in several Linux distributions, including Debian and Red Hat Linux, until supplanted by ext3, which is almost completely compatible with ext2 and is a journaling file system. ext2 is still the filesystem of choice for flash-based storage media (such as SD cards and USB flash drives) because its lack of a journal increases performance and minimizes the number of writes. This is important because many flash devices can only endure a limited number of write cycles. Since 2009, the Linux kernel supports a journal-less mode of ext4 which provides benefits not found with ext2, such as larger file and volume sizes.

History The early development of the Linux kernel was made as a cross-development under the MINIX operating system. The MINIX file system was used as Linux's first file system. The Minix file system was mostly free of bugs, but used 16-bit offsets internally and thus had a maximum size limit of only 64 megabytes, and there was also a filename length limit of 14 characters. Because of these limitations, work began on a replacement native file system for Linux. To ease the addition of new file systems and provide a generic file API, VFS, a virtual file system layer, was added to the Linux kernel. The extended file system (ext), was released in April 1992 as the first file system using the VFS API and was included in Linux version 0.96c. The ext file system solved the two major problems in the Minix file system (maximum partition size and filename length limitation to 14 characters), and allowed 2 gigabytes of data and filenames of up to 255 characters. But it still had problems: there was no support of separate timestamps for file access, inode modification, and data modification. As a solution for these problems, two new filesystems were developed in January 1993 for Linux kernel 0.99: xiafs and the second extended file system (ext2), which was an overhaul of the extended file system incorporating many ideas from the Berkeley Fast File System. ext2 was also designed with extensibility in mind, with space left in many of its on-disk data structures for use by future versions. Since then, ext2 has been a testbed for many of the new extensions to the VFS API. Features such as the withdrawn POSIX draft ACL proposal and the withdrawn extended attribute proposal were generally implemented first on ext2 because it was relatively simple to extend and its internals were well understood. On Linux kernels prior to 2.6.17, restrictions in the block driver mean that ext2 filesystems have a maximum file size of 2 TiB. ext2 is still recommended over journaling file systems on bootable USB flash drives and other solid-state drives. ext2 performs fewer writes than ext3 because there is no journaling. As the major aging factor of a flash chip is the number of erase cycles, and as erase cycles happen frequently on writes, decreasing writes increases the life span of the solid-state device. Another good practice for filesystems on flash devices is the use of the noatime mount option, for the same reason. Beginning with Linux kernel 6.9, the ext2fs driver was deprecated and is no longer enabled in the default configuration. The central reason was that it did not support dates past 2038. Users are recommended to upgrade to ext4.

ext2 data structures

The space in ext2 is split up into blocks. These blocks are grouped into block groups, analogous to cylinder groups in the Unix File System. There are typically thousands of blocks on a large file system. Data for any given file is typically contained within a single block group where possible. This is done to minimize the number of disk seeks when reading large amounts of contiguous data. Each block group contains a copy of the superblock and block group descriptor table, and all block groups contain a block bitmap, an inode bitmap, an inode table, and finally the actual data blocks. The superblock contains important information that is crucial to the booting of the operating system. Thus backup copies are made in multiple block groups in the file system. However, typically only the first copy of it, which is found at the first block of the file system, is used in the booting. The group descriptor stores the location of the block bitmap, inode bitmap, and the start of the inode table for every block group. These, in turn, are stored in a group descriptor table.

Inodes Every file or directory is represented by an inode. The term "inode" comes from "index node" (over time, it became i-node and then inode). The inode includes data about the size, permission, ownership, and location on disk of the file or directory. Example of ext2 inode structure:

Quote from the Linux kernel documentation for ext2:

There 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 and a pointer to a trebly indirect block. Thus, there is a structure in ext2 that has 15 pointers. Pointers 1 to 12 point to direct blocks, pointer 13 points to an indirect block, pointer 14 points to a doubly indirect block, and pointer 15 points to a triply indirect block.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Ext2

Start with the simplest possible case. Write down what Ext2 claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Ext2 before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Ext2 ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Ext2

In research
Ext2 appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Ext2 in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Ext2 is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1993 software, Disk file systems, File systems supported by the Linux kernel, so understanding it makes those chapters shorter.
In everyday life
Look for Ext2 outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Ext2” →

How to study Ext2 in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Ext2 means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Ext2 out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Ext2 in simple terms?

ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext).

Why does Ext2 matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Ext2?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Ext2.

Tags

  • 1993 software
  • Disk file systems
  • File systems supported by the Linux kernel

Keep exploring