So you got yourself a shiny new USB drive and are not too sure what file system to format it with. Sure, FAT is great for compatibility reasons with other operating systems, but there are better options for Linux users. Although the following choices may not be compatible with many other operating systems, if you’re only going to use it on Linux, then read ahead.
My tests will be performed on a system running Linux Mint Debian Edition and with an attached 160GB Seagate hard drive and a standard 4GB Toshiba USB drive. The file systems I’ll be testing out are all the most recent and updated packages available in the Debian ‘Testing’ repository. I’ll be checking out NILFS, Btrfs and Ext4. All tests will be performed in a console environment. No graphical file manages will be used. This is to ensure that minimal resources are used for other system processes other than the file copy process and will help get the most accurate results I can get.
Results I will be focusing on for this test will be Write times for the file copy process from hard drive to the USB drive. And then those same files will be copied off the USB drive and back to the hard drive. This will measure the Read times from the USB drive. In addition to Write/Read times, I will also post up the Average transfer speed range I witnessed during the copy phase of the test.
Enough said already, let the testing begin!
For my tests, I’ll be using a small range of different file types, slight size variations and directories. This will give a clear indication of how different files and directory types and sizes effect transfer times.
For my first test, I will be trying the new kid on the busy block of Linux file systems, NILFS. Before performing this test, I honestly had no clue as to how NILFS performance would stack up against the slightly more established file systems of Ext4 and even Btrfs.
NILFS Results (Write test – HDD > USB)
Single PDF file: 24.2 seconds
Single AVI file: 3 minutes 17 seconds
Directory of 20 MP3 files: 51.1 seconds
Directory of 20 ZIP archives: 7.7 seconds
1GB mixed directory of different file types: 3 minutes 52.2 seconds
NILFS Results (Read test – USB > HDD)
Single PDF file: 5.6 seconds
Single AVI file: 42.5 seconds
Directory of 20 MP3 files: 11.6 seconds
Directory of 20 ZIP archives: 1.8 seconds
1GB mixed directory of different file types: 49.2 seconds
NILFS overall average transfer time for Write test: 3.90MB/s – 4.20MB/s
NILFS overall average transfer time for Read test: 13.00MB/s – 18.90MB/s
Btrfs Results (Write test – HDD > USB)
Single PDF file: 5.3 seconds
Single AVI file: 2 minutes 16.6 seconds
Directory of 20 MP3 files: 26.8 seconds
Directory of 20 ZIP archives: 1.5 seconds
1GB mixed directory of different file types: 2 minutes 41.4 seconds
Btrfs Results (Read test – USB > HDD)
Single PDF file: 5.5 seconds
Single AVI file: 43.6 seconds
Directory of 20 MP3 files: 11.6 seconds
Directory of 20 ZIP archives: 1.9 seconds
1GB mixed directory of different file types: 48.4 seconds
Btrfs overall average transfer time for Write test: 4.90MB/s – 13.00MB/s
Btrfs overall average transfer time for Read test: 15.3MB/s – 18.30MB/s
Ext4 Results (Write test – HDD > USB)
Single PDF file: 4.0 seconds
Single AVI file: 2 minutes 17.6 seconds
Directory of 20 MP3 files: 28.3 seconds
Directory of 20 ZIP archives: 0.5 seconds
1GB mixed directory of different file types: 2 minutes 40 seconds
Ext4 Results (Read test – USB > HDD)
Single PDF file: 6.8 seconds
Single AVI file: 36 seconds
Directory of 20 MP3 files: 11.6 seconds
Directory of 20 ZIP archives: 1.9 seconds
1GB mixed directory of different file types: 48.5 seconds
Ext4 overall average transfer time for Write test: 5.10MB/s – 18.10MB/s
Ext4 overall average transfer time for Read test: 13.00MB/s – 25.00MB/s
Conclusion and Final Results
As indicated by the test results above, there really is not much difference between Btrfs and Ext4. In fact, the results are so close that I would declare neither file system a winner and it’s fair to say that they are both on par with one another.
What really stood out as a surprise was the difference between NILFS and the other two file systems. I wouldn’t say I am disappointed with the results of NILFS but I would guess that those numbers indicate the difference in attributes between the three file systems. It’s worth pointing out that Ext4 development at least had a head-start, built on the foundations of its predecessors Ext3 and Ext2. Whereas NILFS was designed and built from scratch. And Btrfs has been in development for many years and according to Wikipedia, is still declared as unstable. I find it rather amusing it is still classed as unstable and under development. Personally, I have been using Btrfs in various forms and iterations on various storage hardware for a long time and am yet to have any issues of data loss.
But it’s not all negative news for NILFS, despite the slow write times, NILFS showed that it was well capable of keeping up with the opposition when it comes to read times. And in just a couple of the tests, NILFS was able to edge out Ext4. But only by a very narrow margin. In a realistic world, between all three file systems tested, there was not much to differ.
Taking into account all of the above information, I would highly recommend that you choose a file system that you feel comfortable using. There is no single file system to suit all purposes for everyone. Hence why we have many different options to choose from. But I strongly advise that if it’s operating system (Linux, Unix, Windows and Mac OS) compatibility that you absolutely require, then you must stick to FAT. You’ll find no better option that ‘just works’ on almost any system that you plug in to.