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

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

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.


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:

  • Is it still bad to use swap on a modern 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:

sudo apt install nvme-cli

Next gather information available from SSD:

$ sudo nvme smart-log /dev/nvme0
Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning                    : 0
temperature                         : 42 C
available_spare                     : 100%
available_spare_threshold           : 10%
percentage_used                     : 0%
data_units_read                     : 28,149,264
data_units_written                  : 19,392,109
host_read_commands                  : 559,538,536
host_write_commands                 : 171,732,762
controller_busy_time                : 1,352
power_cycles                        : 2,384
power_on_hours                      : 1,362
unsafe_shutdowns                    : 133
media_errors                        : 0
num_err_log_entries                 : 608
Warning Temperature Time            : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1                : 42 C
Temperature Sensor 2                : 55 C

The percentage used is 0% after two years. When it hits 100% then theoretically the drive is all used up and needs replacing. But here is someone who has used up 250% which one would think impossible:

  • Wearing out an SSD

To make a long story short, chances are your SSD will outlast your computer system these days.