Hi.

On Wed, Sep 29, 2021 at 08:55:31PM -0500, Nate Bargmann wrote:
> * On 2021 29 Sep 09:47 -0500, Reco wrote:
> > On Wed, Sep 29, 2021 at 07:59:50AM -0500, Nate Bargmann wrote:
> > > A test run with KDE Plasma shows that performance is acceptable even
> > > with EXT4 as the file system.  I now have some SanDisk Ultra Fit flash
> > > drives arriving in 128GB capacity (overkill, oh well).  I am now
> > > considering what file system would be proper to use in this case.
> > 
> > A plain ext4 with the 'discard' mount option will do just fine.
> 
> From the ext4(5) man page:
> 
>        discard/nodiscard
>               Controls whether ext4 should issue discard/TRIM commands to  the
>               underlying  block  device when blocks are freed.  This is useful
>               for SSD devices and sparse/thinly‐provisioned LUNs,  but  it  is
>               off by default until sufficient testing has been done.
> 
> LUN?  That's new to me.

You have to live in a dull enterprise world to use that usually.  Take a
disk array, partition it one way or another, provide the resulting LUN
(i.e. part of the array) to the consumer (server) via FibreChannel.

iSCSI has the notion of LUNs too, but to be frank - iSCSI is an overkill
for the consumer hardware, and mostly useless if you have FC. And the
idea of transferring I/O over TCP is questionable to say the least.


> That leads me to think that discard could be problematic on some
> devices.

It's possible. Luckily, they usually blacklist such problematic SSDs in
the kernel itself. I.e. it will function, but TRIM will be ignored.
The best way of avoiding such problem is simply not to buy cheap
Chinese no-name SSDs. Oh, and ADATA. Never buy *anything* that's
produced by them.


> Does a USB flash drive fall into that category?

Not each USB drive gives you TRIM. Different controller, worse chips,
entirely different SCSI commands subset.
A typical SD card usually does provide TRIM on the other hand. May
depend on a card reader of course.


> I've no problem using anacron to run an fstrim(8) job every so often
> if discard is thought to be too aggressive.

Consider enabling e2scrub if you're running bullseye. Requires LVM, but
provides you fsck and fstrim on a mounted filesystem. Disabled by
default though.

> 
> > > I understand that the journal can be disabled when using EXT4 to save
> > > writes which is probably fine (this system will be non-critical).
> > 
> > It's possible to do, but it is not needed that much.
> > If you're trying to conserve drive's resources - just write less on it.
> > I.e. redirecting .xsession-errors to /dev/null, removing that annoying
> > /var/log/journal directory, adding a good set of filters to rsyslog,
> > etc.
> > 
> > For instance, this low-cost SSD that I use in my laptop endured about
> > 1.8 Tb writes over 3.5 year usage, and shows no signs of degradation.
> 
> Presumably there is a difference between an SSD which expects a lot of
> writes and a USB flash drive that expects relatively few by comparison
> used in the role of an SSD/HDD, not?

Yup, a crucial one. Modern SSDs, especially good ones (Samsung tend
producing those), have impressive durability. You literally need to
write tens of terabytes on it to damage it, and the only thing you need
to worry about is overheating.

USB sticks are just as that - throwaway garbage not guaranteed to
survive a single write on it. Form-factor is smaller, and they're
detachable, but these are the only redeeming qualities of them.

Reco

Reply via email to