• Re: [gentoo-user] What are common SSDs does and don'ts.

    From Michael@21:1/5 to All on Sat Mar 22 21:37:37 2025
    On Saturday, 22 March 2025 18:50:48 Greenwich Mean Time Dale wrote:
    Howdy,

    As most know from other threads, I have a couple external m.2 NVME SSD
    drives thingys. As of today, I now have a Crucial 480GB and 1TB and a Samsung 1TB drive. I also have a Samsung 1TB m.2 in my main rig for the
    OS. I read some things ages ago about these things when they first came
    out and people were still learning about what to do and not do with
    them. At the time there was a lot of confusion as they were new and
    people were testing options. I figure by now, it is fairly well known
    what not to do with these things and what should be done to make them
    perform well and last longer. So, I have questions but also feel free
    to share other info as well that would be good to know. I plan to make
    a cheat sheet out of the info.

    First, for mount options. Should I have any mount options included in
    fstab for the OS m.2 in my main rig?

    Yes, noatime

    Also, depending on your filesystem choice you could benefit from compression.

    For more esoteric formatting on RAID arrays and assuming the necessary information is provided by the OEM, read here about block erase size:

    https://wiki.gentoo.org/wiki/SSD

    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.

    NOTE: With LUKS encrypted partitions you have to pay particular care - TRIM
    can compromise the security of your data and LUKS devs warn about it.
    However, on a drive with a lot of re-write ops you will at some point need/ want to run fstrim. In this case you'll have to run cryptsetup with '--allow- discards', before you run fstrim.


    Also, for the external USB mounted
    ones, should I put mount options somewhere for those? If so, since
    there is no fstab entries, where would I put those options? Some I use
    the automount tool built into KDE.

    You can create udev rules to apply any options you need, but I don't know what options may be applied by default by udev. Bear in mind, preferred mount options depend not only on the filesystem, but also on the USB controller and its ability to process SCSI commands (e.g. dumb UFDs Vs smart(er) UAS).


    Now to add more questions. I'm sure running shred, dd, wipe and other similar commands would shorten the life of one of these things. Is
    there other things I should avoid doing that is common on spinning rust drives? Are there any other don'ts I should be aware of?

    With older SSDs you may need to leave some spare capacity unused (overprovisioning). Modern SSDs apply firmware based overprovisioning transparently to the user, and you are going to be filling them up
    relentlessly you should be able to increase the overprovisioning amount by using the OEM's utility software, or hdparm.

    https://www.thomas-krenn.com/en/wiki/SSD_Over-provisioning_using_hdparm

    Personally, I just leave some non-partitioned space more as a force of habit than need.


    Are there things I should do on occasion that will make them perform
    better, last longer or both? Keep in mind, some may only be mounted
    with USB. That may limit some options. So far, the m.2 enclosure I use allows SMART to get info at least. Oh, what info does SMART give that I should keep a eye on for failures or problems? I also installed a
    package that includes the nvme command. I'm not real sure what to do
    with that thing, yet. o_o

    You probably want to alter the cache path for your browser from the SSD drive to your RAM (tmpfs), especially if you have a lot of RAM. Consider the same for any configurable applications which are caching heavily.

    Also, if you use swap, then use zswap to reduce the amount written to the
    disk.


    Now that I have a few of these things, I don't want to do something that
    lets the smoke out. O_O Oh, links to good info would also be OK.

    Thanks.

    Dale

    :-) :-)

    You wouldn't go wrong by starting with these two pages:

    https://wiki.gentoo.org/wiki/NVMe

    https://wiki.gentoo.org/wiki/SSD

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmffLaEACgkQseqq9sKV Zxnl9BAAzN3j2Kb58yMxX+0hqZ//gAGYeP7RVDy3p2TKXYiaEzahLpUvypcvLe/G SmEy/SIqbJtEgwUdu6RvtfUhZfYUAcUexIcCk4EeAPCK6j5oatS6rndcbPsJbzJ0 nexMzxSBOrhD+b7/gm9qxxoeh/DtBQAPftzVJ/XqXmK0PgFzHR+h6VSHovRa0v37 LlYFxy4g2Em5YDYzQueZ8uDDvfvLUBOHkB6vRVBxvq3sb875b6GzBpPn/cVgRIm7 gQXrF8nBs4WfHG6AURQRB1ANbqAJtLdcJVA/93UOtqZcMOIJNHf2OSfhDYT2eF87 Me1CN/xksHZK9TVNGmAfDfl0DjB8Nl0tAV5rPWFeFZ2CHGQtVWwTJmKhKxbhfw+b cGm3VqUGQVe1ePkSijFgRNCTYahxRpIiXjcMUzO+gNUMNCyo4K+BBm7lcuG0cdjX rj3nVcrq0SwY8hu4uvZ11zvoYLIGQqXp7ePyTd4jch9ad5rUIEezwh+45HoLtjBf unt/z8CnmwpELQzoEDGF9GZCb2BLJTTHqDWeKh3KzbPX60pH2xx1wQwbYr2a0azQ YUwWr4L88xv2ZcKz3M3FFZC7A8Habk9foTZnMPOE3Ene5xcHDqKvl369SVvq5Vg3 s1dvzAHaOgv2xb0urafyIJxqkUptKc9ULWPK/pSHmwgjpfOCgjs=
    =CGgp
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matt Jolly@21:1/5 to Michael on Sun Mar 23 05:40:01 2025
    Hi,

    On 23/3/25 07:37, Michael wrote:
    You probably want to alter the cache path for your browser from the SSD drive to your RAM (tmpfs), especially if you have a lot of RAM. Consider the same for any configurable applications which are caching heavily.

    Also, if you use swap, then use zswap to reduce the amount written to the disk.


    You really don't have to worry about the number of writes to a modern
    flash memory device. SD cards and particularly terrible early flash
    storage devices may have hit write limits but regular use on a system
    is quite unlikely to result in excessive writes to a device.

    If you already _have_ the RAM feel free to use tmpfs, buying more
    (relatively expensive) RAM to extend the lifetime of a far cheaper
    component isn't really a good value proposition.

    Here's the stats on one of my local NVMes for comparison:

    Data Units Read : 148609192 (76.09 TB)
    Data Units Written : 232034557 (118.80 TB)


    It's a 1TB, consumer-level device, and there's probably still a good
    decade of daily use left in it (including oddball projects like
    compiling every package in ::gentoo) before I have to think about
    replacing it due to age/usage; the bigger concern will be size and
    bandwidth before the part actually ages out.

    Cheers,

    Matt

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From netfab@21:1/5 to All on Sun Mar 23 08:00:01 2025
    Le 22/03/25 à 21:37, Michael a tapoté :
    You probably want to alter the cache path for your browser from the
    SSD drive to your RAM (tmpfs), especially if you have a lot of RAM.

    For firefox, you may want to disable cache-on-disk and enable
    cache-on-memory instead of setting-up the tmpfs stuff.

    https://netfab.frama.io/posts/disable-firefox-disk-cache/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From netfab@21:1/5 to All on Sun Mar 23 08:10:01 2025
    Le 23/03/25 à 08:01, Dale a tapoté :
    netfab wrote:
    Le 22/03/25 à 21:37, Michael a tapoté :
    You probably want to alter the cache path for your browser from the
    SSD drive to your RAM (tmpfs), especially if you have a lot of RAM.
    For firefox, you may want to disable cache-on-disk and enable cache-on-memory instead of setting-up the tmpfs stuff.

    https://netfab.frama.io/posts/disable-firefox-disk-cache/

    Isn't the cache for Firefox inside the /home partition?  If it is,
    /home is on spinning rust still.  Just the OS itself is on the m.2
    stick. 

    Yes. ~/.cache/mozilla/firefox/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sun Mar 23 09:00:33 2025
    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/

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmffzbEACgkQseqq9sKV ZxleHhAA2qJ3zBSLB3Evze1v8fyw/B20MW/35q5sdA42fDON5PB/SxcDzwdWHJKI TES7crqFAjkoaLMIGDwAHsmOtLX8DLRrgrE3IJhVIYeOoNEgW+/ylG9JAnaJtFcK HVEwk7A12fwBC+7bT4fgL+4xwvCzPgt7R2jmyxWdDcvTLB5pzIbDAvkk7c9d+qTv fEej+tjY/Ikt/nl+/lZJ256oquDjq8RacZMdnweOXALw9iDc/QEMttcL0rn556+t T+GgxmJ4UIVoUfcvSF+489/Ha6DPxsv8HwnlJfzbqh0+DNGfK/soyUER0M7siiVi q1WzBkQsi7tJFuPa7nLds27dl6b9m8F32Sdg/6wT1hR5BzKY0WlkwxslVn+MHdiH bPmmEDh0F3TKoFCJGB8lYJqb17vsxb2LzOx+hxsOy39MVUpR7Q6dvpRnk8pSYIAn hu+Sj7rSCNMpZDG5Yed/zWlxUwY9oGC0W6ar0U66a3B71zECYnAi2XTDHTbjtbmG BMQ2c33kdkBr77T0aj+QkEuZkBW1zxVImAmoTBegD1EJI8LwCdtYtoji18GeH0Ca 93kzG5+bTjX/tNg4M2p8ftWbA8NZq2aAjYCV5rxWdrzjoimmVVAQx+zZmTPTo2SG 6SI8HPB7xkk0Gi5apIsf57Kxufpo4re58xyqoxQKdWB1E0Gy+VA=
    =cWb9
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Eldredge@21:1/5 to All on Sun Mar 23 23:20:02 2025
    On Mar 23, 2025, at 15:41, Dale <rdalek1967@gmail.com> wrote:

    It looks like /var changes more than root does. 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 is a filesystem-level operation, and needs support from the specific fs in the kernel (to know which blocks are unused and candidates for trimming, to lock them in some fashion so that they remain unused while the trimming is in progress, to keep
    checksums consistent, etc). Some filesystems don't support it at all. So there's no way it could operate on the level of an entire drive.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Steinmetzger@21:1/5 to All on Sun Mar 23 23:40:02 2025
    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.

    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.

    --
    Grüße | Greetings | Salut | Qapla’
    Please do not share anything from, with or about me on any social network.

    “Today I watched my first porn movie.” – “And?” – “I was so young back then.”

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmfgjBkACgkQizG+tUDU MMrcZxAAi0nXXxt6eqDFXzISZc63fcMkImGvg+V541BdmLQ1lUkQKdO9RXYLjY8W HPWIOYlOmpgGSVX+XRBXfUS78gpytYMjIQTaEUqpHLEyQCtgjMcEKuwBMMUi/5+y hyoXPfMlSMnaeZ/ll+S8oJalnVMR2lU7wpypa3FMiN6B9X3kgA2rmppPKoXCxEog vhVS4bQYtywfnDJDe3GNOor5+B8aLP8wdy1qI3hylOtn+UBWWAipAwKJLQE1t4g3 1At6p7m8SBGbZVbcF9FqkgWAIZrqT7eeTSgLj2dI+Gy1m8c5xqh1Oaod/7qx+/Vo QJopeE8UbnYyNaAn48GyyvRExgEO0bC6IHxUcpKW+QjNNbgYrUli4nHR1kSx9ai0 9hn0fJuMyEaubA51/v/42LMO/EkOedLQIYOWp170XflCuHJHPcu1TcpxfGtbfmG2 6u4KVBYatxSoChqEaH/Al2rmGDoFC6m5ytTsCxt6NoNh69MMq3+tL57agGdUJqb3 BYTAkhQf9oexPI0fbfwNMixM/BRNl7ySmvJeRrtHN+37YjZ/SbZJgUyGIArJ1mKE 0PEpcW/Q7x8k/rdLefqE6Os2mlWjPqx8B3cC0sSLEfiRVEwAJi2hLgOU5w871gZi lLJLVNbKRM7A1Ufcex2TszhTGeRz1vpLOCHuz166BLq9P
  • From Frank Steinmetzger@21:1/5 to All on Sun Mar 23 23:50:01 2025
    Am Sat, Mar 22, 2025 at 09:37:37PM +0000 schrieb Michael:

    On Saturday, 22 March 2025 18:50:48 Greenwich Mean Time Dale wrote:
    Howdy,

    As most know from other threads, I have a couple external m.2 NVME SSD drives thingys. As of today, I now have a Crucial 480GB and 1TB and a Samsung 1TB drive. I also have a Samsung 1TB m.2 in my main rig for the OS. I read some things ages ago about these things when they first came out and people were still learning about what to do and not do with
    them. At the time there was a lot of confusion as they were new and
    people were testing options. I figure by now, it is fairly well known
    what not to do with these things and what should be done to make them perform well and last longer. So, I have questions but also feel free
    to share other info as well that would be good to know. I plan to make
    a cheat sheet out of the info.

    First, for mount options. Should I have any mount options included in fstab for the OS m.2 in my main rig?

    Yes, noatime

    Also, depending on your filesystem choice you could benefit from compression.

    I’m experimenting with f2fs (the flash-friendly file system), but recently ran into a road block with it: it does not support shrinking. Ooops, so now
    I can’t enlarge / on my mini PC, because /home is f2fs.

    NOTE: With LUKS encrypted partitions you have to pay particular care - TRIM can compromise the security of your data and LUKS devs warn about it.

    This is for people who not only don’t want to have their data leaked, but also the information how much data is on their drive. As a private person
    that does not do any really dangerous business like politics, leaks and so
    on, this is an irrelevant attack vector for me.

    However, on a drive with a lot of re-write ops you will at some point need/ want to run fstrim. In this case you'll have to run cryptsetup with '--allow-
    discards', before you run fstrim.

    You can make --allow-discards a permanent option, if you combine it with --persistent. So you open the container with it once and then have to never think
    about it anymore.

    Are there things I should do on occasion that will make them perform better, last longer or both?

    Steve Gibson, the author of SpinRite, had testimonials in his Security Now podcast of people using his tool on old SSDs that became very slow. Afterwards, the SSDs were back to their former glory. I guess because the
    tool read it from start to finish so the controller was forced to check
    every cell (that was in use).

    You probably want to alter the cache path for your browser from the SSD drive
    to your RAM (tmpfs), especially if you have a lot of RAM.

    Ouh yeah, firefox writes a backup of its internal state every 15 s or so.
    If you leave many tabs open, this amounts to many 100 kB minute.
    Check with iotop --only --accumulated


    --
    Grüße | Greetings | Salut | Qapla’
    Please do not share anything from, with or about me on any social network.

    Save water! Dilute it!

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmfgj0wACgkQizG+tUDU MMpNoRAAkht7AjN7wsCmFWbSqsvuPFzAMDkTuZ8wv5Eu3RD55fyse1Svwa/iF9vt ELzcglWnKLsMJ6HHKW1MZpQuXTcblAdBB6n61kt6BwRmENLDLhbjxS8VBf49+fnb lyRvVZFR3cS/vW4vZ3LxgF2jaKpvg0qyGXcbDKOklVGe1wJ4H2FKZile7kA/17jd QBSXAtmPfBGTClTpP/FjDS5vrXmicuTPM75v9/2CZFUriKL0R5laxZh6KYi89wva L3fcrmlNhqC8xzfjrwiQZNJc9wO8seopiXGrExqUZIv3gWRh3BLMbux/eOnB/gDN 9RJcAevW8U4lGgBnso65pdQniicGJ6T3Pc6JkS2cSSWyJd0JDz0bWJ94tN/NrLm9 by7IVeMLQPe7bjlJxJv1x6KcZNJFDDxQ8djl6m9wJD9E7B8bgULll/Mw2q4auvmx VpSPf9jbQTDXO//IZhWo9jx1arGiExKH/bUt8rXVpI9Dq5DfZY9rlmx/4+jPl0LI z4HUEdWhoENRPEV1BasbuVh3ZS/7DiaqUM1GjohTHDkcb8qjxO67R05yuIXI0lYk QEHYanvoJtvxI6gw6jnX35wk8WNzlbRmBlzVkiWHbK2d/C3CU2VdoEjkHwtZGFxj AHZ05swa1Xlccw8Lounbvkl/vxPgUre/TOpnuZOd2Xf/TC9s/0c=
    =U1gA
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
  • From Frank Steinmetzger@21:1/5 to All on Mon Mar 31 23:30:01 2025
    Am Sun, Mar 23, 2025 at 06:24:49PM -0500 schrieb Dale:

    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

    Funnily it does for me:

    $ journalctl -fu fstrim
    Mär 31 23:03:26 q systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
    Mär 31 23:06:27 q fstrim[4946]: /mnt/windows: 62.6 GiB (67195392000 bytes) trimmed on /dev/nvme0n1p3
    Mär 31 23:06:27 q fstrim[4946]: /mnt/gentoo: 25.1 GiB (26987544576 bytes) trimmed on /dev/vg/gentoo
    Mär 31 23:06:27 q fstrim[4946]: /mnt/data: 410.3 GiB (440560844800 bytes) trimmed on /dev/vg/data
    Mär 31 23:06:27 q fstrim[4946]: /home: 14.5 GiB (15569068032 bytes) trimmed on /dev/vg/home
    Mär 31 23:06:27 q fstrim[4946]: /boot: 211.4 MiB (221700096 bytes) trimmed on /dev/nvme0n1p1
    Mär 31 23:06:27 q fstrim[4946]: /: 8.6 GiB (9203961856 bytes) trimmed on /dev/vg/root
    Mär 31 23:06:27 q systemd[1]: fstrim.service: Deactivated successfully.

    $ df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/vg-data 1.4T 956G 411G 70% /mnt/data
    /dev/mapper/vg-gentoo 50G 25G 25G 50% /mnt/gentoo
    /dev/mapper/vg-home 199G 184G 15G 93% /home
    /dev/mapper/vg-root 50G 41G 8.2G 84% /
    /dev/nvme0n1p1 300M 89M 212M 30% /boot
    /dev/nvme0n1p3 196G 133G 63G 68% /mnt/windows

    --
    Grüße | Greetings | Salut | Qapla’
    Please do not share anything from, with or about me on any social network.

    A body has been found in the canal, tightly tied up in a sack.
    Suicide seems out of the question.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmfrCLAACgkQizG+tUDU MMomZg//ZI89HK6YdCz07CeMsQMgUggU6VnMtdTFAfvHjkPo4oCUyibVEG3/+0tD TSLRCl7ZCXQLc5b1G0fT/81os+UAtmxerc5KERrPLfOG8XPbC5axDoukb7iR+uQS 6cTImoPk60+noFCSWThnJnGcrbpn59kmYQartc9q60F1FuEh27UcgKoTFT6Ducrv jJc9E55ao/YzcfRG6oqcfheRDLfnJ09l8LZz3T9s0algRd7Dk3CVbx8ZfNHxl1k4 gPbaqaCSbDchhJPBUbRI/mag6TxZJxLk4FgxODcTlWyTCJ6ItJMUFNqaKW1dPcYp ZmYA+FmsF5nflogEoWeaVwH6+OkvqRY3DG+Y+9OHHThPpXQIwcBUpS8vU5Y8ITkk JDSsHbM0cVLFLm7SJQFVCa+DvLhZ1LbCYOIZjDbh2PMUJAN7hu4zDwGvG5wPaIqK iYX5etDT/oaBEz3Iy4i8pljfOVVePNuRinf/aE7WMeI4O+dyPT8LZzlPgp6h6DPo 3kc09y63V9s/BlVuDxw7X4d1qKcioXqvEir10yzgknhu72oZR1A9ExurW0D4TTP+ ASbIEgF2XmphkciORynQketwx1h79nUDRvYJNGkdd5Voauoc96GAICiZqPInCQ1Z tWwAISlHqgJiLK96+o3LQ/XL2yPulLfPNN5OH9E/
  • From Peter Humphrey@21:1/5 to All on Tue Apr 1 12:10:02 2025
    On Tuesday, 1 April 2025 01:44:18 British Summer Time Dale wrote:

    ... I have /usr on the same partition as / this time around.
    Do I need a init thingy still or can I ditch that thing? I do have /var
    on a separate partition, if that matters.

    I have /var on a separate partition on some machines, and I only need an
    initrd for microcode loading. I suppose I could include that in the kernel,
    but I haven't tried that.

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Humphrey@21:1/5 to All on Tue Apr 1 12:30:01 2025
    On Tuesday, 1 April 2025 11:12:44 British Summer Time Dale wrote:

    Is there somewhere I can look or some command I can run to see if I load
    any microcode that it needs to access while booting but before /var is mounted? Why isn't the microcode put in /usr or something anyway?

    See https://wiki.gentoo.org/wiki/Microcode

    That's the guide I followed.

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Tue Apr 1 12:04:34 2025
    On Tuesday, 1 April 2025 11:12:44 British Summer Time Dale wrote:
    Peter Humphrey wrote:
    On Tuesday, 1 April 2025 01:44:18 British Summer Time Dale wrote:
    ... I have /usr on the same partition as / this time around.
    Do I need a init thingy still or can I ditch that thing? I do have /var >> on a separate partition, if that matters.

    I have /var on a separate partition on some machines, and I only need an initrd for microcode loading. I suppose I could include that in the
    kernel,
    but I haven't tried that.

    I thought about the fact I have a merged /usr now which means everything
    is in /usr. I hadn't thought of microcode being needed tho. How do I
    find out if there is any microcode being loaded on my system? I do have
    the package installed, read somewhere that it only loads something if it
    is needed so no real harm in having it installed even if nothing is
    being used today. It could prove helpful if something is being used
    later on tho.

    Is there somewhere I can look or some command I can run to see if I load
    any microcode that it needs to access while booting but before /var is mounted? Why isn't the microcode put in /usr or something anyway?

    Dale

    :-) :-)

    The microcode blobs are not in /usr, but in /lib/firmware; e.g.:

    $ ls /lib/firmware/amd-ucode/
    microcode_amd.bin microcode_amd_fam16h.bin microcode_amd_fam19h.bin microcode_amd_fam15h.bin microcode_amd_fam17h.bin README

    You either include the microcode required by your CPU in an initrd, or build
    it in your kernel by specifying it - along with any firmware needed by your graphics, etc. - in your kernel (CONFIG_EXTRA_FIRMWARE).
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmfryEIACgkQseqq9sKV ZxnBGA//Vu06wUDlK4+IznVj5AFutmUUDWyopIyRLiF+WR8XwqrZ4tlJCz8bwjDC ZU4j9kLc4Qv0CmPxwyMjXN38ewbBZ9JDDJgecY2jqsLIbMVi0nj01m2yVawXGVHs lD+wdskQIvF3AIcL30hOILHmirV+9JUj0Bhoo6UQcWD2slRYWut4ZY8O1DqJwl4L sts76w+Ux2EOkGtwclaRRn+pX0UM8G3yIK6ycNNHfjK4ThkLVmY8ewO1/wZlotlU /Q/d5MrT5//wceRiOp0bH6xO1lZ1lq9wQJQiiWB73giwE9a1MZK1p6Fh11DaDWcH ionkYebckNDoNxZqLsR83DGpgjnPlsse8I4stMRIY9ly0PrP4/i1QGUQDT+3IFMW 64dCiqRApXOq1Mu1Y4TLfFzHCUiJ+owKNwKgUohJKSIuSvz6YIe/JuGzbEV5MbaA icLpDb2VYxzt+zphTgIohL9MgovmTyXyZ+i50KrQBMhRt9ITtYNzYFBuY7/DnpPF vw3Vu1NtfwanvSDTSa/g+1DQVts3OzL/9xvDToGrjpmKGctAF/Kv5VW18xThHelC v8mQWO0P3DjUD+t3ZTb73z8ysqQMgvekd+KzzFuMBbnXuW9KkU/TXEwJLgx3Kmlf RtPm2yVygxL+hg8L5MqYWjsOQW8BmyHeolLbsdUXmHfUjps4Tag=
    =qGoG
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Humphrey@21:1/5 to All on Tue Apr 1 15:20:01 2025
    On Tuesday, 1 April 2025 13:56:31 British Summer Time Dale wrote:
    Peter Humphrey wrote:
    On Tuesday, 1 April 2025 11:12:44 British Summer Time Dale wrote:
    Is there somewhere I can look or some command I can run to see if I load >> any microcode that it needs to access while booting but before /var is
    mounted? Why isn't the microcode put in /usr or something anyway?

    See https://wiki.gentoo.org/wiki/Microcode

    That's the guide I followed.

    I followed the link to the AMD one. Then I remembered that I do have microcode loading because I have a amd-uc.img file in /boot. I never
    messed with it but when I update grub config, it finds that. I guess it
    will need a init thingy since it has to have that to load the microcode
    thing too. The devs have it so automatic, I forgot about the thing. It
    only hit me when I read the wiki thing.

    I guess I'll have to keep the init thingy. Now I know.

    I don't see why, Dale. I don't use one and my case is similar to yours. When I said I used one for microcode loading, I meant that the microcode image /is/ the initrd.

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Tue Apr 1 16:44:01 2025
    On Tuesday, 1 April 2025 14:03:06 British Summer Time Dale wrote:
    Michael wrote:
    On Tuesday, 1 April 2025 11:12:44 British Summer Time Dale wrote:
    Peter Humphrey wrote:
    On Tuesday, 1 April 2025 01:44:18 British Summer Time Dale wrote:
    ... I have /usr on the same partition as / this time around.
    Do I need a init thingy still or can I ditch that thing? I do have
    /var
    on a separate partition, if that matters.

    I have /var on a separate partition on some machines, and I only need an >>> initrd for microcode loading. I suppose I could include that in the
    kernel,
    but I haven't tried that.

    I thought about the fact I have a merged /usr now which means everything >> is in /usr. I hadn't thought of microcode being needed tho. How do I
    find out if there is any microcode being loaded on my system? I do have >> the package installed, read somewhere that it only loads something if it >> is needed so no real harm in having it installed even if nothing is
    being used today. It could prove helpful if something is being used
    later on tho.

    Is there somewhere I can look or some command I can run to see if I load >> any microcode that it needs to access while booting but before /var is
    mounted? Why isn't the microcode put in /usr or something anyway?

    Dale

    :-) :-)

    The microcode blobs are not in /usr, but in /lib/firmware; e.g.:

    $ ls /lib/firmware/amd-ucode/
    microcode_amd.bin microcode_amd_fam16h.bin
    microcode_amd_fam19h.bin microcode_amd_fam15h.bin
    microcode_amd_fam17h.bin README

    You either include the microcode required by your CPU in an initrd, or build it in your kernel by specifying it - along with any firmware needed by your graphics, etc. - in your kernel (CONFIG_EXTRA_FIRMWARE).

    I have these.


    root@Gentoo-1 / # ls /lib/firmware/amd-ucode/
    total 184
    drwxr-xr-x 2 root root 4096 Dec 16 12:28 .
    drwxr-xr-x 104 root root 20480 Mar 22 07:36 ..
    -rw-r--r-- 1 root root 12684 Mar 22 04:52 microcode_amd.bin
    -rw-r--r-- 1 root root 7876 Mar 22 04:52 microcode_amd_fam15h.bin -rw-r--r-- 1 root root 3510 Mar 22 04:52 microcode_amd_fam16h.bin -rw-r--r-- 1 root root 22596 Mar 22 04:52 microcode_amd_fam17h.bin -rw-r--r-- 1 root root 100684 Mar 22 04:52 microcode_amd_fam19h.bin -rw-r--r-- 1 root root 4662 Mar 22 04:52 README
    root@Gentoo-1 / #

    Yes, you would have all these and more for older amd, as well as intel CPUs, provided you have emerged sys-kernel/linux-firmware.


    I'm family 25 so not sure if those apply.

    You'd need to read two wiki pages carefully. The first explains how microcode can be built and included in your system, so that it is loaded as early as possible in the boot up process. The idea is you'd want any CPU bugs to be patched before you use the CPU to load and start running your kernel.

    https://wiki.gentoo.org/wiki/Microcode

    The second page, relevant to AMD CPUs, points to the particular microcode blob you'd need to use for your CPU:

    https://wiki.gentoo.org/wiki/AMD_microcode

    It explains the hexadecimal number '19h' corresponds to your decimal '25'. Therefore your family 25 CPU requires the 'amd-ucode/microcode_amd_fam19h' blob. Whether you build this as part of your initrd, or you specify it in
    your kernel config so it becomes part of the kernel image, is your call.


    Either way, I do have the
    amd-uc.img thing in /boot. I think the firmware package puts it there.

    I think the initrd builder (e.g. dracut) puts it there and GRUB loads it.


    Anyway, it finds it when I update grub config so I need a init thingy.

    You do not need an initrd if the only reason for running an initrd image is to load your microcode. The kernel is perfectly capable of doing this on its own - see the above links.


    I was kinda hoping I could ditch it but I guess it is the best way to
    load the microcode thing. I've read it is best to load the microcode
    pretty early. It was a thought.

    It's a good thought and your hope can still be realised. I suggest you start with reading the above two links.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmfsCcEACgkQseqq9sKV Zxkk4RAAw57Jq9W8NzFETCf/PSMUycsfOQUct+aDWlnA4jzSX5J5jcaH7Oe4VyXR ulW1bRZfGNJiH9HSOktVMCoBOsEwGK1XzdqllyegmUBXl81fHhLK//EwyjJPEd6P GETLVlzVpjDKUdVJVHZaqcbvVonnDW66okvE1Od4OUiE8pdByW3xQM43F8TPmJpC eNYZWFZcyHkCaemh6Ryw7YZqdB4RigRWZ0l1OcHcFGq7pQTEglLGxRT1gIwpkf/u pInbQ/swXCYwFVUu95akmPkSsubCCixb6Bo5g8XKovE1zc8ELmaXluYNFuxYCd3j VFH4EeYuhMyjedTBO4gWUVn1OYnNhzBVBZEAw3hjzeJStLRBWWb5ViXvmsWD4HdJ JfdThV7m4pNrrYZ7wcXNxHTEjgopPDYFqd6yISr//tcJo0ClELz8bu1kHjS1tu+z KHEKX+sN/a4DoZFFM/p3CSPdJRkBrWSd2oDHJclVt44rghxk/17IBMx4zK01pij1 v5ggQUBeqcOHG3g64CM3zspclus7x8p03O9gl354TPtKUedyTNggLfqk6jLLQXdk ULe7ee/RTlNE195v+jbDFKcWI2WOEXl9K0cTUtxLBJx1Kz7m9Dh/9Dc2DNvFyl4D FrdmQ4BA2FoFIVsj14IicplJI9t4TtclFDSngmLWYef7CZCFXmM=
    =Dvd3
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Steinmetzger@21:1/5 to All on Wed Apr 2 00:50:01 2025
    Am Tue, Apr 01, 2025 at 08:03:06AM -0500 schrieb Dale:

    The microcode blobs are not in /usr, but in /lib/firmware; e.g.:

    $ ls /lib/firmware/amd-ucode/
    microcode_amd.bin microcode_amd_fam16h.bin microcode_amd_fam19h.bin
    microcode_amd_fam15h.bin microcode_amd_fam17h.bin README

    You either include the microcode required by your CPU in an initrd, or build
    it in your kernel by specifying it - along with any firmware needed by your
    graphics, etc. - in your kernel (CONFIG_EXTRA_FIRMWARE).


    I have these. 


    root@Gentoo-1 / # ls /lib/firmware/amd-ucode/
    total 184
    drwxr-xr-x   2 root root   4096 Dec 16 12:28 .
    drwxr-xr-x 104 root root  20480 Mar 22 07:36 ..
    -rw-r--r--   1 root root  12684 Mar 22 04:52 microcode_amd.bin -rw-r--r--   1 root root   7876 Mar 22 04:52 microcode_amd_fam15h.bin -rw-r--r--   1 root root   3510 Mar 22 04:52 microcode_amd_fam16h.bin -rw-r--r--   1 root root  22596 Mar 22 04:52 microcode_amd_fam17h.bin -rw-r--r--   1 root root 100684 Mar 22 04:52 microcode_amd_fam19h.bin -rw-r--r--   1 root root   4662 Mar 22 04:52 README
    root@Gentoo-1 / #


    I'm family 25 so not sure if those apply.

    Look at the readme in the same directory.
    rour 25 (mine, too) is 0x19 in hex notation.

    --
    Grüße | Greetings | Salut | Qapla’
    Please do not share anything from, with or about me on any social network.

    Electronically yours,

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmfsbNQACgkQizG+tUDU MMr78g//foIc/S5E0iDSZbgfU65qkB/LzXXadMlXCh2izl5Rj87M4UF0kpZwYv3T w2wc6tsXrAEuLqZY4dgHXPW/rJDOahSSnfUQMcfIwhMbtFUZmEFEUJiclpjfbZ/+ fe4f98BqvVyxRD3Gl28heeWb3c5pr9KGgnpd7d+HwDw5xVLbWWpJnePG8to/BTNB y46jCOxruI0uxiVLLzRjzgXH3kwAz540yf1JmG1geNYuAla3x0F3MKPRJMXok+L2 6Rt4t62jzhBICdjSU0LHQ5AKFxHa7hTwPSHKpWx2UaNehcUICcPkyb8WG0OLgjcQ OHZmvt4X7l5YhQDaYk0brr79onVt+AlRl+qVgFikCWVUVwpmynly//18P7DYb/Kb sngmfMVNcge4QeOe8xfhuHV9QYbKZxtUwH895XBDY5qRx5XFdNdZT8XIfKKQYGjq SlrENY/5jaETniBSZyHm8bkZOokWl7IxLlvLOjZSX/DNDH1Q7x1BJUS2QwPykS/Y vxooDAnu4VFEwAKgc2XjLJsUxMVaSK1m52ujnJid+UkACcszyK2dz3Ly6DQMnhrD L7+Q/0YhjdHc2VydkcWAn/CG57ExsHdIlv/AZAS1yj0GMzBagCjVUGDEDI6tLn91 nCiFXILqob1kWYGxZqeHxGlixYbqcdBHtKXKBO4gVf9FLs2JK+E=
    =O4Wm
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
  • From Frank Steinmetzger@21:1/5 to All on Wed Apr 2 01:10:01 2025
    Am Mon, Mar 31, 2025 at 07:44:18PM -0500 schrieb Dale:

    $ journalctl -fu fstrim
    Mär 31 23:03:26 q systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
    Mär 31 23:06:27 q fstrim[4946]: /mnt/windows: 62.6 GiB (67195392000 bytes) trimmed on /dev/nvme0n1p3
    Mär 31 23:06:27 q fstrim[4946]: /mnt/gentoo: 25.1 GiB (26987544576 bytes) trimmed on /dev/vg/gentoo
    Mär 31 23:06:27 q fstrim[4946]: /mnt/data: 410.3 GiB (440560844800 bytes) trimmed on /dev/vg/data
    Mär 31 23:06:27 q fstrim[4946]: /home: 14.5 GiB (15569068032 bytes) trimmed on /dev/vg/home
    Mär 31 23:06:27 q fstrim[4946]: /boot: 211.4 MiB (221700096 bytes) trimmed on /dev/nvme0n1p1
    Mär 31 23:06:27 q fstrim[4946]: /: 8.6 GiB (9203961856 bytes) trimmed on /dev/vg/root
    Mär 31 23:06:27 q systemd[1]: fstrim.service: Deactivated successfully.

    $ df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/vg-data 1.4T 956G 411G 70% /mnt/data /dev/mapper/vg-gentoo 50G 25G 25G 50% /mnt/gentoo /dev/mapper/vg-home 199G 184G 15G 93% /home
    /dev/mapper/vg-root 50G 41G 8.2G 84% /
    /dev/nvme0n1p1 300M 89M 212M 30% /boot
    /dev/nvme0n1p3 196G 133G 63G 68% /mnt/windows



    I'm using ext4 for my file system.

    So am I.

    /dev/mapper/vg-data: LABEL="data" TYPE="ext4"
    /dev/mapper/vg-home: LABEL="home" TYPE="ext4"
    /dev/mapper/vg-root: LABEL="arch" TYPE="ext4"
    /dev/nvme0n1p1: SEC_TYPE="msdos" LABEL_FATBOOT="efi" LABEL="efi" TYPE="vfat" /dev/nvme0n1p3: LABEL="windows" TYPE="ntfs"

    (abbreviated for clarity)


    Could the file system make a difference if you use something else?  Your root and /home is getting a little full.  o_O 

    Root has always been kinda full. I tend to size it according to real-world need, so I have more usable space where it’s actually needed. This habit stems back to when I had a 120 GB hard drive in my laptop 20 years ago.

    But LVM came in handy here; I’ve embiggened / at least twice by now.

    Home doesn’t grow very fast, mostly “temp” photo downloads and Mail. I can
    actually look that up thanks to my borg snapshots and the file listings¹ I keep around for precicely such look-ups so I don’t have to actually attach the backup disk. ^^ From the first Borg snapshot onwards (dated June 2021), it’s been growing by about 5 ± 1 GB/year.

    I’ve long been pondering merging the home and data partition, as there is an arbitrary separation of which photos I store where. That separation has an historical reason, too: back when I had my first SSD (120 GB), it was too small for anything but Winblows and / (then still Gentoo). Later, on a
    512 GB SSD, I added home and a large Windows games partition to it, but
    still had the 1 TB data partition on a hard drive. Home became too small for my photos, so I started a new hierarchy in /mnt/data, but without migration the existing digikam collection from /home. Big mistake.

    Nowadays it’s 2 TB solid state in both laptop and PC. But merging the partition content would mean I need to reorganise my Borg backups, too.

    I didn't put anything OS related on LVM this time.  With a 1TB stick, I figured I could make everything big enough that I shouldn't ever run out
    of space.

    While / does grow over time as packages get bigger, I never saw a reason to keep it much larger than necessary, especially as storage space was tight
    back in the days due to budget problems.



    ¹ from my tree wrapper script.

    --
    Grüße | Greetings | Salut | Qapla’
    Please do not share anything from, with or about me on any social network.
    Very funny Scotty... now beam down my pants!

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmfscd4ACgkQizG+tUDU MMopdA//XIraAAjUxKSciLKfleOJgoDrGwVwsv5TpkkI++pcbVUjWELkQWaGBlWz CyscquJqp8ZqklhpCq+CMWpnwkxoWyLLJ/jxcbFkNrGwBybyo8L6XKTctzfcbI6M K/8GugiOE3yDj9zaBHI4mwj/KQVm/mDxRdgJ8q52jug/QgJkyTdI0TNYiB5v7Fun NY1sjHN9jDufhbw6hbjF1UaJYy0EQdrIurAj54CYFBQDuXTP7us/S6uHj7Pd2j3N 5MMOZV75JeiUr1dV8ir9wsvsfck0w+1MKfp7jW7tHh8YAXzx0KPklIaW97jeEHQR A2ptSeYvF/PAjeYNqIwa7GwHuwZNtPuEBDn8EY7SU5vG8TmNusiKEMKXuLcjIgMN bfCw0M8ZPUd371G2TtyFzRrrPM/kfvL2FAKUXxIpCXoIlcnHVvdmoLaNc//Xb8Dz ked+JXDJ9PdJIsgPDBFCrdMSqCAyKuWHRnS85nocSuhjjYMb/AQsupC68MCOs/AR Y7rI9DdMKv3HF1c0XtXifcjkA1pxatoKCwRfdHEv0NaZFPkTpbx+qZ+S4j+B/kqp e0Xo4bQVTIr7FTmSglJ9pfeYAdjCKMNGbLI1gdDNKvbJ4LGsUNRSkJcHw0vOlYai Vnctzy88InkLR5Zi19PAOXqiXXiaQka3p1fEOBwQ31vGSm/+alw=
    =xr9g
    -----END PGP SIGNATURE-----

    ---
  • From Peter Humphrey@21:1/5 to All on Wed Apr 2 13:20:02 2025
    On Wednesday, 2 April 2025 04:33:01 British Summer Time Dale wrote:

    8

    I guess I'll have to keep the init thingy. Now I know.

    I don't see why, Dale. I don't use one and my case is similar to yours. When I said I used one for microcode loading, I meant that the microcode image /is/ the initrd.

    Ahhhh. I have both. I have the microcode image as well as a init
    image. Are you saying I can have just the microcode image and no
    initramfs image and it will still boot?

    I don't know your system well enough to predict what you can do, but I have that arrangement.

    If you don't mind, can you list what is in your /boot, just the kernel and init stuff that grub uses to boot is enough. As a example, this is mine, with the command I used. You may name things differently tho so adjust if needed.

    8

    # ls -l /boot | grep -v rescue
    total 78M
    -rwxr-xr-x 1 root root 145K Apr 1 11:20 amd-uc.img
    -rwxr-xr-x 1 root root 139K Apr 1 11:20 config-6.12.21-gentoo
    -rwxr-xr-x 1 root root 136K Feb 21 10:43 config-6.6.74-gentoo
    -rwxr-xr-x 1 root root 216K Dec 10 15:01 early_ucode.cpio
    drwxr-xr-x 5 root root 16K May 28 2024 EFI
    -rwxr-xr-x 1 root root 21M Apr 1 11:20 intel-uc.img
    drwxr-xr-x 3 root root 16K Apr 1 11:22 loader
    -rwxr-xr-x 1 root root 6.3M Apr 1 11:20 System.map-6.12.21-gentoo
    -rwxr-xr-x 1 root root 5.9M Feb 21 10:43 System.map-6.6.74-gentoo
    -rwxr-xr-x 1 root root 11M Apr 1 11:20 vmlinuz-6.12.21-gentoo
    -rwxr-xr-x 1 root root 11M Feb 21 10:43 vmlinuz-6.6.74-gentoo

    That's everything in /boot. Nothing about grub, because I don't use it, much preferring bootctl from systemd-utils (that's the only systemd package here), whence the loader/ directory. I keep a small rescue system on each machine, though these days it's usually used only for routine backups of the main system.

    I don't know where the amd-uc.img comes from. It shouldn't exist in an Intel system, but if I delete it it just reappears. I'll track it down one day.

    It uses the same microcode image for them all but as you can see, I have
    5 boot options. I just created a new kernel and friends but have not rebooted yet. I'll clean those up and get down to two or three one of
    these days. If I didn't have the init thingy at all for one or more of those, it would still boot with just a microcode image and kernel?

    I read a link on this and I may point the kernel to the directory for it
    to be included into the kernel. The only downside of that, old kernels
    will have old microcode whereas this way, that microcode image gets
    updated and on each reboot, loads the new microcode.

    Good point, if your kernels become that old.

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Wed Apr 2 09:29:16 2025
    On Wednesday, 2 April 2025 05:04:12 British Summer Time Dale wrote:
    Michael wrote:

    The second page, relevant to AMD CPUs, points to the particular microcode blob you'd need to use for your CPU:

    https://wiki.gentoo.org/wiki/AMD_microcode

    It explains the hexadecimal number '19h' corresponds to your decimal '25'. Therefore your family 25 CPU requires the 'amd-ucode/microcode_amd_fam19h' blob. Whether you build this as part of your initrd, or you specify it in your kernel config so it becomes part of the kernel image, is your call.

    Either way, I do have the amd-uc.img thing in /boot. I think the
    firmware package puts it there.

    I think the initrd builder (e.g. dracut) puts it there and GRUB loads it.

    I was wondering where that came from. Makes sense.

    Dracut is capable of building a separate initrd image with the required microcode for 'early microcode loading'. This is picked up by GRUB and loaded first thing during boot. This is the default dracut configuration since version 047.

    It is explained here:

    https://wiki.gentoo.org/wiki/Microcode#Dracut


    Anyway, it finds it when I update grub config so I need a init thingy.

    You do not need an initrd if the only reason for running an initrd image
    is to load your microcode. The kernel is perfectly capable of doing this on its own - see the above links.

    I was just clarifying that with Peter. So, if I have a microcode image
    and a kernel, it will boot, with no init thingy?

    Your system will boot regardless. These are the permutations:

    1. No microcode provided by you:

    The MoBo will load and use whatever version of microcode has been embedded in the EFI firmware made available by the OEM.

    2. Microcode provided - embedded within your main initrd:

    The microcode will load as part of the main initrd.

    3. Microcode provided - as a separate initrd image:

    The separate microcode initrd image, e.g. amd-uc.img, will be picked up by
    GRUB and loaded early in the boot process.

    4. Microcode provided - embedded in the kernel image itself:

    The microcode binary blob is part of the kernel and will be loaded first
    before the rest of the kernel, provided the 'Firmware loading facility' [CONFIG_EXTRA_FIRMWARE="amd-ucode/microcode_amd_fam19h.bin ...."] is built in the kernel and not configured as a module.

    https://wiki.gentoo.org/wiki/ AMD_microcode#Supplying_the_microcode_files_to_the_kernel


    I was kinda hoping I could ditch it but I guess it is the best way to
    load the microcode thing. I've read it is best to load the microcode
    pretty early. It was a thought.

    It's a good thought and your hope can still be realised. I suggest you start with reading the above two links.

    I been reading those, a couple times or so. Just trying to clear up the
    mud. LOL While I would like to just include this in the kernel itself,
    that may not be the best for my situation. I may update the kernel once
    a year, if that. If I have a kernel as a backup that is three or four
    years old, it will have microcode that is that old as well and lack any
    new updates. Having it as a image means it will be updated when needed
    and have the new code whenever I reboot. So, for my situation, having
    older kernels as backups and such, it may be better to have the image
    method instead of including it into the kernel.

    Yes, good point.


    I'm still thinking on this but if I understand this correctly, having a microcode image and kernel is the best way for me if I can remove the
    init thingy from the process. It sounds like I can.

    Yes, you can have the microcode as a separate initrd image and GRUB will load it each time, irrespective of the kernel you boot with.

    It is worth mentioning though, kernel code a few years old is not the safest way to run your machine, given the continuous improvements and security
    patches released by the kernel devs.


    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmfs9VwACgkQseqq9sKV ZxlAURAA1/fbY4GXTiEn53RgWtLP/zeMiOD5XWNmRz20mhevSOGPtnuCfuCGDl4o 9V/QN0KajMPXXYJ+6XOS/kefT/loLneLTD9ony+tTuyeybL7onDTTptK4ER97w12 wmVhqtjWoABEdfDhnHmtdx3qvuAGoDlTQTLdCoqfO65/8voLXtZRAm4b15z8kLee SMY+FwEGexq2+7O+Nz/ORMdc49SWYq69N0tqA1h4RPDrg1G2YEjH9Y7VbSN4Z2gk YY1sOLyNL8beSgfBTnHHwHbvJGkza5gB+UETULn40Ps7J1/ZN+0YrQnvRqeudgm7 H98IatiGykrozLnUeAtdAfg9dWtpjbmOv7AAv3TFnHb/eB0SdvQF02Q2SqLlwExt UCSMPS5zUqAqSqUgREhXVXx1Gx2R1djUfYaVKa5S/t2mdI3FgeAbLp6ZWKe+8wf8 wJ8n+Ux4863q6kLs4q6enaYD3HoMFy8ZZoar0PNOIH0jVYSzOHCJraxR+XHDOXpc d8anpC2UG6bVyGDQdUOkqNeS6+OxscRrKI+QmC+OFBN97weeFdqShkvm2m4M9Qlb xpdIE64e1EUvNjiXN93SnytrOJr9bGY2ua2gjtzoBMi8JZaNmQ4Chx2oGV6taYZD EvTZ6JKcD0BQoSAcYY1IpnTnRTL1qjoceiPi5DjcTbI57EO3VVw=
    =UBJm
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)