2

My Linux machine is having issues with faulty RAM. I ran PCMemTest-64, and I determined the following patterns: enter image description here

Now, I have stock Ubuntu which doesn't seem to have the BadRAM patch, and I'm a bit nervous about compiling Linux from scratch. So I'm wondering if there is an easy way to disable these fault RAM addresses using existing tools in GRUB and Linux, for example using the memmap kernel parameter. I'm happy to lose a bit of RAM other than the faulty addresses (in the order of kilobytes and not gigabytes ideally) to take this shortcut.

Some versions:

  • Linux 5.19.0-32
  • Grub 2.06
  • Ubuntu 22.04

What should I do?

3
  • You can also try your luck with memtest=17 kernel parameter (check dmesg for early_memtest ff.) Mar 24, 2023 at 11:55
  • I tried that, but it seems that memtest is not part of the default kernel?
    – Migwell
    Mar 24, 2023 at 11:57
  • 1
    Hmmm, it worked on the 22.04 Live CD. But yes, it only works with CONFIG_MEMTEST=y in kernel. Mar 24, 2023 at 11:58

1 Answer 1

6

Something like memmap=1M!2399M will reserve a slice of memory from 0x95f00000 to 0x95ffffff and should do the job. We can surely be finer with the K unit : memmap=32K!2457344K (from 0x95fc0000 to 0x95fc7fff).

You can verify the reservation with the command dmesg | grep user. Something like :

[    0.000000] user: [mem 0x0000000100000000-0x00000003ffffffff] persistent (type 12)

Should be displayed (the actual values should reflect the range you have shown). See https://docs.pmem.io/persistent-memory/getting-started-guide/creating-development-environments/linux-environments/linux-memmap

You can also see badram kernel parameter not working?

2
  • It shows [ 0.000000] user: [mem 0x0000000095f00000-0x0000000095ffffff] persistent (type 12) which seems to indicate it was successful. Thanks! Also for future reference I had to add the memmap flag to GRUB_CMDLINE_LINUX_DEFAULT= in /etc/default/grub, and then run sudo update-grub.
    – Migwell
    Mar 24, 2023 at 12:20
  • 3
    Also a useful way to get these numbers from the memory addresses is just to convert from hex to decimal using python: python -c 'print(f"Start: {int(0x95fc0000 / 1024)}K")' and python -c 'print(f"Length: {int((0x95fd0000 - 0x95fc0000) / 1024)}K")'.
    – Migwell
    Mar 24, 2023 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .