ShiftPlusOne wrote: ↑
Fri May 08, 2020 7:24 pm
We've been experimenting a bit with making Raspbian a little more resilient to power losses and unreliable sd cards. Logging filesystems like F2FS are a bit more resilient than EXT4, so it's one of the options we're looking at.
If you would like to try an F2FS image...
Bear in mind a couple of important differences:
- Initial boot will take a lot longer, so users running their pi headless should wait a few minutes longer. This is because F2FS resizing takes longer and can't be done in the background.
- Every boot will take about 30 seconds longer. The reliability comes at the cost of longer fsck and mount times.
- Do not use in production.
I put the image on to a couple of different 64GB SD cards, a Samsung Pro (class U1, a couple of years old), and a new SanDisk Extreme (class A2, a month old).
I don't have any load or hardware that has ever caused a corruption, but I was curious to see what IO speed changes there might be, with just the agnostics utility from the Raspian repo.
Code: Select all
sudo apt install agnostics
sh /usr/share/agnostics/sdtest.sh >> pi4-SanDiskExt-f2fs.txt
Observations and opinions:
- On first boot (file system resize) I felt a need for a progress bar while resizing 64GB f2fs to reassure me it was still working properly
- Yes, the reboot time was longer, a pity, but I'm used to bigger computers, so I can live with it
- The Samsung Pro U1 card seems to have had a performance hit in random writes moving from ext4 to f2fs, but my test run on ext4 was a month ago, and only a single run recorded, so maybe not fair to compare?
- I think that f2fs might help the newer card (SanDisk Extreme, class *A2*), raising the random write speeds from max 748 IOPS to 1073 IOPS. The sequential writes range widely across runs with this card, on ext4 between 19MB/sec to 37MB/sec, and on f2fs from 6MB/sec[!!!] to 37MB/sec
- There was no stand-out difference between kernel-4.19, kernel-5.4, or kernel-5.4 64-bit with the card I tested (SanDisk Extreme A2 64GB).
Measurement ranges for different cards, file systems and kernels
Samsung Pro U1 64GB, ext4, kernel 4.19 32bit armv7l, 1 run a month ago after install + upgrade + reboot
Sequential write speed 31507 KB/sec
Random write speed 713 IOPS
Random read speed 3628 IOPS
Samsung Pro U1 64GB, f2fs, kernel 4.19 32bit armv7l, 2 runs, after first boot before and after sudo apt full-upgrade
Sequential write speed 19913-23813 KB/sec
Random write speed 550-611 IOPS
Random read speed 3566-3666 IOPS
Sandisk Extreme A2 64GB, ext4, kernel-4.19 32bit armv7l, 2 runs, after first boot before and after sudo apt full-upgrade
Sequential write speed 16688-37513KB/sec
Random write speed 567-756 IOPS
Random read speed 2533-2847 IOPS
Sandisk Extreme A2 64GB, f2fs, kernel-4.19 32bit armv7l, 6 runs before and after sudo apt full-upgrade
Sequential write speed 5409-36880 KB/sec
Random write speed 759-1073 IOPS
Random read speed 2440-2741 IOPS
Sandisk Extreme A2 64GB, f2fs, kernel-5.4 32-bit armv7l, 2 runs after rpi-update + reboot
Sequential write speed 25157-37321 KB/sec
Random write speed 1013-1055 IOPS
Random read speed 2714-2739 IOPS
Sandisk Extreme A2 64GB, f2fs, kernel-5.4 64-bit aarch64, 2 runs after adding arm_64bit=1 to /boot/config/txt + reboot
Sequential write speed 32653-32899 KB/sec
Random write speed 835-1059 IOPS
Random read speed 2720-2753 IOPS
I'm going to backtrack on the A2 card speed increase that I thought I saw with f2fs. I've done a couple of extra runs back on ext4 again also hit random writes at >1000 IOPS, so this card doesn't seem to *suffer* with f2fs, and/or my setup was to busy for benchmarks, and/or ext4 perks up after a rest
I'm going to put the f2fs image back on and run with it now - this is just a little toy machine behind a TV, but it gets a little use most days.