On 2/21/24 13:14, David Christensen wrote:
On 2/21/24 03:00, Jörg-Volker Peetz wrote:
Hi,

did you take a look at the smartctl output?

Somewhere I read, for maintainance of an SSD all it's cells should be read from time to time like this

sudo dd if=/dev/DEVICE of=/dev/null bs=8M status=progress

where device is something like sda or nvme0n1, especially if it was switched off for a longer period. At least, it shows the current read performance of the device. An SSD should regularly be trimmed, if in use. This is to assist it's wear leveling process.

What's your opinion?

Regards,
Jörg.


I prefer to run a SMART long test periodically.  This should read every cell, including those that are reserved and not visible to the OS.


AIUI So long as the SSD can maintain a supply of erased cells via manufacturer over-provisioning, trim is not required to maintain performance.  If you have workload that does a lot of writes in a short period of time and exhausts the manufacturer over-provisioning, leaving free space on the SSD and trimming can be a work-around.


If you are using strong encryption, not trimming will leave crypttext on disk that creates more work for an attacker.  If you are using weak encryption, not trimming will leave crypttext on disk that an attacker can recover.


For imaging/ cloning, trimming will zero blocks freed by the OS and facilitate compression of the image file.


I have a SOHO network with about two dozen disks.  Running smartctl by hand is a PITA.  Running fstrim(8) by hand is easy enough.  I try to do both once a month.  I need to figure out smartd(8).


David



#!/usr/bin/dash -
drives="$(lsblk|grep '^sd')"
for i in $drives;do
        case $i in
                sd*) sudo smartctl -a /dev/"$i" ;;
                *)   : ;;
        esac
done


Reply via email to