This is clearly a continuation of this thread:
Since then I have got rid of the questionable practice of storing swap on microSD on Librem 5, which made life better. I have also upgraded to Crimson. But the problem is still there: high IO on microSD crashes the phone.
In particular, now I need to install a Flatpak app onto an microSD installation. To be more precise, I have a LUKS inside LVM on a microSD. I have tried different tricks to limit IO, but each time the phone reboots with a short loud vibration.
I also tried limiting IO bandwidth with cgroups as following, but the phone still crashes.
systemd-run --pty \
-p 'IOWriteBandwidthMax=/dev/dm-2 2M' \
-p 'IOReadBandwidthMax=/dev/dm-2 2M' \
-p 'IOWriteBandwidthMax=/dev/dm-0 2M' \
-p 'IOReadBandwidthMax=/dev/dm-0 2M' \
-p 'IOWriteBandwidthMax=/dev/sda 2M' \
-p 'IOReadBandwidthMax=/dev/sda 2M' \
\
-p 'IOWriteIOPSMax=/dev/dm-2 2K' \
-p 'IOReadIOPSMax=/dev/dm-2 2K' \
-p 'IOWriteIOPSMax=/dev/dm-0 2K' \
-p 'IOReadIOPSMax=/dev/dm-0 2K' \
-p 'IOWriteIOPSMax=/dev/sda 2K' \
-p 'IOReadIOPSMax=/dev/sda 2K' \
flatpak --installation=sdcard install "$APP_NAME"
I also tried to manually pause installation at intervals and resume with the following script only after dstat -tdD total,sda,mmcblk0 5 reported almost no IO activity, but I have not succeeded:
pkill -CONT -e -f /bin/flatpak
sleep 20
pkill -STOP -e -f /bin/flatpak
I have repeatedly tried to install app this way more than a dozen of times in a row with no success. This is frustrating.
UPD: Another symptom is that the phone’s screen often freezes when there is such high IO. When it freezes like that, it has a chance to reset with a buzz, as described above.
I also noticed, that when I write to the same microSD from a laptop using a USB adapter, there is a USB traffic (as reported by usbmon) for a long time after block device IO stops being reported. The block device can not be unmounted until the USB traffic stops. Sadly, I have not found a tool to similarly monitor bus IO on microSD reader in Librem 5.