I have an Asus K550V notebook that I bought few years ago and it is out of warranty. This computer has 8GB RAM soldered on the mainboard but the ram module has some damaged cells. I cannot use its preinstalled Windows 10 Pro because it always goes in blue screen and I cannot even reinstall it. I read on the Net that it is possible to install Ubuntu specifying that it has not to use damaged ram cells so I decided to install this os. The fact is that I'm pretty new in Linux world so I'd like to know if there is a guide step-by-step to install Ubuntu, specifyng to avoid the use of bad ram cells. I've already downloaded the 19.04 release and made a bootable flashdrive. Thanks
2 Answers
Note: For Ubuntu install help, please see here.
Note: Most high-end computer service shops can replace that defective 8G RAM chip(s) at minimal cost, and it would certainly be more reliable.
If you look in /etc/default/grub
, you'll find a GRUB_BADRAM=
parameter where you can identify what bad memory locations there are.
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
BADRAM setting in Grub2
The GRUB2 config file in Natty has a line for configuring kernel bad ram exclusions. So, I will assume that is the preferred way of mapping out a section of memory that is showing errors. The line I set was
GRUB_BADRAM="0x7DDF0000,0xffffc000"
The suggested way on every web site I could find was to set this was to run memtest86
and let it show you the BadRAM settings. memtest86
gave me a page of stuff I would have had to enter. I could see that all the addresses were in one 16K block, so I just wanted to map that 16K block out of action. Here is how I generated the correct entry.
The first parameter is easy. That is the base address of the bad memory. In my case, I could see that all the bad addresses were greater than 0x7DDF0000 and less than 0x7DDF4000. So, I took the beginning of the 16K block as my starting address.
The second parameter is a mask. You put 1s where the address range you want shares the same values and 0s where it will vary. This means you need to pick your address range such that only the low order bits vary. Looking at my address, the first part of the mask is easy. You want to start with 0xffff. For the next nibble, I will explain with bit maps. I want to range from 0000 to 0011. So, the mask for badram would be 1100 or a hex c. The last 3 nibbles need to be all 0s in the mask, since we want the entire range mapped out. So, we get a total result of 0xffffc000.
After setting this line in /etc/default/grub
, I ran sudo update-grub
and rebooted and my bad memory was no longer being used. No kernel patches are needed to map out bad memory using this method.
Source: https://help.ubuntu.com/community/BadRAM#BADRAM_setting_in_Grub2
Update #1:
If the system you are using already has (a) bad stick(s) of memory, you have two options: a) Put good memory in temporarily until you've built the patch b) If memory errors don't show up in lower memory, you can add the "mem=##MB" kernel option to temporarily disable memory above that point. Ex: According to memtest86
, my stick of memory has errors between 315MB and 325MB. By adding "mem=314MB" I tell the kernel to pretend I only have 314MB. My system will be stable enough to build the patch, at which point I can pass a parameter to ONLY skip the section between 315MB and 325MB (this providing me 502MB of usable memory).
ie: Boot Ubuntu Live, at GRUB menu, hit e to enter edit mode, use the arrow keys to find "quiet splash", change to "quiet splash mem=2048MB", CTRL+x or F10 to continue booting.
Update #2:
To get memtest86
, go to https://www.memtest86.com/ and download/run their free memtest to test your memory. Get at least one complete pass of all the 4/4 tests to confirm good memory. This may take many hours to complete.
Update #3:
Depending on WHERE your bad RAM is located, you might have a problem. Peter Cordes has a good idea. Remove the HDD. Put it into another computer. Install Ubuntu. Modify GRUB. Then return the HDD to the original laptop. Try and boot it.

- 70,711
-
Oh, I'm sorry. Thank you for explanation! I was thinking RAM was repaired by soldering). Very good answer! I didn't know there's such option in grub. – Gryu Mar 31 '20 at 20:34
-
3
-
Many thanks for your help but i cannot go to /etc/default/grub because I cannot install Ubuntu: the installation fails because of faulty ram. I need to use this GRUB_BADRAM stuff before installation starts. – filograndipad2 Mar 31 '20 at 22:03
-
@filograndipad2 See Update #1 in my answer. Taken from the source document. – heynnema Mar 31 '20 at 22:22
-
Many thanks for your time! I'm sorry but I'm not able to follow your instructions. When I try to do what you say in your Update#1 all I get is a black screen, after pressing CTRL X.
I know which RAM addresses are faulty because I did a MemTest but I'm not able to tell to the installer "Hey dude, install Ubuntu but don't use these RAM addresses!".
I cannot launch Ububtu in try mode because I get a Kernel Panic error due to the RAM.
Cheers
– filograndipad2 Apr 01 '20 at 08:47 -
4@filograndipad2: perhaps install Ubuntu onto the disk using a different computer, then reconnect the disk to the machine with bad RAM. So you only ever need to boot this computer once you have GRUB configured correctly. Although if the bad RAM cells are in memory the firmware always uses you're screwed. Or that GRUB uses early on, in which case you might need to hack GRUB to do its early loads to different physical addresses. Or use a different bootloader... If your machine supports UEFI booting, there several lightweight bootloaders you can try, like one that comes with systemd. – Peter Cordes Apr 01 '20 at 11:31
-
1@filograndipad2 Depending on WHERE your bad RAM is located, you might have a problem. Peter Cordes has a good idea. Remove the HDD. Put it into another computer. Install Ubuntu. Modify GRUB. Then return the HDD to the original laptop. Try and boot it. – heynnema Apr 01 '20 at 12:25
-
I had no idea, you can work around bad parts of the RAM. Great answer! +1 – Dohn Joe Apr 02 '20 at 08:27
-
@filograndipad2 If my answer was helpful, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks! – heynnema Apr 03 '20 at 03:19
-
@filograndipad2 this seems like a good deal of effort in general, but you may be able to set the BADRAM parameters on the Ubuntu installer too. – ti7 Apr 03 '20 at 04:40
-
-
@heynnema you're right! I had thought it was just another kernel arg, but that's apparently
memmap
.. I suspect this is what's really controlled by GRUB2, but it wasn't overly clear from the source. I'll make another answer suggesting directly settingmemmap=<mapping>
on the kernel line instead during the installer. – ti7 Apr 03 '20 at 13:40 -
-
@heynnema
mem
andmemmap
are actually different! Though if the corrupted memory is high enough into the system, just usingmem=400M
or naïvememmap=400M
to shrink the system memory is probably quite reasonable. – ti7 Apr 03 '20 at 13:48 -
-
Thanks for your attention and effort. I was not able to solve the problem but you spent a lot of time trying. Thanks. – filograndipad2 Apr 15 '20 at 08:40
-
-
@heynnema: hi, thanks for your time. I have an idea: a friend of mine gave me a 8GB ram module for the free socket so since the bad cells on the soldered ram are scattered, I wanto to tell to Linux to ignore entirely the first 8GB (i.e. the soldered module) and use only the other 8GB. How can I do that in the simpliest way? Thanks – filograndipad2 Apr 20 '20 at 16:28
-
@filograndipad2 Through the use of the
GRUB_BADRAM=
command, as outlined in my answer, and just block out the first 8G. I don't know if that'll work, as the OS may require some low memory to store parameters. You'll still have to take the drive out, and configure it elsewhere, as also outlined in my answer. It would be instructive to draw a map of where the bad RAM locations are in the first 8G... then you may still be able to map out just the bad ones... but you'll still have to remove the drive. – heynnema Apr 20 '20 at 16:51 -
@filograndipad2 Also check the specs of your computer to make sure it'll take 16G RAM. It may have an upper limit on what it'll take. – heynnema Apr 20 '20 at 16:55
-
@filograndipad2 Let me re-think my comment... if the extra memory is the same size as the built-in memory, it'll probably try to interleave them, for the fastest memory speed, and all of this becomes more complicated. It doesn't just add the additional 8G RAM to the top or bottom of the existing RAM. Taking out the drive and following the last instructions in my answer are still your best bet. – heynnema Apr 22 '20 at 20:12
Editing the installer command line with (probably [tab]
or e
) and setting the memmap
kernel command line parameter as memmap=nn[KMG]$ss[KMG][,nn[KMG]$ss[KMG]]
to exclude the broken regions may work for you! I suspect during installation this could be set quite broadly.
Note GRUB2 will consume $
, so it must be escaped \$
Example
memmap=64K\$0x18690000,3G\$4G
Alternatively, specify valid regions with @
instead of $
. This may be required, as it's not absolutely clear from the docs that multiple regions may be specified for exclusion (comma-separated), while this is explicitly described for inclusion. However, I very much suspect multiple exclusions work, as this would seem like a first-class use case.
Assuming you use GRUB2 after installation, you may wish to set up the GRUB_BADRAM=
parameter for your installed system to keep the parameters the way GRUB2 expects them, as suggested by the other excellent answer by @heynnema

- 139
- 7
memtest86
to confirm bad memory locations. "RAM chips rarely go bad". Really? Many of them go bad when users don't practice proper ESD procedures when installing them. – heynnema Apr 01 '20 at 21:16