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?
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
For newer versions there is parameter in
called
ReadKMsg=
that you need to enable. Make a backup and edit the file; remove the#
in front of#ReadKMsg=yes
and changeyes
tono
(you can also insert a new line under this one withReadKMsg=no
.changelog version 235:
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.
The linux kernel is well aware of SSDs for a long time and default installations seem to work just fine "out-of-the-box".
I would leave logging and everything else to the default settings. From time to time I would monitor the life span of the SSD:
The above answer details how to check your remaining life of your SSD:
First step is to install
nvme-cli
because it provides the most information:Next gather information available from SSD:
The percentage used is
0%
after two years. When it hits100%
then theoretically the drive is all used up and needs replacing. But here is someone who has used up250%
which one would think impossible:To make a long story short, chances are your SSD will outlast your computer system these days.