Ubuntu – Should I turn off kernel logging (and how?) if I’m running off an SSD

dellkernelkubuntussd

I am running Kubuntu 18.04 on a Dell XPS 9370 laptop with no hard disk – just an SSD.

Should I turn off kernel logging to reduce the amount of writes to the FLASH memory on the SSD to prolong its life? And if so, how do I do that?

This question is prompted by press reports that early Tesla cars are now failing due to their SSDs because the imbedded Linux has logging enabled, and is continuously writing to SSD-based log files. I've often read that the number of writes to FLASH is limited, but this is the first concrete example of failure that I have heard about.

Or maybe it is possible to just log to RAM?

Best Answer

It should be preferred to silence logging instead of disabling it (otherwise you might miss something important).

For systemd prior to version 235 you can use

journalctl --priority=3

For newer versions there is parameter in

/etc/systemd/journald.conf

called ReadKMsg= that you need to enable. Make a backup and edit the file; remove the # in front of #ReadKMsg=yes and change yes to no (you can also insert a new line under this one with ReadKMsg=no.

changelog version 235:

journald.conf gained a new boolean setting ReadKMsg= which defaults to on. If turned off kernel log messages will not be read by systemd-journald or included in the logs.


I've often read that the number of writes to FLASH is limited, but this is the first concrete example of failure that I have heard about.

The change above is not going to matter a lot though in regards to writes to the SSD as writing is done sparsely. Then again every 1 less write is 1 less write :)

What might be an issue for Tesla: those SSDs they used might be pretty old disks. And the older SSDs did have issues. Nowadays... not so much.

Related Question