Handling bad RAM in Linux

After some recent hardware upgrades, I was getting some strange crashes (different to the freeze that accompanies the intermittently-failing HDD that I’m trying to hunt down), specifically referring to Bad swap offsets and Bad page maps.

Given that I fired up memtest86+ and let it do it’s thing… and  it turns out that I have a few chunks of dodgy RAM. RMA time – though be sure to try swapping the RAM around and make sure the problem follows the stick and not the slot.!

Memtest86But to keep everything up and running in the meantime I decided to use memmap to block off that chunk of memory while linux is booting. To do this modify /etc/default/grub:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet memmap=1440M\\\$2048M"
GRUB_CMDLINE_LINUX=""

Basically what we are doing here is telling linux to block off 1440M of RAM, starting at 2048M. Then run sudo update-grub, reload and you will see your ‘free -m’ memory drop to about 6.5G.

This should tide you over, and prevent some random crashes until replacement RAM arrives

Leave a Reply

Your email address will not be published. Required fields are marked *

Please prove you are human, or at least not a very simple bot :) *