ext4 File System: Introduction and Benchmarks

Destined to become the default file system for the more popular Linux distributions, ext4 is out of experimental mode and gearing up for production environments. Here's what you need to know.

The first development snapshot of ext4 was added to the 2.6.19 kernel but was marked as experimental. The patches that marked ext4 as a stable file system were merged on Oct. 11, 2008 in the 2.6.28 kernel source (and the peasants rejoiced). The only bad spot as of the writing of this article is that you can’t use ext4 as the boot partition because grub doesn’t understand it (although that is being actively worked upon).

Recently, Fedora Core 11 has announced that ext4 will be the default file system. Also Ubuntu 9.0.4 will support ext4 but not necessarily use it as the default file system. I’m sure other distributions will enable it by default. Really, all you need is a kernel 2.6.28 or newer and a very recent version of e2fsprogs and you’re off to the races.

Creating ext4 File Systems and Benchmarking

To you get you started, let’s take a fresh SATA II drive and show how to format ext4 and then take it for a spin and compare it to ext3.

Creating an ext4 file system from scratch is very easy (as easy as ext3). I will assume that you have a kernel that is ext4 capable (2.6.28 or greater) along with the latest version of e2fsprogs (see this link for even more help). For the examples that follow, I’m using a couple of Seagate ST3500641AS 500GB disks that appear as /dev/sda and /dev/sdb in my little home box (it’s old enough that I’m embarrassed to say what it is). The box also has 1GB of memory and is running CentOS 5.2. I’m using a 2.6.28.7 kernel built by hand along with version 1.41.4 of e2fsprogs.

A simple way to start is by using,

% mke2fs -t ext4 /dev/sda1

This is a pretty easy way to create an ext4 file system but it assumes all of the defaults.

To learn a bit more about what defaults are in ext4 you can use tune2fs.

% tune2fs -l /dev/sda1 | more

Here’s a quick sample of what the output might look like:

tune2fs 1.41.4 (27-Jan-2009)
Filesystem volume name:   
Last mounted on:          
Filesystem UUID:          9db1edc1-69bf-4644-be16-78262d6ffb3a
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              30531584
Block count:              122096000
Reserved block count:     6104800
Free blocks:              120129098
Free inodes:              30531573
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      994
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Sun Mar 15 15:57:09 2009
Last mount time:          Sun Mar 15 16:06:53 2009
Last write time:          Sun Mar 15 16:06:53 2009
Mount count:              1
Maximum mount count:      33
Last checked:             Sun Mar 15 15:57:09 2009
Check interval:           15552000 (6 months)
Next check after:         Fri Sep 11 15:57:09 2009
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:	          256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      3aabc48e-6505-41f7-9c62-06b106fe975c
Journal backup:           inode blocks

Next: Benchmarking ext4 vs. ext3

Comments on "ext4 File System: Introduction and Benchmarks"

cwtryon

Thanks for the introduction! While I realize that file systems can be an even more hotly debated religious topic than KDE vs. Gnome, do you have any indications on how ext4 performs compared to some of the other “new” file systems, such as JFS? One of the other big problems with ext3 has been handling massive numbers of really small files in a single directory. I actually worked a job where we were worried that a 2TB partition was “too small” for the amount of data we had to store, but we were stuck with older versions of RH EL, and not sure where to go. This may be the new way forward, as file system requirements continue to explode.

Reply
laytonjb

cwtryon,

I agree with your thoughts about ext3 and ext4. In the past ext3 has felt kind of limiting and with RHEL that was the primary file system of choice. I’ve never tried to use JFS or Reiser on RHEL. Typically what I do is install RHEL using ext3 for / (I use ext2 for /boot), and once I’m happy, I build a new kernel with XFS and JFS enabled. I install all of the support tools and then build a new file system using XFS or JFS on other drives. This works well enough for me :)

I don’t know about performance of JFS vs. ext3 or ext4. One of my goals is to do some extensive benchmarking to get a feel for the relative performance differences. Drop a note to the editor about a file system benchmarking article and maybe he’ll ask me to do one :)

BTW – I’m working on a similar article for btrfs. While it’s still experimental I want to get a feel for it as well. Ted Ts’o think the combination of ext4 and btrfs is the future and I couldn’t agree more. There are some other up and coming file systems that show some promise as well.

Also – thansk for the compliment! Glad it helped.

Jeff

Reply
ndatta

This is a great article and a very good introduction to ext4. Thanks!

Reply
rkoski

Actually, the ext3 file system size limit is only 8 TB. Tried to make 9 TB ext3, but the only block size option was 4 KB, which resulted in said max 8 TB file system. Used CentOS 5.2. Maybe there is some combination of kernel, e2fsprogs, etc. which can use 8 KB blocks, perhaps kernel 2.4.x ;)

Reply
dbindner

There’s always something to complain about with benchmarks, so naturally I have a complaint. Given that this was a very introductory article, I think it would have made sense to test the two filesystems in the configurations that are most common, i.e. their default configurations.

When more technical articles follow, you can delve into the options that a careful sysadmin would tune. But most people (and many admins) are going to use the default settings and will want to know about performance as well as reliability. It may be a bit hard to say about reliability for the moment, but at least that “typical” performance can be measured.

Reply
graemeharrison

Great article… but I too have an issue about the benchmarking needing to compare ‘out of the box’ default configurations. You disabled “barriers” which are by-default ON with Ext4 (for cited reason of compatibility) but really, if Ext4 will have data-security features, at least one column in results should have been the default use of Ext4.

Reply
sdean7855

Great article. Jeff, since you are an Enterprise Technologist for Dell, I have a question about the inter-relation/robustness/capability of ext4 and btrfs and PC hardware…or Dell server hardware. Ts’o wrote a telling piece back in ’04, entitled ‘reiserfs’ but it might as well have been entitled crappy PC hardware. It was his take back then that SGI and Sun had built their hardware to deal somewhat gracefully and sequentially with a power cord yank but that crappy PC hardware died a thrashing chaotic death that would write crap…even upon the metadata. Have things improved, at least with Dell Poweredge server hardware? Does ext4 and btrfs do physical journalling?

Reply
gigo6000

Nice article , just yesterday while installing ubuntu 9.04 I noticed this new filesystem and didn’t know if it was ok to use it since ext3 works fine for my needs.

Reply
rosbif

Thank you for a nice article.

One little nit-pick:
The maximum file size for ext2 is much greater than the 2GB stated.
It depends on the block size but seems to be 2TiB with a 4KiB block size.

Of course it is true that some 32-bit applications may be limited to a 2GiB maximum file size but this is a limitation of the application and not of the file system.

Reply

I like it when folks come together and share ideas. Great
blog, keep it up!

Also visit my web blog: Arcane Legends Hack

Reply

thank you for share!

Reply

Blog looks nice. I’m still trying to make a blog but it won’t be as professional as yours /: Keep on blogging :) pirater un compte facebook

Reply

ext4 File System: Introduction and Benchmarks | Linux Magazine
acrhphwzth
[url=http://www.gq61jf72mr220d1d77e57xm1eyqb81r9s.org/]ucrhphwzth[/url]
crhphwzth http://www.gq61jf72mr220d1d77e57xm1eyqb81r9s.org/

Reply

ext4 File System: Introduction and Benchmarks | Linux Magazine | Page 2

Reply

ext4 File System: Introduction and Benchmarks | Linux Magazine | Page 2

Reply

ext4 File System: Introduction and Benchmarks | Linux Magazine | Page 2

Reply

ext4 File System: Introduction and Benchmarks | Linux Magazine | Page 2

Reply

ext4 File System: Introduction and Benchmarks | Linux Magazine | Page 2

Reply

ext4 File System: Introduction and Benchmarks | Linux Magazine | Page 2

Reply

ext4 File System: Introduction and Benchmarks | Linux Magazine | Page 2

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>