[Discuss] Reducing wear on SSD drives - worth the effort and, if so, how?

Rich Pieri richard.pieri at gmail.com
Fri Nov 18 15:35:54 EST 2022


On Fri, 18 Nov 2022 14:01:20 -0500
epp at null.net wrote:

> Debian's man page on /fstrim/ indicates running /fstrim/ frequently
> or using/mount -o discard/, might negatively affect the lifetime of a 
> poor-quality SSD, but for most desktop/server systems, running it
> once a week is sufficient.

Running periodic fstrim is the correct way to properly maintain flash
storage. There is a narrow range of early flash storage for which this
might not be accurate. You can mount with the discard option instead
but this is slow given how TRIM/UNMAP is implemented in the VFS layer.

atime will adversely affect flash storage life but nearly everyone
defaults to relatime these days regardless of storage media.

On Fri, 18 Nov 2022 11:05:52 -0800
Kent Borg <kentborg at borg.org> wrote:

> I have a Dell XPS-13 a couple models old and the stock SSD in it
> reports as a "Micron 2200S NVMe 512GB", which I think is a decent
> part, but I am nervous about SSDs so I did one little thing: I put
> /tmp and /var/tmp in RAM disks, figuring that would move some
> background activity off the SSD.

Putting /tmp on a RAM disk means less writing to /tmp, but since you're
using up RAM for that you'll have commensurately more writes to swap on
your flash storage.

> I have not played with fstrim. I am running XFS on top of LVM on top
> of dm-crypt. I wonder whether things are configured to even know how
> to trim through that. I'll have to look.

It should be automatic on anything running systemd, though adding
dm-crypt adds complexity that I don't routinely have to deal with.

-- 
\m/ (--) \m/


More information about the Discuss mailing list