Michael wrote: > 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
Added that to fstab for the NVME mount points. > > 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. > 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. >> 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). > I'll see what the default mount options are next time I mount one. Given the amount of time that has passed, they may have the defaults set to what is best already and may not require me to change anything. Lots of magic nowadays. >> 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. Without knowing it would help, I kinda did that. No idea that it would prove helpful tho. LOL > >> 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. > With 128GBs of RAM, I don't have swap. If I do set it up later for some reason, I'll likely put it on a spinning rust drive somewhere. It's not like I don't have a few laying around. :-) Speaking of, see the prices of used drives recently? Holy crap. O_O I used to get a drive for $160 or so and it is north of $200 now. Bad thing is, they stay sold out too. >> 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 Read those two. May need to read them again, and set up the fstrim cron job thing. Good links tho. Dale :-) :-)