I have a ThinkPad X13 with 1TB SSD. I am thinking about choosing a filesystem.
I am thinking about faster I/O, especially Random Small Size Reading and Writing.
I am choosing between Ext4, XFS and BTRFS, any suggestions?
Thanks!
I am using ext4 and this filesystem is ~3% slower than the raw data transfer rate of the SSD.
1 Like
I found this benchmark, although it’s from kernel 5.0 days:
Short answer: it depends. You should get least variance with ext4 or XFS though. Btrfs seems to be all around the place, but it has e.g. snapshots and copy-on-write.
1 Like
Zesko
11 October 2022 10:18
4
This benchmark is old, but it is not in a real world use.
See my current benchmark results with Kernel 5.18+ and my dual Nvme SSDs: (Both have Btrfs partition and Ext4 partition)
kdiskmark using fio benchmark isn’t in a real world scenario.
I checked cat for reading a large game data 7z 30 GB in two different partitions (Ext4 and Btrfs) in the same Nvme SSD.
Open bash shell in terminal:
Btrfs
$ time cat Game.7z > /dev/null
real 0m18,430s
user 0m0,045s
sys 0m10,223s
18 sec reading is done
Ext4
$ time cat Game.7z > /dev/null
real 0m28,873s
user 0m0,053s
sys 0m12,955s
28 sec reading is done
However I don’t understand why.
In my other device:
Btrfs and ext4 in the same nvme SSD without LUKS
Btrfs
$ time cat Game.7z > /dev/null
real 0m10,877s
user 0m0,042s
sys 0m8,518s
Ext4
$ time cat Game.7z > /dev/null
real 0m13,300s
user 0m0,029s
sys 0m7,446s
Here is my last copy benchmark:
I have two Nvme SSDs, each SSD has Btrfs and Ext4.
Btrfs: Copying the game “Dota 2” directory without archive from Btrfs SSD A to Btrfs SSD B
$ time cp -r "~/Desktop/dota 2 beta" /run/media/zesko/Backup/dota2_backup
real 0m33,970s
user 0m0,117s
sys 0m26,751s
Ext4 Copying the same game directory from Ext4 SSD A to Ext4 SSD B
$ time cp -r "/media/Steam/steamapps/common/dota 2 beta" ~/VMs/dota2_backup
real 0m39,838s
user 0m0,105s
sys …
Copy benchmark: Btrfs has the deduplication ability, Ext4 does not.
Copying benchmark in a real world using cp.
Let check: Copying the Game data 30 GB in the same filesystem
Ext4:
$ time cp Game.7z Game1.7z
real 0m24,201s
user 0m0,001s
sys 0m21,379s
Btrfs:
$ time cp Game.7z Game1.7z
real 0m0,011s
user 0m0,001s
sys 0m0,003s
Btrfs: copying the data from subvolume to another subvolume: (Linux Kernel 5.17+ improved deduplication)
$ time sudo cp Game.7z /opt/Game1.7z
real 0m2,141s
user 0m0,038s
sys 0m0,016s
Btrfs takes no …
Linux Kernel 6.1 in the future:
A short info:
Linux Kernel 6.1 supports Btrfs async buffered writes, which improves write performance a lot.
https://lore.kernel.org/linux-btrfs/cover.1664798047.git.dsterba@suse.com/
2 Likes
@Zesko This makes me more confident about btrfs, thanks!
How about XFS? It seems to be a more high-performance FS as it provides direct I/O.
Zesko
11 October 2022 14:48
6
Firestar:
How about XFS?
I did not test XFS benchmark. I leave it for external HDD backup, it has more features than Ext4.
I don’t think you’ll get penalized for favoring features over speed on an SSD…