I have four 512 MB RAM modules in one server. The fourth RAM is showing error for only one bit when I use memtest86+ to test the RAMs. Even when I swap the RAM in fourth slot with some other RAM I still get error in RAM in fourth slot at exact same location. So I wanted to block one particular address (or 4kb page, if necessary) of RAM from being used by server. Server is having fedora 11 and is used for test purposes only. It is not hosting any user application. Any idea on how I can block certain portion of RAM from being used? or on what is causing error to come at particular byte irrespective of RAM module installed.
7 Answers
I have recently found out that there is a kernel parameter (to provide at boot, in grub config for example)
memmap=[ammount]M$[startlocation]M
You can supply it many times to lock out parts of the memory.
eg.
memmap=3M$217M
locks out megabytes from 217 to 219
- 284
- 3
- 11
-
Really nice find. More details of other usages of memmap kernel parameter are listed at http://www.cyberciti.biz/howto/question/static/linux-kernel-parameters.php – Saurabh Barjatiya Nov 02 '10 at 07:09
-
Is there any way to do this for Windows? Or a third-party program similar to "malloc" to which you can specify a memory area to occupy? – Mark C Apr 09 '12 at 15:55
-
You would have to use it before the system starts to load to be sure it doesn't fail. I don't expect this to be possible with windows unless you set up a linux kvm host and put windows in a virtual machine – naugtur Apr 11 '12 at 16:19
-
In grub2 you may need to write memmap=3M\$217M, that is you need to escape the "$", otherwise you could end up with "3MM", leaving you with only 3M of Ram. – Pozzo-Balbi Jul 01 '19 at 08:31
There used to be the "BadMEM" patch for Linux, however it would take a bit of effort to upgrade it to a current keernel.
- 6,466
- 19
- 26
-
I would have to learn about linux device drivers and kernel modules so that I can upgrade the patch to make it compatible with todays smp kernels. But thanks for the link. I know where to begin now. – Saurabh Barjatiya Jul 11 '09 at 13:21
That sounds like a possible bad slot on the motherboard as your testing showed. I have never seen a way around this besides just not using that slot. To my knowledge, there is no easy answer. I suppose some software could be created, but like nik said, that would be more of an SO question.
- 1,345
- 2
- 14
- 16
-
If the system is still under maintenance then call the vendor and have them replace the board. – mrdenny Jul 12 '09 at 17:45
I don't think you can lock-out
specific parts of a RAM address range.
It is owned by the virtual memory management of your OS.
However, this is an interesting application -- to lock out dynamic memory address ranges from the OS. If there is such a technique available (for any OS), I am interested in knowing it.
If it is not available, that sounds like an interesting project to try.
But, that would be a stackoverflow question.
- 7,040
- 2
- 24
- 30
You could write a kernel extension which, when loaded, would just allocate this page and then do nothing else.
Alas I don't know how to do this. When I used to work on IBMs VM system this was built in, but that doesn't help of course.
- 401
- 2
- 1
As Trogy said, that could be a motherboard defect, or even a CPU defect (though somewhat unlikely in this precise case).
- 6,782
- 4
- 30
- 62
-
1I would still count on a board/slot defect since replacing modules across still shows slot affinity. I do not see how a CPU defect can manifest in this way. – nik Jul 11 '09 at 08:27
-
In this precise way, it can't, you're right. But some memory errors are CPU related (usually it's a cache defect). – wazoox Jul 12 '09 at 07:16
I had this same problem, but found the available answers confusing and incomplete, so I put together a step-by-step guide, assuming as little background as I could.
- Run Memtest86+ in “Badram” output (preferably from a bootable external medium). When Memtest86+ starts, type:
- “c” (“configuration”), then
- “4” (“Error Report Mode”), then
- “3” (“Bad RAM Patterns”), then
- “0” (“Continue”).
- Copy the output that follows any lines beginning with “badram=”.
- Open a terminal (command line).
- Change to the directory where the “grub” file is located. For example, “cd /etc/default”.
- With “root” privileges, use a text editor to open the “grub” file (If you are not signed in as “root,” use “sudo.” You will be asked for the “root” password.): “sudo nano grub” (This example changes the user to “root” and opens the file “grub” with the “nano” text editor.).
- Find the section describing memtest.
- Uncomment the last line (Delete the special character at the beginning of the line, such as “#,” “>,” or “!”). This makes it active (For example,“#GRUB_BADRAM=” becomes “GRUB_BADRAM=”.).
- Replace the example addresses (following “GRUB_BADRAM=”) with the “badram=” output that you copied from Memtest86+ (for example, “0x98f548a0,0xfffffffc”).
- Save (or “write out”) your changes.
- In the terminal (command line) update the “grub.cfg” file, by typing “sudo update-grub”.
- Reboot.