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.

Figure 3: The stat command offers a convenient view of the three timestamps.

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.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Configuring Filesystems

    Although most Linux distributions today have simple-to-use graphical interfaces for setting up and managing filesystems, knowing how to perform those tasks from the command line is a valuable skill. We’ll show you how to configure and manage filesystems with mkfs, df, du, and fsck.

  • Choose a Filesystem

    Every Linux computer needs a filesystem, and users often choose a filesystem by habit or by default. But, if you're seeking stability, versatility, or a small performance advantage, it pays to take a closer look.

  • Accessing NTFS Intro

    Whether you are troubleshooting or just configuring for efficiency, it is a good idea to explore your options for accessing your Windows partitions from Linux.

  • The ext Filesystem

    The extended filesystem has been part of the Linux kernel since 0.96c – a faithful companion of the free operating system. With its developments – or, rather, rebirths – through ext2, ext3, and ext4, it is one of the oldest Linux-specific software projects.

  • Btrfs

    The Btrfs filesystem offers advanced features such as RAID, subvolumes, snapshots, checksums, and transparent compression, but do desktop users really need all that power?

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News