Thread: Nerd tools
View Single Post
Old 28th December 2023, 20:23     #85
DrTiTus
HENCE WHY FOREVER ALONE
 
Bad RAM? Sometimes your system crashes? Or someone's selling 32GB for $1 reserve but says "possibly faulty, no returns"?

Simply add "memtest=n" to your Linux kernel boot parameters (vi /etc/default/grub && update-grub), and have the kernel detect the bad bits and map them out so they never get used.

n is the number of passes, with each pass potentially detecting more, but there are diminishing returns. RAM isn't like hard drives where bad sectors "spread", so if you're happy with 31.8GB instead of 32GB, then go right ahead. It happens on every boot, and adds a few seconds (but not even a minute) and since we don't reboot very often, who cares?

You can do a similar thing in Windows, but you've got to do more testing and fuckery. Not worth the effort for a shitty Windows computer.

BIOSes used to do this back in the day, but I notice they don't do it anymore (or maybe I just have Fast Boot enabled, I don't know). It's a valid workaround - test before use.

It's not just for cheapskates buying dodgy RAM - if you have a computer with soldered on RAM (which is becoming more common these days), then you don't have a choice to replace the RAM if it does go bad over time. In this situation, you can just test and reserve the bad areas, and nothing will ever attempt to write/read from them, so you don't read garbage and crash. And old computers are better with Linux anyway, so you may as well make 2024 the year of nothing but Linux on all your desktops.

Obviously don't do this if you're running critical systems (you've probably got ECC RAM anyway).
__________________
Finger rolling rhythm, ride the horse one hand...
  Reply With Quote