Life and times of the classic ext Linux filesystem
Extended Attributes
Version 2 of the ext filesystem was the first to offer the possibility to use extended attributes. One the best known of these attributes is the immutable bit: You can use the command chattr +i
as an administrator to protect a file against modification or deletion.
Moreover, the filesystem manages extended access privileges (Access Control Lists, or ACLs for short). ACLs make it possible to grant different users and groups access to files and directories – or to revoke this access. As you might expect, the extended attributes reside directly in the inode.
Another innovation from ext2 is multiple timestamps: The filesystem manages three different timestamps for files and folders (Figure 3). These timestamps allow tools such as ls
to see when the system last accessed an object or something last changed at the level of the inode or data.
Compressed
A few years after the release of ext2, the e2compr patch appeared on the web; this patch extends the ext2 driver in the Linux kernel to include support for compression [3]. e2compr only acts on files, while directories, inodes, superblocks, and other data related to the system remain unaffected.
After integrating the patch, you have the option of using
$ chattr +c <filename>
to set an extended attribute for a file. If you select a directory for compression, the system will automatically compress all newly added files.
Not Quite Perfect
Despite many advantages over the first ext version, ext2 struggled with various limitations. For example, because of an internal limit, a directory must not exceed 31,998 directories, although this number probably rarely plays a role in practice. Because of the way ext2 manages files, the filesystem gets into trouble if you have more than 10,000 files in a folder.
Ext2 is at least better than ext in terms of the maximum file size and filesystem size: With kernel versions 2.4 or later, an ext2 filesystem can weigh in at up to 16TB and manage files of sizes up to 2TB (assuming the block size is 4KB).
With a Linux kernel 2.4 or earlier, the size of block devices was still limited to 2TB, which thus also limited an ext2 filesystem to this size.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)