From: Frank Steinmetzger <Warp_7@gmx.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Finally got a SSD drive to put my OS on
Date: Sun, 16 Apr 2023 20:07:53 +0200 [thread overview]
Message-ID: <ZDw5eQsfVcCqYhtG@tp> (raw)
In-Reply-To: <CAK2H+ecL0ndeerMify9D-TOZNBWq5KaDK0Qt+A_YnoQyvR=RUg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2666 bytes --]
Am Sun, Apr 16, 2023 at 08:08:59AM -0700 schrieb Mark Knecht:
> If you have an SSD or nvme drive installed then fstrim should be
> installed and run on a regular basis. However it's not 'required'.
>
> Your system will still work, but after all blocks on the drive have
> been used for file storage and later deleted, if they are not
> written back to zeros then the next time you go to use that
> block the write will be slower as the write must first write
> zeros and then your data.
>
> fstrim does the write to zeros so that during normal operation
> you don't wait.
That is not quite correct. Trimming is about the oppisite of what you say,
namely to *not* rewrite areas. Flash memory can only be written to in
relatively large blocks. So if your file system wants to write 4 KiB, the
drive needs to read all the many kB around it (several hundreds at least,
perhaps eben MiBs, I’m not certain), change the small part in question and
write the whole block back. This is called write amplification. This also
occurs on hard drives, for example when you run a database which uses 4 kiB
datafile chunks, but on a file system with larger sectors. Then the file
system is the cause for write amplification.
If the SSD knew beforehand that the area is unused, it does not need to read
it all in and then write it back. The SSD controller has no knowledge of
file systems. And this is where trim comes in: it does know file systems,
detects the unused areas and translates that info for the drive controller.
Also, only trimmed areas (i.e. areas the controller knows are unused) can be
used for wear leveling.
I even think that If you read from a trimmed area, the controller does not
actually read the flash device, but simply returns zeroes. This is basically
what a quick erase does; it trims the entire drive, which takes only a few
seconds, and then all the data has become inaccessible (unless you address
the memory chips directly). It is similar to deleting a file: you erase its
entry in the directory, but not the actual payload bytes.
AFAIK, SMR HDDs also support trim these days, so they don’t need to do their
SMR reshuffling. I have a WD Passport Ultra external 2.5″ HDD with 5 TB, and
it supports trim. However, a WD Elements 2.5″ 4 TB does not. Perhaps because
it is a cheaper series. Every laptop HDD of 2 (or even 1) TB is SMR.
--
Grüße | Greetings | Salut | Qapla’
Please do not share anything from, with or about me on any social network.
“It is hard to be a conquering hero when it is not in your nature.”
– Captain Hans Geering, ’Allo ’Allo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-04-16 18:08 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-15 22:47 [gentoo-user] Finally got a SSD drive to put my OS on Dale
2023-04-15 23:24 ` Mark Knecht
2023-04-15 23:44 ` thelma
2023-04-16 1:47 ` William Kenworthy
2023-04-16 7:18 ` Peter Humphrey
2023-04-16 8:43 ` William Kenworthy
2023-04-16 15:08 ` Mark Knecht
2023-04-16 15:29 ` Dale
2023-04-16 16:10 ` Mark Knecht
2023-04-16 16:54 ` Dale
2023-04-16 18:14 ` Mark Knecht
2023-04-16 18:53 ` Dale
2023-04-16 19:30 ` Mark Knecht
2023-04-16 22:26 ` Dale
2023-04-16 23:16 ` Frank Steinmetzger
2023-04-17 1:14 ` Dale
2023-04-17 9:40 ` Wols Lists
2023-04-17 17:45 ` Mark Knecht
2023-04-18 0:35 ` Dale
2023-04-18 8:03 ` Frank Steinmetzger
2023-10-07 7:22 ` Dale
2023-04-16 17:46 ` Jorge Almeida
2023-04-16 18:07 ` Frank Steinmetzger [this message]
2023-04-16 20:22 ` Mark Knecht
2023-04-16 22:17 ` Frank Steinmetzger
2023-04-17 0:34 ` Mark Knecht
2023-04-18 14:52 ` [gentoo-user] " Nikos Chantziaras
2023-04-18 15:05 ` Dale
2023-04-18 15:36 ` Nikos Chantziaras
2023-04-18 20:01 ` Dale
2023-04-18 20:53 ` Wol
2023-04-18 22:13 ` Frank Steinmetzger
2023-04-18 23:08 ` Wols Lists
2023-04-19 1:15 ` Dale
2023-04-18 20:57 ` Mark Knecht
2023-04-18 21:15 ` Dale
2023-04-18 21:25 ` Mark Knecht
2023-04-19 1:36 ` Dale
2023-04-18 22:18 ` Frank Steinmetzger
2023-04-18 22:41 ` Frank Steinmetzger
2023-04-19 1:45 ` Dale
2023-04-19 8:00 ` Nikos Chantziaras
2023-04-19 9:42 ` Dale
2023-04-19 10:34 ` Peter Humphrey
2023-04-19 17:14 ` Mark Knecht
2023-04-19 17:59 ` Dale
2023-04-19 18:13 ` Mark Knecht
2023-04-19 19:26 ` Dale
2023-04-19 19:38 ` Nikos Chantziaras
2023-04-19 20:00 ` Mark Knecht
2023-04-19 22:13 ` Frank Steinmetzger
2023-04-19 23:32 ` Dale
2023-04-20 1:09 ` Mark Knecht
2023-04-20 4:23 ` Dale
2023-04-20 4:41 ` eric
2023-04-20 9:48 ` Dale
2023-04-20 23:02 ` Wol
2023-04-20 8:55 ` Frank Steinmetzger
2023-04-20 8:52 ` Frank Steinmetzger
2023-04-20 9:29 ` Dale
2023-04-20 10:08 ` Peter Humphrey
2023-04-20 10:59 ` Dale
2023-04-20 13:23 ` Nikos Chantziaras
2023-04-20 12:23 ` Frank Steinmetzger
2023-04-20 9:46 ` Peter Humphrey
2023-04-20 9:49 ` Dale
2023-04-18 17:52 ` Mark Knecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZDw5eQsfVcCqYhtG@tp \
--to=warp_7@gmx.de \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox