This is an old revision of the document!

RapsberryPi Operating System Adjustments

Introduced with 1.1.3. For reducing the write cycles on the SDCard we implemented some changes on the default ArchLinux system configuration. These changes contain the move to “in memory” filesystems and kernel parameters. The kernel changes are stored in /etc/sysctl.d/50-sdcard.conf, which are applied during boot-up.

  1. (fstab) /var/log, /tmp, /var/tmp & /run to memory. These folders are runtime folders and are frequently used by the system. The flaw is, that after a reboot the logs are gone. If logs are needed, comment /var/log in /etc/fstab with a #.
  2. (Kernel) vm.swappiness = 1 ⇒ This means, that if swap is available it will only be used if the system is short on memory. Default is 40/60 (depends on Kernel version), which cause the Kernel to page out unused buffers to swap. Read more about: Swappiness
  3. (Kernel) vm.dirty_background_ratio = 50 & vm.dirty_ratio = 80. This Option makes more use of available ram to store written pages. On the one hand, it does increase write speed and the SD card is used more consolidated then with smaller high frequent IO. If 50% free memory is used with written pages, a background tasks starts to write the data to disk. At 80% the system starts to do “blocking writes”, which is more like a “hanging” task.
  4. (Kernel) vm.dirty_expire_centisecs = 30000 (5 minutes) is default value is '3000' which is 30s. This means a page is written to disk latest after vm.dirty_expire_centisecs. This means that a powered off PirateBox will loose data which is up to 5 Minutes old.