Linux with badram Saves the Day!

Have I said lately that I love Linux? No? Okay then, "I love Linux!" I found yet another reason to promote Linux over other operating system software this week. Bad RAM chips. Some of you may now be thinking to yourselves, "What? Is this guy nuts?" I assure you I am completely sane. I will explain.

One of my business clients is also a Linux fanatic. I introduced her to Linux several years ago and she almost instantly adored Linux. Having that cute "Tuxie"Tux the Linux Mascot helped I think. She first began using Linux with KDE, then tried and liked Gnome as well and switched back and forth using either one or the other for specific tasks. However, she became seriously disenchanted with KDE when the poor decisions were made to foist an unfinished KDE 4 upon the unsuspecting public. So I helped her switch completely to Gnome on her AMD Quad-core based office PC in 2010. She has been a happy camper ever since the switch, until a recent upgrade from Mandriva 2010.0 to Mandriva 2010.2 seemed to be going flakey on her system.

After this upgrade in late December 2010 she started having problems with Nautilus (Gnome's default file manager.) running slow and hanging. Then certain applications such as Firefox began to crash regularly. She called on her computer guy, me, to take a look at the system earlier this week after her Linux system experienced a hard hang that required a press of the reset switch. The hard hang was bad enough that she could not even ssh into her PC from her laptop to try to see if she could kill a runaway process, like I had shown her how to do. She knows that the Linux kernel just does not hang like this, so something had to be wrong with her hardware. I immediately suspected a RAM problem after she enumerated all the hangs, crashes and especially the hard hang of the complete system.

Enter Memtest86+ to check that RAM. Sure enough Memtest reported memory errors in the address range 0x0d646aa8 to 0x0d646f68 (hexadecimal). This is a very small range of memory in her 2 GB of RAM and tossing the RAM out was not an option at the moment as money is tight. But she still needed to use her PC. So, I went looking for a solution as I had seen an oblique mention of some kernel hack called "badram" at one point. Sure enough, I found Rick van Rein's pages for his badram hack. A little further research showed that Mandriva has included this as a patch in their kernels for quite a while. So I edited /boot/grub/menu.lst on my client's PC and added a new kernel stanza:

title linux-badram
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=bb2a27be-33ed-4a18-b576-37adb9bdfa3b splash=silent vmalloc=256MB vga=788 badram=0x0d646aa8,0x0d646f68
initrd (hd0,0)/boot/initrd.img

I rebooted her PC, chose the linux-badram menu option and told her to try the PC for a couple of days and let me know if that solved her hangs and crashes.  If so, I would make that the default for her. Two days have passed since then with no report from her, so I asked her about the system this morning. She was so excited when she reported a stable system this morning that I had to smile. She said, "Nautilus is fast again and not one application has crashed." Prior to this she had been having multiple crashes of her X applications every day. Problem solved with the Linux kernel and the badram patch. Thanks Linux kernel team and Mr. Rein for your attention to little details like this. This is part of why I love Linux.

So, if you are looking at some misbehaving RAM in your own PC consider using the badram patch before you toss out otherwise good RAM. Of course if you are not using Linux I suppose you will just have to throw out that flakey RAM and buy new RAM … or you can send it to me. 🙂

Update Thu Feb 3 11:26:43 CST 2011: This labor was a warranty job, so the client paid nothing for us to implement this fix. The RAM is under a limited lifetime warranty from Kingston and is going to be replaced. In the meantime, Linux with badram is allowing her to use her PC.

download hit counter
website design

Notice: All comments here are approved by a moderator before they will show up. Depending on the time of day this can take several hours. Please be patient and only post comments once. Thank you.


Published by

Gene A.

Gene is a "Unix Guy", network technologist, system trouble-shooter and IT generalist with over 20 years experience in the SOHO and SMB markets. He is familiar with and conversant in eComStation (a.k.a. OS/2), DOS (PC, MS and Free), Unix, Linux and those GUI based systems from Microsoft. Gene is also a follower of Jesus (forgiven, not perfect), and this does inform his world view.

15 thoughts on “Linux with badram Saves the Day!”

  1. What a joy if this could be elegant via an export to kernel-grub with no intervention by the user other than running memtest. No editing, no CLI. Just works. When it reaches this point of the patch I would recommend this to others who have laptops with built in ram that cannot be replaced and the machine is useless to them. Some days I would rather not visit the friend and apply patches and edit. 

  2. excellent..!! been using linux for 11yrs and did not know of this little hack… this one is a keeper in the troubleshooting book..

  3. I work for an Electronics manufacturing company. Our SMT machines very often need RAM swap because bad RAM, what causes a lot of downtime (they use windows). Sadly, migrating the platform is not an option. We could benefit a lot from the amazing linux felxibility.

  4. What if you have multiple bad ranges of memory? This would be helpful to me, as I have multiple sticks of bad ram, except I'm dual booting and "highly doubt" that this can be accomplished in Windows… hehe
    Thanks for sharing this, and it has been properly bookmarked.

  5. This is the great thing about Free Software–folks can make cool, handy hacks like this one that solve real-world problems.  As primarily a GNU/Linux user, I will also point out that there's no reason this sort of cool hack couldn't also be done with the BSD's or any other Free Software system (e. g. ReactOS).
    Good use of this hack!  Always good to hear little success stories like this and to see practical "how-to" examples.

  6. badram is some really nice hack for those less beneficial moments, I'm sure (fortunately never had to use it yet despite using medieval hardware at times).
    I have to say though that it doesn't seem very prudent to specify exactly that very same range which memcheck complained about. I'd think that it's quite likely that further adjacent addresses will eventually fail, too, thus better make sure to exclude a much larger range to be truly safe.

  7. Reminds me of a laptop I had in college that I couldn't afford to replace.  By graduation, it had a busted touch pad, a crashed hard drive, and some keys were getting flaky, but still very usable thanks to an external mouse and a custom Knoppix live CD.

Leave a Reply

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

Follow the directions below to post a comment if you are human. After 3 failed tries reload the page to start with new images.