From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4A23E15AD02 for ; Sun, 16 Apr 2023 18:08:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 12A10E09DF; Sun, 16 Apr 2023 18:08:03 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 41280E09C7 for ; Sun, 16 Apr 2023 18:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1681668475; i=warp_7@gmx.de; bh=/kcZYj1nE6TAc84eTzT6hPQvTBDnJot1+dYYt/HWN0M=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=b3AHGt/mKAPu6TySz+IHUtJpI/525NKAWMzmRu//tQ+LNkXyRLKy3Di+K2p5gSEbz gEotEMUSlCextWLL+veu3MI8vs9H5XdJbBnM/UgfdkQc988dCJw/YtB8wzFiab/tG0 OLTMLbp5VLROj5Osz7oXDycFtvaFSOYrQjYwqmlGlzpBzq37QRutn7/9bFxUZ+g3w5 QwXe7tgEYoUftIGGVq8PVe88Z/1p8J31mHHKAGEN2/Q+NHbBiJBkk5rukZtUGoKJ9u xXKH/Lpds/sil7cym1gbU4o+iby257J3shpFq7hhBrQCNHSc0kMhmMXbkGyVqbIj6b 6J8tf7YOMBnHA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from tp ([80.187.118.200]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuDc7-1qc5701zzR-00uXqR for ; Sun, 16 Apr 2023 20:07:55 +0200 Date: Sun, 16 Apr 2023 20:07:53 +0200 From: Frank Steinmetzger To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Finally got a SSD drive to put my OS on Message-ID: Mail-Followup-To: gentoo-user@lists.gentoo.org References: <3a8a143d-38f0-b7ea-4aa1-10c0b3a2a1e0@gmail.com> <12194979.O9o76ZdvQC@wstn> <19959f07-88a8-f2ee-1523-573f794c9282@iinet.net.au> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aeyvN7O1l7J7Guxl" Content-Disposition: inline In-Reply-To: User-Agent: Mutt 2.2.10; VIM - Vi IMproved 9.0 X-Provags-ID: V03:K1:Q4A6/4tWQFweCJN13rxcoVgiQBqznQaQ/VnkJct0YaqdZWzSwur W82QcSma+weNK47hRFcA9ivz7VNikcFOCE801ubJP4sPU1TsvXnNfk2ngaxlc0l3oFDX08U pGiX1ngqoEXz8GpAmjDztD7u9FteXXb53GRKuzc2k4CN0BA7fO4CQv0V96X7bONQJ9+iLfx TFhxSlE2Am36QXjojvSzg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:YowQ0tFvhtE=;LZUaGLXM12+Jxleq5GxMR5W9DSn wusTuzfwPCEsH27YuXkDe2FSeq8LOJ4ClaqUn0tXto1pfy1v2a1DBGnXCGHVGCKWDEri+LpJ+ TE2Lf3fLmZgRNoQ6MKSEbhC+AL5pAN8tkxKrxqW6F3kgNWxnbCFSINzWH2MheoE/5qn0n9ej2 oX6ZCXaHb7F74iKJsltW7J8TNcrsjaiJ/i/WS9MxPk+YD4KrWDPDugaiBB9jeDzR8bvJjS86T BCyzL8HP4iWcDWzCiJ+IEo4gET5IUGTp84b3zxHStBZBLIgqvAi0ePrnkMjhOlyBCUfgeqhsp EgywcVl+CN6IaQ9YGQCl8fvp35ManfwqXfMSTbRqJP0IIckuCL4qvbWQdhPg99eqEtGtM47EQ GNKFxdW0Bb+KcpHv3nH1UFaBQlwDlGN/kEhq0Z+A6AXUPZ0Wq0Db6B+gvp1V7848c5zK01zKD SOlAUHrYOlDuMlORVvqfcOzgIkUgTM6qy2u4jPulh18f5CTyWrHzhv/Lg2fmpKOYbFQCbxgxm cZEZJjg4j6s5H2h7XTp40BFXJQOl3HLCRUb1DkyfZo0h/L5wdKrahFLjKoGugJvzBQiwNdpyY j4+tFFFNoSHqemQOQmnNgxFGaO8/4Fw2bfJj7dd9bhnoj01+eeKvCx5cYp4nUcMNcwP7aDuGi YBUawHVyA3kD/eW5plXinvK9+Rd3h2kfr7qFG/XX5Pi+QySYYr3H0NnuYgXSMtInzsQl8qtdb LIRR23EAyFimpUlZk6xdQsXGezHwIeh2uqU1cFzcycwP/GboPBO+7T/hUdWClvMiw9fhRXbtC FJrEiNT1j1TXXBMUgJzf/msUVhkkamBn/xZmiWXyLEI3lcD6+9+2UZPbQSAuMwqyoKr1MKRuc Hz+Orfy/cZ7d0RSyugd+u6fxx+ljuoR8dYtb+IYckTTkmCwlScrsfBIJaYxgV1KavSOXLJ6MK PW8Wu6yc5Y0RRo6Z598JzlLMrsc= X-Archives-Salt: 3bf22044-f484-4354-a66f-56f2d4dbffad X-Archives-Hash: 3c57ec46625afb22c67812dc690c7a93 --aeyvN7O1l7J7Guxl Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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'. >=20 > 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. >=20 > 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,= =20 namely to *not* rewrite areas. Flash memory can only be written to in=20 relatively large blocks. So if your file system wants to write 4 KiB, the= =20 drive needs to read all the many kB around it (several hundreds at least,= =20 perhaps eben MiBs, I=E2=80=99m not certain), change the small part in quest= ion and=20 write the whole block back. This is called write amplification. This also= =20 occurs on hard drives, for example when you run a database which uses 4 kiB= =20 datafile chunks, but on a file system with larger sectors. Then the file=20 system is the cause for write amplification. If the SSD knew beforehand that the area is unused, it does not need to rea= d=20 it all in and then write it back. The SSD controller has no knowledge of=20 file systems. And this is where trim comes in: it does know file systems,= =20 detects the unused areas and translates that info for the drive controller.= =20 Also, only trimmed areas (i.e. areas the controller knows are unused) can b= e=20 used for wear leveling. I even think that If you read from a trimmed area, the controller does not= =20 actually read the flash device, but simply returns zeroes. This is basicall= y=20 what a quick erase does; it trims the entire drive, which takes only a few= =20 seconds, and then all the data has become inaccessible (unless you address= =20 the memory chips directly). It is similar to deleting a file: you erase its= =20 entry in the directory, but not the actual payload bytes. AFAIK, SMR HDDs also support trim these days, so they don=E2=80=99t need to= do their=20 SMR reshuffling. I have a WD Passport Ultra external 2.5=E2=80=B3 HDD with = 5 TB, and=20 it supports trim. However, a WD Elements 2.5=E2=80=B3 4 TB does not. Perhap= s because=20 it is a cheaper series. Every laptop HDD of 2 (or even 1) TB is SMR. --=20 Gr=C3=BC=C3=9Fe | Greetings | Salut | Qapla=E2=80=99 Please do not share anything from, with or about me on any social network. =E2=80=9CIt is hard to be a conquering hero when it is not in your nature.= =E2=80=9D =E2=80=93 Captain Hans Geering, =E2=80=99Allo =E2=80=99Allo --aeyvN7O1l7J7Guxl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmQ8OXcACgkQizG+tUDU MMrHOQ/9H0qqUFk+TF4Me2pMfm8xdmTCyK1fXj94JcFIyGIvJjVxjoD69ObUFNmA FE+15jmAR2owavyQbQ+pSm5NoLRGhhku+4NurHf1qzVLnJqogpgj2ZDqVHuiOzxR WE9kxQCPFFCQRbjJeL35rvV+gR8CD96Us5vLDzY7B+9LiBfwl6Hu6+DczQofZfxH VcHNmsgjPuGqF6/HFDng+8v8Z4gcFayCO1a/MXyCkVc17S/Q0RuMQ2Oya8Y7VbWa 1wARUedtwHafzfqjzNL956dL7KkVNFBndN4PS93vs96H9gtU2O0rRzeeeneZOKV9 D/iuvFAVWr4Uaa3HU60iAXs2M2nlP9aixHIDH5TpgY+sSR2ZzUUgy+LArwCef+qx vE848LI5YMNKWw+/URM8tl5VdhVNAyVpTskpZMtoc4WQhMAsjnzAlWR4coe0BuH8 v/uRDnHl9VCU79VnEX9nkwlverSwsVmxCaPHzKU/E7nBInuYxj+uSA2YKXdmQnZP Dud4nugP3JKnYblllyr9S+rn0HTBWUdwApyOY4jFcAjBFIqiVwOaSygbIk/eH8qw X5nx5YtwUYuD1DwfMv/gDrcF71W2g9TCZivDNBVfmJrk7xq/PCXqVmhC5dUXm2VD Gr5csc3SA1RrNs3YDa8p8Kf5v3d9PE7rkCRdtB9ED2mBVFO5PJ8= =IY7f -----END PGP SIGNATURE----- --aeyvN7O1l7J7Guxl--