Linux: Common Filesystems
-
Linux is the land of filesystems. It is flooded with options. Today, in 2016, the "standard" filesystems on Linux are XFS and EXT4, nearly across the board with BtrFS starting to make inroads specifically in the Suse space (always a leader in Linux filesystems) and with Facebook making big BtrFS investments themselves as it is their filesystem of choice. Working on Linux means at least being aware that many file system options exist, even if we ourselves only choose to work with the defaults. In nearly all cases, default options are "good enough". They are defaults for a reason and are some of the world's more powerful, stable and versatile filesystems. But having lots of options means that we have choices when we want to get extremely fast, big or reliable.
A complete survey of filesystems is simply not possible. The number available on Linux approaches the ridiculous, but a small handful represent the real world, practical filesystems found, supported officially and used in the world on Linux. It should be noted that filesystems on Linux are partially additionally complex because the OS offers services that many other operating systems do not. Clustered filesystems are very important for certain use cases and are not offered by Solaris or Windows, for example, without additional add-on software to do so. In Linux, multiple clustered file system options are standard.
Here I will list the common Linux filessytem options, why they are important and when they would likely be selected. We will learn more about filesystems as we progress. But we need a firm foundation to start from now.
In this list I am looking only at local, traditional filesystems and not things like distributed or network filesystems. Linux is also rich in those options, and they will be addressed later in the course.
The original 1992 Linux filesystem was called the "Extended File System" or EXT and was so named as it was an enhancement to the common UNIX filesystem UFS and the MINIX filesystem which were its inspiration. The Linux filesystems have always been one of its strong suits, even before it was considered a business viable operating system. EXT2 replaced EXT a year later in 1993 and was inspired by FFS, the Berkely Fast File System from BSD UNIX. EXT2 is the Linux world's best known file system and while legacy today, it was fast, robust and stable and was the filesystem on which the Linux ecosystem was primarily built.
EXT3: In 2001, Journaling was added to the EXT family in EXT3. EXT3 is essentially just EXT2 with journalling added. Journaling made the filesystem more robust and slightly faster while maintaining bidirectional compatibility with its predecessor making it a very popular and important upgrade in the Linux ecosystem. EXT3 was by far the most popular filesystem on Linux across the board from 2001 and for much more than a decade following. Still found often today.
Traditional Non-Clustered Filesystems:
EXT4: Additional stability and scalability upgrades added on top of EXT3 in 2008. EXT4 is the latest member of the Linux EXT family and was the most popular filesystem on Linux from roughly 2010 to 2014. Still very popular today and a good general purpose filesystem option, especially for smaller systems and desktops.
XFS: The filesystem developed by SGI (Silicon Graphics) for the IRIX UNIX system in 1993 and ported to Linux in 2001. As of 2014 it has effectively unseated EXT4 as the primary filesystem on Linux with Red Hat choosing it to replace EXT4 as the default filesystem choice for servers. XFS is well known for its extreme level of performance and reliability and is very mature. XFS continues to grow in popularity and is more and more often being recommended for systems requiring very large or very stable filesystems, even at twenty three years old. Like EXT3 and EXT4, XFS is journaled.
JFS: IBM's filesystem built for their AIX UNIX system in 1990 (and later in 1999 used for OS/2 Warp), JFS was ported to Linux in 2001 and has retained substantial commercial support while never reaching a point of popularity within the community. JFS is a stable, mature operating system with decades of work on it and the Linux release is backported as the mature JFS release for those still running OS/2. JFS is a viable option for Linux, but very rare and would not be expected to be used in a new install. The J in JFS standard for Journaled and was a pioneer in filesystem journalling.
ReiserFS: A modern original to Linux filesystem made in 2001 with performance focused on large filesystems of a large number of very small files, ReiserFS was very important to Linux and was the primary filesystem of Suse Linux from 2001 to 2006 when it was replaced with EXT3. Reiser's inventor was at work on Reiser4, a very promising replacement to ReiserFS when he was convicted of murder and the Reiser4 project failed to get code into mainline Linux. ReiserFS' age has left it rarely used today, but still fast and stable for its intended use cases.
UFS: The Unix File System, also known as the BSD Fast File System (FFS) can be found on Linux and exists for cross compatibility with most UNIX versions. UFS is a very old filesystem but still extremely widely used and is actually very stable and performant and still the default choice on several enterprise operating systems, such as FreeBSD.
ZFS: Originally developed by Sun Microsystems in 2005, ZFS is a super modern massive scale filesystem with integrated logical volume manager and software RAID implementation. It was designs for use on AMD64 based Solaris systems using Sun's large scale Thumper storage hardware. ZFS was open sourced alone with Solaris 10 but then with Solaris 11 closed sourced again. The OpenSolaris project took the older open sourced version of ZFS and ported it to Mac OSX (later dropped) and to FreeBSD where it is now an extremely popular filesytem alongside UFS. ZFS has recently been ported to Linux but is very unpopular there and struggles to find support. It is considered a second class filesystem but there is a lot of interest around it although it offers little to the Linux ecosystem compared to where it exists already on Solaris and FreeBSD which lacked broad filesystem support prior to ZFS' introduction there.
BtrFS: A very new, very modern filesystem native to Linux determined to bring ZFS functionality plus greater performance natively to Linux and full open sourced. BtrFS has been very good headway and has recently been deemed production ready and is in use by large Linux shops like Facebook already. BtrFS, like ZFS, includes a logical volume manager and software RAID inside of the filesystem instead of getting these as external components. BtrFS is already seeing broad adoption into production distros and is occasionally being deployed as the default. BtrFS is the most likely filesystem to dominate Linux over the next decade.
NTFS: The Windows NT filesystem. Not popular on Linux but available primarily for use in cross platform compatibility situations.
Clustered Filesystems:
GFS2: Red Hat's Global File System 2 is the most popular clustered filesystem on Linux. The original GFS, from 1995, was developed for IRIX and GFS2 for Linux in 2005. GFS2 is widely used wherever concurrent access to a single filesystem is needed. Very common on general purpose Linux high availability clusters.
OCFS: The Oracle Clustered File System was originally developed for specific use to allow concurrent access to central storage of Oracle databases for high availability database needs. It is a general purpose clustered filesystem however and can be used for other purposes.
This is anything but an exhaustive list of the filesystems found on or possible on Linux systems. Linux, of course, supports old formats and special media formats like other operating systems like FAT16, FAT32 and ISO9660. It has become increasingly common for special purpose, high performance SSD-only filesystems to be introduced as well.
Suse Filesystem Guide: https://www.suse.com/documentation/sles11/stor_admin/data/sec_filesystems_major.html
Part of a series on Linux Systems Administration by Scott Alan Miller
-
So day to day, what filesystems would a normal Linux Admin expect to encounter realistically?
XFS, EXT4, BtrFS and EXT3. In that order.
-
I think one thing to note is that with EXT4 you can shrink your file system, but cannot with XFS.
-
@johnhooks said:
I think one thing to note is that with EXT4 you can shrink your file system, but cannot with XFS.
Yep. That's the only major difference between the two that I remember anyway.
-
@travisdh1 said:
@johnhooks said:
I think one thing to note is that with EXT4 you can shrink your file system, but cannot with XFS.
Yep. That's the only major difference between the two that I remember anyway.
I think XFS also handles large files better, but I could be wrong.
-
@johnhooks Maybe. I forget the details, but I know they had options to make XFS fast for both lots of small files and fewer very large files scenarios.
-
XFS cannot be shrunk in place, that is correct.
-
EXT4 vs XFS
Filename Length Max File Size Max Filesystem ext4 255 bytes 16 GiB to 16 TiB 1 EiB XFS 255 bytes 8 EiB 8 EiB
-
What is the diference between ext3 and ext4?
Whether ext4 is preferable than ext3?Why? -
@Lakshmana said:
Whether ext4 is preferable than ext3?
Yes, EXT4 is specifically the next generation of EXT3. EXT3 has been legacy since EXT4 releases. Think of Windows 2012 R2 versus Windows 2008 - it's the same team and design but with another seven years of engineering, developments and improvements.
-
Just changing the version name to re-introducing the same filesystem with slight changes.Right
-
@Lakshmana said:
What is the diference between ext3 and ext4?
EXT3: Largest File Size is 2TB (too small for today!) and largest filesystem size is 32TB.
EXT4: Largest File Size is 16TB and largest filesystem is 1EB.EXT4 improved on EXT3 additionally in several ways:
- Moved to extents which improved performance.
- Preallocation is now supported improving media and database performance.
- Delayed allocation improving performance and reducing fragmentation.
- Removes the 32K subdirectory limitation of EXT3
- File system checking is much faster
- Moved to a multiblock allocator which improves on disk placement decision making for lower fragmentation and higher performance.
- Nanosecond filesystem timestamps instead of second ones.
- Transparent encryption added in EXT4.1
-
@Lakshmana said:
Just changing the version name to re-introducing the same filesystem with slight changes.Right
It is not considered the same filesystem. It is very similar, but ext3 and ext4 are not identical on disk, making them different filesystems. But they are based on the same concepts.
-
@scottalanmiller said:
EXT4 vs XFS
Filename Length Max File Size Max Filesystem ext4 255 bytes 16 GiB to 16 TiB 1 EiB XFS 255 bytes 8 EiB 8 EiB
That's a pretty big file.
-
@johnhooks said:
@scottalanmiller said:
EXT4 vs XFS
Filename Length Max File Size Max Filesystem ext4 255 bytes 16 GiB to 16 TiB 1 EiB XFS 255 bytes 8 EiB 8 EiB
That's a pretty big file.
On XFS that's one crazy large file. On EXT4, it's not really. If you wanted to virtualized a moderately sized file server today (smaller than several of NTG's systems) then EXT4 couldn't handle it. The single file size limits of EXT4 are so small that they even can impact the SMB market today. This is a big reason why XFS took over so quickly as the main filesystem on Linux. 16TB isn't "small" but when it represents the entire filesystem for a file server, it starts to look like quite the limitation.
-
I've been using XFS for pretty much everything new for a year or so now. Just seems to make the most sense.
-
@scottalanmiller said:
@johnhooks said:
@scottalanmiller said:
EXT4 vs XFS
Filename Length Max File Size Max Filesystem ext4 255 bytes 16 GiB to 16 TiB 1 EiB XFS 255 bytes 8 EiB 8 EiB
That's a pretty big file.
On XFS that's one crazy large file. On EXT4, it's not really. If you wanted to virtualized a moderately sized file server today (smaller than several of NTG's systems) then EXT4 couldn't handle it. The single file size limits of EXT4 are so small that they even can impact the SMB market today. This is a big reason why XFS took over so quickly as the main filesystem on Linux. 16TB isn't "small" but when it represents the entire filesystem for a file server, it starts to look like quite the limitation.
Ya I meant XFS. I really only use EXT4 if I'm going to be playing with the sizes of the LVs to test stuff. The home partition on my laptop is EXT4 but it's been that way for about 2 years and I don't want to move everything off to change it.
I also usually use EXT4 for USB drives.
-
@scottalanmiller said:
@johnhooks said:
@scottalanmiller said:
EXT4 vs XFS
Filename Length Max File Size Max Filesystem ext4 255 bytes 16 GiB to 16 TiB 1 EiB XFS 255 bytes 8 EiB 8 EiB
That's a pretty big file.
On XFS that's one crazy large file. On EXT4, it's not really. If you wanted to virtualized a moderately sized file server today (smaller than several of NTG's systems) then EXT4 couldn't handle it. The single file size limits of EXT4 are so small that they even can impact the SMB market today. This is a big reason why XFS took over so quickly as the main filesystem on Linux. 16TB isn't "small" but when it represents the entire filesystem for a file server, it starts to look like quite the limitation.
you have files (a VM file) that's larger than 16 TiB?
-
@Dashrender said:
@scottalanmiller said:
@johnhooks said:
@scottalanmiller said:
EXT4 vs XFS
Filename Length Max File Size Max Filesystem ext4 255 bytes 16 GiB to 16 TiB 1 EiB XFS 255 bytes 8 EiB 8 EiB
That's a pretty big file.
On XFS that's one crazy large file. On EXT4, it's not really. If you wanted to virtualized a moderately sized file server today (smaller than several of NTG's systems) then EXT4 couldn't handle it. The single file size limits of EXT4 are so small that they even can impact the SMB market today. This is a big reason why XFS took over so quickly as the main filesystem on Linux. 16TB isn't "small" but when it represents the entire filesystem for a file server, it starts to look like quite the limitation.
you have files (a VM file) that's larger than 16 TiB?
That's not a ton for a file server with large CAD drawings.
-
@johnhooks said:
@Dashrender said:
@scottalanmiller said:
@johnhooks said:
@scottalanmiller said:
EXT4 vs XFS
Filename Length Max File Size Max Filesystem ext4 255 bytes 16 GiB to 16 TiB 1 EiB XFS 255 bytes 8 EiB 8 EiB
That's a pretty big file.
On XFS that's one crazy large file. On EXT4, it's not really. If you wanted to virtualized a moderately sized file server today (smaller than several of NTG's systems) then EXT4 couldn't handle it. The single file size limits of EXT4 are so small that they even can impact the SMB market today. This is a big reason why XFS took over so quickly as the main filesystem on Linux. 16TB isn't "small" but when it represents the entire filesystem for a file server, it starts to look like quite the limitation.
you have files (a VM file) that's larger than 16 TiB?
That's not a ton for a file server with large CAD drawings.
Hold on - why would you put the CAD drawings into a VM at that point? Assuming you aren't saying you have single drawings that are 16 TiB. Why not just dump the CAD files directly into a filesystem themselves?