When choosing File system(disk file system) for Linux installation most of the users will choose default which will be XFS(on most modern Linux distributions), but there is quite a few of file systems available. Lets take a look at different Linux file systems and see what similarities and differences they have.
Unlike Windows Linux kernel supports many different types of filesystems. Linux can also read and write to Windows filesystems.
The Linux kernel interfaces with each filesystem using the Virtual File System (VFS). This provides a standard interface for the kernel to communicate with any type of filesystem. VFS caches information in memory as each filesystem is mounted and used.
In this table you can see very basic features of disk file systems.
|File System||Max File Size||Max Partition Size||Journaling||Additional Information|
|Fat16||2 GiB||2 GiB||–||Not maintained|
|Fat32||4 GiB||8 TiB||–||Not maintained|
|NTFS||2 TiB||256 TiB||Yes||Standard for Windows – supported on Linux|
|ext2||2 TiB||32 TiB||–||Not well maintained|
|ext3||2 TiB||32 TiB||Yes||Standard linux filesystem|
|ext4||16 TiB||1 EiB||Yes||Standard linux filesystem|
|reiserFS||8 TiB||16 TiB||Yes||Not well maintained|
|JFS||4PiB||32PiB||Yes||Not well maintained|
|XFS||8 EiB||8 EiB||Yes||Best choice for a mix of stability and advanced journaling|
XFS file system was designed as Journaling filesystem that performs best when support needed for large files and large filesystems. XFS filesystem is currently default filesystem used for Red Hat. FS has a large number of features that make it suitable for enterprise-level computing in the environments where very large number of files and large file sized need to be supported
BTRFS is fairly new filesystem development for which started back in 2007. This filesystem will offer better scalability and reliability then ext4 and expected to replace it in the future. It is a journaling file system.
|Max volume size||1Ebytes||8Ebytes||16Ebytes|
|Max file size||16 Tbytes||8 Ebytes||16 Ebytes|
Create ext2 filesystem
Create ext3 filesystem
Create ext4 filesystem
Convert from ext2 to ext3
umount /dev/sda2 tune2fs -j /dev/sda2 mount /dev/sda2 /home
Convert from ext3 to ext4
umount /dev/sda2 tune2fs -O extents,uninit_bg,dir_index /dev/sda2 e2fsck -pf /dev/sda2 mount /dev/sda2 /home
If you examine performance results below with many small files. You can see that best read results produces RaiserFS with ext4 good overall performance. XFS follows behind when working with many small files
Using Linux Kernel version 3.1.7 Btrfs: create: 53 s rewrite: 6 s read sq: 4 s read rn: 312 s delete: 373 s ext4: create: 46 s rewrite: 18 s read sq: 29 s read rn: 272 s delete: 12 s ReiserFS: create: 62 s rewrite: 321 s read sq: 6 s read rn: 246 s delete: 41 s XFS: create: 68 s rewrite: 430 s read sq: 37 s read rn: 367 s delete: 36 s
We have done some in house benchmark performance testing with different filesystems like MariaDB, MySQL, Postgres. Although we will not publish full benchmarking results here in a nutchell basic tests show the following.
XFS, Ext4, BTRFS