meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
raspberry [2016/03/30 06:09] – [Run fstrim weekly] niziak | home_automation:raspberry:card_wear [2016/11/15 05:43] – raspberry renamed to home_automation:raspberry:card_wear niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Reduce SD Card wearing ==== | + | ====== Reduce SD Card wearing |
- | [[https:// | + | [[https:// |
- | [[https:// | + | [[https:// |
+ | ===== Check who is writing ===== | ||
+ | Start logging disc access and kernel log: | ||
+ | <code bash> | ||
+ | sysctl vm.block_dump=1 | ||
+ | dmesg -e -T -w | ||
+ | </ | ||
- | < | + | Stop logging: |
- | + | < | |
- | Remove syslog | + | sysctl vm.block_dump=0 |
- | < | + | |
- | + | ||
- | Use syslog from busybox package with circular log buffer in RAM: | + | |
- | < | + | |
- | apt-get install busybox-syslogd | + | |
</ | </ | ||
- | Use journald and configure it to use RAM | + | |
- | <file | /etc/systemd/ | + | ===== Set noop elevator ===== |
- | Storage=volatile | + | <file | /etc/rc.local> |
- | Compress=yes | + | ... |
+ | echo noop > / | ||
+ | exit 0 | ||
</ | </ | ||
+ | ===== Use tmpfs ===== | ||
<file | / | <file | / | ||
- | tmpfs | + | tmpfs |
+ | tmpfs / | ||
+ | tmpfs / | ||
</ | </ | ||
- | Move some volatile dirs to tmp folder | + | Move some volatile dirs to tmp folder: |
<code bash> | <code bash> | ||
rm -rf /var/run /var/lock | rm -rf /var/run /var/lock | ||
Line 37: | Line 43: | ||
</ | </ | ||
- | ==== Run fstrim weekly ==== | + | |
+ | ===== Disable logging to disc ===== | ||
+ | |||
+ | <code bash> | ||
+ | systemctl stop mosquitto | ||
+ | systemctl disable mosquitto | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | Remove syslog | ||
+ | < | ||
+ | |||
+ | Use syslog from busybox package with circular log buffer in RAM: | ||
+ | < | ||
+ | apt-get install busybox-syslogd | ||
+ | </ | ||
+ | |||
+ | Use journald and configure it to use RAM: | ||
+ | <file | / | ||
+ | Storage=volatile | ||
+ | Compress=yes | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Run fstrim weekly ===== | ||
+ | Check TRIM support | ||
+ | < | ||
<file | / | <file | / | ||
[Unit] | [Unit] | ||
Line 64: | Line 98: | ||
systemctl enable fstrim.timer | systemctl enable fstrim.timer | ||
</ | </ | ||
- | ==== Broken SD Card ==== | + | |
+ | ===== Broken SD Card ===== | ||
Bad magic number in super-block | Bad magic number in super-block | ||