Linux File System Fragmentation

I’ve always found it hilarious that *nix bigots (particularly Linux bigots) asserted that their file systems, unlike those found in Windows, didn’t fragment.

HA HA

Obviously most anyone who would make that assertion really doesn’t know anything about file systems or Windows.

It’s true that back in the ancient times of Windows when all you had was FAT or FAT32 that fragmentation was a real problem; but as of the introduction for HPFS in OS/2 and then NTFS in Windows NT fragmentation in a Windows system was on par with fragmentation in a *nix system.

Though you’ll recall that in Windows, even with NTFS, defragmentation was possible and tools to accomplish it were readily available (like included with the operating system).

Ext2, Ext3, Ext4 — and most any other file system known to man might (like NTFS) attempt to prevent file system fragmentation, but it happens — and over time it can negatively impact performance.

Interesting enough, with Ext4 there appears to be fewer *nix people in that great river in Egypt — d Nile… or denial as it were.

Ext4 is a very advanced file system; and most every trick in the book to boost performance and prevent fragmentation is includes — along with the potential for defragmentation.  The tool e4defrag will allow for the defragmentation of single files or entire file systems — though it’s not quite ready… still a few more kernel issues to be worked out to allow it to defragment a live file system.

With Ext4 as with NTFS one way you can defragment a file is copy it, the file system itself will attempt to locate an area of the disk that can hold the file in continuous allocation unites — but, of course, the file system’s performance can often be increased to coalescing the free space, or at least coalescing free space that is likely too small to hold a file.

As I said when I started; I’ve always found it hilarious that *nix bigots often don’t have a very good understanding of the technical limitations and strengths of various pieces of an operating system… but let me underscore just because people don’t always know what they’re talking about doesn’t necessarily mean that the solution they’re evangelizing might not be something that should be considered.

Originally posted 2010-06-03 02:00:06.