From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C6FBB1581EE for ; Sun, 23 Mar 2025 23:26:04 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 9EEDB34354E for ; Sun, 23 Mar 2025 23:26:04 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 5887E1104BA; Sun, 23 Mar 2025 23:24:55 +0000 (UTC) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 41A611103B8 for ; Sun, 23 Mar 2025 23:24:54 +0000 (UTC) Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3f68460865aso2257422b6e.0 for ; Sun, 23 Mar 2025 16:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742772293; x=1743377093; darn=lists.gentoo.org; h=in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:to:subject:from:to:cc:subject:date:message-id:reply-to; bh=wSXm/2XdlPWjk/IIm6pdmOTZixarrRdoKqJapzDSAnw=; b=JABntQ7n3gyIscW5aU/WVg6Y4FNqpNwOdt4x2vAG4FEg6f3xpAxbNYZ5tN17LAzeCo N+FI0nwEu5x0LMx2qj6O2eDo9liIEuYoLaeEnT5Uv+O2IXU7q5GwrUD3n/JLdk++0gNv LElie1Xw4ZQlYjvWV138fYXbk425MHQ/VIL3TQjIqPbMzxy9MmkanyCTluStfAOOCW0W UByQB1tKGcWZ68wtv4SxpsZoffW/GjPfJayzsmrnd9zUIpuBh8ffE0ABEiifHPANdnFE Y2lY3zJyWCB8EOaDr4+z+QuEs7WY5pc7K+vDzw5+SKesqzR/dcqifNih9x6l3yZqQ2wK 0wJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742772293; x=1743377093; h=in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:to:subject:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wSXm/2XdlPWjk/IIm6pdmOTZixarrRdoKqJapzDSAnw=; b=QUGxf49bgXXrE7qFRkIBe82lagKlAIapSBegHx1k5bOOlp9dwC7XwDjCdK4zMG3NaC uqyU4pirJpOXlP2IVorLI6LowU+2056fD1C2yuelqwmQKCkaAKDMvL2xq7Gt0NEPLddz tlnG8EBzlh3EpBP3bXhkGnFxwE2cjczrOAzeRg6WxKbBtVNNAoebieu405JUi4BCROLX Xe1gwov5EP21rPh7YStiIygUPJOEuEabRDLuph5S9b3vkTRAu50HtBRDySH0tbK6KCrd sapIZrKu8Jwn8Q2uzycKCzCZ7DjU2SPk0f4y+cbq1vFczIWbyOiCfxHQkyhbP/MGhRCw p3JA== X-Gm-Message-State: AOJu0YyRUPSb8HqxqdepQMlxO3clbv/Q8gMI1OCAr2q/QyZFcyt85gcN hFmrIKH0nGCMuB+aX4gbD5+7s5cN/LqrvRORMw1LtCrv3Juh5zcf X-Gm-Gg: ASbGncsZqPN9pksvy9Wbv1ZaDIt68j7nMuBbyKrK2ofwF6SJPD+IapDKC/VY9/92L3+ KsF7/QidmscMdOJPmzXjMoSuJUheR4Sm0zOTCUnQeLaaMELsnziMGsGEiqAHXol0N5VjcRuz++N ziJazsxkqvJzDEZWpj5L+vWJDGaBZJvhIqwoJzuA1MNHHeGfiG1x6/3mnZPg1zKWf2NpXJJz5Vq 2Os3sA/33gNx/Xl7M24/Hfgrh1f4Qi2Ir9NlIernUsrRcJ+IkgpGuMNNNHcw75xTVF9hSPPctAb 8qP5mJOS+Vp7Iq0C7g1J9DK9t1mpcrqq1RYU6P5IrD54vnXJfymfjfQ= X-Google-Smtp-Source: AGHT+IEXcfO44t8mmX70KKArACbJqIeCTS2E5QAhObaEhtb0PxM8PJmsxFT1pfsIcuSs5yBoswKXuA== X-Received: by 2002:a05:6808:1383:b0:3f7:8f77:2a9e with SMTP id 5614622812f47-3febf73a787mr6492248b6e.20.1742772292950; Sun, 23 Mar 2025 16:24:52 -0700 (PDT) Received: from [10.8.8.5] ([212.102.44.116]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-60234758742sm1029142eaf.18.2025.03.23.16.24.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Mar 2025 16:24:51 -0700 (PDT) Subject: Re: [gentoo-user] What are common SSDs does and don'ts. To: gentoo-user@lists.gentoo.org References: <3275233.5fSG56mABF@rogueboard> <17945501-8b32-3548-bfe7-7d9170327085@gmail.com> <5873402.DvuYhMxLoT@rogueboard> <0366e58b-826c-3ec4-bc94-20a992d21dd0@gmail.com> From: Dale Autocrypt: addr=rdalek1967@gmail.com; prefer-encrypt=mutual; keydata= mQINBGFSciYBEADcEGMyJBSuavKO/XKUVvgkxck7Nl8Iuu8N2lcnRji/rSKg5c1Acix1ll9i oW8JBCHwvn0+Xy60BvEsqcup3YSHw5STl/bR1ePEehtnYrg8FdjdS91+B805RfnKMm69rFVI wLSBHQrSG1yxHd8CloWoEdhmVtP24buajbh114bgXd9ahtpZrCVMrWdWYUg2mEXguGV5uNAh Rf8SWxDNc79w24JxsV34a8niMUYMjzWr0rafIbzk732X38vGjVMLo/2mMpkbp9mPp++LH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gJsqvUWuuJWsgg sDmE92IBnfG/f81fPHWQyfr/SF4wYDMyoFp5xCCQpp1zB63iuFvvrhxBkEHzmbRtVDOhl0Xp BVEDR1w3QRACw9QJD/KM05Czv9JNQYlwinWO/OaQ9cMlUpKLgswUPg9IZ5vucxScfuAUA5uC B1jlAQ8ZPlVukBmbEv5RGOv+lpuEbA3YDMVtEeH4YMFbjt/+vH3Cr2vTbp5JlpByLburJEH0 WXZLUawEfUsZvVwpOuJK75vaa2HYXee+Cb3iCIzwfIfctdlqzUcbGRczlRNM59hpvj4z29Gh 3kAxVHItAYq54ikxQ9l4hQ8s9sLYPbX/WtcBxNX8crBSw0FLnmzGleVEtBHyqtt5CLzQNgrj GYWl1vKDUmRPw1CdZ1c+fMN9CY11jOM5B5ZnqZWfDeVYO2iJ5SuvTycChexCb8WYn1bdCBIo bBtga2RBXbVt4Mh9E4owsszefn51MwfjXxB20Fc5k3GU1AVpTCMs3ayYCzo0b2pvEvdjtDcA CYLEFPWgaFX9iQAM/CDfKvTtvgGWpqtCL2raq/mQoJEU Message-ID: Date: Sun, 23 Mar 2025 18:24:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.20 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 In-Reply-To: Content-Type: multipart/alternative; boundary="------------382EC000834A999999E16D25" X-Archives-Salt: c539894f-aa9a-48ed-8881-7b8b4c3c3ec5 X-Archives-Hash: ad675371e53bce9b16baf0170e08e2f2 This is a multi-part message in MIME format. --------------382EC000834A999999E16D25 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Frank Steinmetzger wrote: > Am Sun, Mar 23, 2025 at 04:41:58PM -0500 schrieb Dale: > >> Michael wrote: >>> On Sunday, 23 March 2025 01:48:01 Greenwich Mean Time Dale wrote: >>>> Michael wrote: >>>>> Finally, consider TRIM being run on a cron job, or better use something >>>>> like the SSDcronTRIM script once a month to decide and execute fstrim if >>>>> needed. >>> [snip ...] >>> >>>> The only thing on SSD is the OS itself. I have partitions for /efi, >>>> /boot with ext2, / and /var with ext4. I'll set up fstrim later on. >>>> Given I have a 1TB stick and left well over 100GBs unused, I should have >>>> room left over to last a while. On my todo list tho. Would once a >>>> month be often enough tho? I update each weekend. Other than that, not >>>> much changes really. /home and such is on spinning rust still. If I >>>> did daily updates, might be a better plan. Once a week, maybe monthly >>>> will be OK. >>> Even once every 3-6 months would be more than enough. The SSDcronTRIM will >>> check if your disk is filling up and will only run fstrim when/if it is >>> needed. >>> >>> https://chmatse.github.io/SSDcronTRIM/ >> That's not in the Gentoo tree.  Hmmmmm.   > For systemd, fstrim ships with a unit file to run it once a week. You could > easily create something for cron. When my NAS is up again (my last remaining > Gentoo system) I could look at how I did it. > >> I ran fstrim on my root and var partitions and got this.  >> >> >> root@Gentoo-1 / # fstrim -v / >> /: 13.7 GiB (14676369408 bytes) trimmed >> root@Gentoo-1 / # fstrim -v /var >> /var: 43.9 GiB (47162359808 bytes) trimmed >> root@Gentoo-1 / # >> >> >> It looks like /var changes more than root does. > The size in the output is usually simply the entire free space. AFAIK fstrim > does not remember what it trimmed at the previous run. That doesn't match.  They may have changed something.  %USED   USED     AVAILABLE  TOTAL MOUNTED ON 11.3%        24.2G    348.5G            392.7G / 37.1%        47.3G    110.8G            176.1G /var I made those big since I hope to be using that thing for a while and nothing is on LVM or anything.  Adding more space could get interesting.  I went big and still have almost 200GBs unused.  >> I kinda wish I just >> could run it on the whole m.2 stick and it do its thing regardless of >> mount point.  From the looks of the man page tho, that isn't a option.  > fstrim -a runs on all file systems. If there is unassigned (unpartitioned) > space on your SSD, then that space is not written to anyways, thus there is > no need for trimming that. I just created this.  I think this will work.  root@Gentoo-1 / # cat /etc/cron.monthly/fstrim-nvme #!/bin/sh fstrim -v / fstrim -v /var root@Gentoo-1 / # I'll try to remember when the next month comes up and see if it ran or not.  It did when I ran run-parts thingy.  I think once a month is plenty soon enough.  Weekly would just be to much.  In another decade, we may not have to do anything to keep these things going.  They just do their thing internally.  Heck, they have improved a lot over the past decade.  Dale :-)  :-)  --------------382EC000834A999999E16D25 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Frank Steinmetzger wrote:
Am Sun, Mar 23, 2025 at 04:41:58PM -0500 schrieb Dale:

Michael wrote:
On Sunday, 23 March 2025 01:48:01 Greenwich Mean Time Dale wrote:
Michael wrote:
Finally, consider TRIM being run on a cron job, or better use something
like the SSDcronTRIM script once a month to decide and execute fstrim if
needed.
[snip ...]

The only thing on SSD is the OS itself.  I have partitions for /efi,
/boot with ext2, / and /var with ext4.  I'll set up fstrim later on. 
Given I have a 1TB stick and left well over 100GBs unused, I should have
room left over to last a while.  On my todo list tho.  Would once a
month be often enough tho?  I update each weekend.  Other than that, not
much changes really.  /home and such is on spinning rust still.  If I
did daily updates, might be a better plan.  Once a week, maybe monthly
will be OK. 
Even once every 3-6 months would be more than enough.  The SSDcronTRIM will 
check if your disk is filling up and will only run fstrim when/if it is 
needed.

https://chmatse.github.io/SSDcronTRIM/
That's not in the Gentoo tree.  Hmmmmm.  
For systemd, fstrim ships with a unit file to run it once a week. You could 
easily create something for cron. When my NAS is up again (my last remaining 
Gentoo system) I could look at how I did it.

I ran fstrim on my root and var partitions and got this. 


root@Gentoo-1 / # fstrim -v /
/: 13.7 GiB (14676369408 bytes) trimmed
root@Gentoo-1 / # fstrim -v /var
/var: 43.9 GiB (47162359808 bytes) trimmed
root@Gentoo-1 / #


It looks like /var changes more than root does.
The size in the output is usually simply the entire free space. AFAIK fstrim 
does not remember what it trimmed at the previous run.

That doesn't match.  They may have changed something. 


%USED   USED     AVAILABLE  TOTAL MOUNTED ON
11.3%        24.2G    348.5G            392.7G /
37.1%        47.3G    110.8G            176.1G /var


I made those big since I hope to be using that thing for a while and nothing is on LVM or anything.  Adding more space could get interesting.  I went big and still have almost 200GBs unused. 



        
I kinda wish I just
could run it on the whole m.2 stick and it do its thing regardless of
mount point.  From the looks of the man page tho, that isn't a option. 
fstrim -a runs on all file systems. If there is unassigned (unpartitioned) 
space on your SSD, then that space is not written to anyways, thus there is 
no need for trimming that.

I just created this.  I think this will work. 


root@Gentoo-1 / # cat /etc/cron.monthly/fstrim-nvme
#!/bin/sh

fstrim -v /
fstrim -v /var
root@Gentoo-1 / #


I'll try to remember when the next month comes up and see if it ran or not.  It did when I ran run-parts thingy. 

I think once a month is plenty soon enough.  Weekly would just be to much.  In another decade, we may not have to do anything to keep these things going.  They just do their thing internally.  Heck, they have improved a lot over the past decade. 

Dale

:-)  :-) 
--------------382EC000834A999999E16D25--