Memory scanner for Linux
I need to buy some memory for a desktop computer. Now, I hate buying memory because I never know what to buy. EDO, DDR, SD, PC133, PC100, it’s all completely meaningless. People say; buy the right RAM to go with your motherboard. And find out what your motherboard is by opening the case. Then download some PDF manual from a very slow site in Taiwan and read it. And I still never know what to buy.
Surely, I thought, it is possible to work out what my motherboard is from software, and cross-reference that with some Big List Of Allowed RAM somewhere on the web to have a small program that, when I run it, says “Go and buy PC133 SDRAM; you have two memory slots and each can take up to 512MB”. You could even sell advertising space on it to RAM manufacturers if you were of a mind to, so when someone runs it they get a discreet little thing which says, underneath the description of what to buy, “click here to buy this specific item from Stuart’s House Of RAM” or something.
It took me, ooh, thirty seconds of poking around the web to discover the Crucial System Scanner, a download from the memory company Crucial, which does precisely and absolutely that. It’s a great little program; download it (about 70K) and run it and it throws you at an appropriate page on their site listing details of your motherboard and which Crucial RAM sticks you can buy. The tragedy is that it’s Windows-only. I was running it on a Windows machine anyway, so that’s not too big a loss, but: why isn’t there a free software version of this? Is “which RAM sticks am I rated for, and what type?” workable-out from /proc? If making the tool requires you to put a huge database of all the motherboards in existence and their RAM types on a website somewhere, I can understand why it doesn’t exist…
Wow, that’s exactly what I was going to suggest, as I read the first 2 paragraphs :-)
I recently needed to get more ram for a server at home so I did the requisite “open up case, find motherboard model no” stuff, went to the taiwanese site (asus) and got the manual, found the type of ram, then went to crucial.com to find out they had a nice scanner for it already! I was on linux though, but it was a good find, nonetheless.
36 minutes later
Unfortunately it really is that hard. I suspect that Crucial would be willing to work with someone who wanted to produce a Linux version of their Windows code though (so long as it ended up redirecting you to Crucial’s website :)).
48 minutes later
On my Ubuntu system there is a command line utility called lshw that is installed by default and reports information about hardware. Included in its output is much information about memory (current capacity, maximum capacity, number of used/unused memory banks, etc). If I were you, I’d take a look at its source code to see how it obtains this information. Good luck with it.
6 hours later
Jonathon: that would be a great idea, except mine says this:
*-memory description: System memory physical id: 0 size: 894MBand that’s it for memory. So…perhaps the information’s not available on all machines :(
9 hours later
Either:
1. Buy brand hardware, crucial and kingston can get you the right memory without a problem
2. Check the output of dmidecode, it looks something like:
Handle 0×1100, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0×1000
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: DIMM
Set: None
Locator: DIMM_1
Bank Locator: Not Specified
Type: DDR
Type Detail: Synchronous
Speed: 533 MHz (1.9 ns)
Manufacturer: 2CFFFFFFFFFFFFFF
Serial Number: 7540A144
Asset Tag: Not Specified
Part Number: 16HTF12864AY-53EB1
Voila!
10 hours later
There is a tool it is free and available and precompiled for use on “the ultimate boot cd” also on the Linux “Gentoo based System Rescue CD” the tool is called “aida” and I think maybe available on Knoppix also.
This basically tells you pretty much everything that the bios can tell you about the stuff on and plugged into your mother board. As a side note it doesn’t always get the sound card name correct but I think that is about the only thing it gets wrong.
10 hours later
Ahaha, dmidecode. Nice. I shall take a glance at that.
11 hours later
I’m so glad I’m not the only one who has this problem. It has always confused me. Let me know when you finish writing the program ;)
11 hours later
Grr! The Crucial website doesn’t work properly in the Firefox I have here when you try and buy stuff.
11 hours later
Ah, hm. It now says “Crucial.com is undergoing scheduled system maintenance. The website is currently down for scheduled maintenance. Please check back soon.”
So it may not be Firefox :)
11 hours later
Thanks to Jonathon for posting that info about the ‘lshw’ command! I did not know of its existance and it now solved my issues. THANKS!
10 days later
great, with ubuntu
sudo lshw
or
sudo dmidecode
are perfect, thank you guys :-)
11 days later
Thanks for the info! For what it’s worth, dmidecode works great with Redhat Enterprise Linux 3 (RHEL3), too.
3 weeks later
Thanks for the dmidecode info. I was trying to figure out how many RAM banks i had in a co-located rack server that i absolutely could not shut down.
5 weeks later
Thanks Bastien Nocera - dmidecode was exactly what I needed :)
Works great on CENTOS 4.3
15 weeks later
Just what I was looking for….
Worked on CentOS, Ubuntu, and Mandrake
43 weeks later
[...] I’m pondering adding more RAM to my workstation. 128Mb is enough for most of my work, but OpenOffice swaps a lot. I couldn’t remember what RAM is currently in it (one stick or two?) so I was very happy to find dmidecode in the comments on as days pass by, by Stuart Langridge: Memory scanner for Linux. dmidecode says I have a free slot and another 512Mb stick is surprisingly cheap. Actually, whole Ubuntu-ready-to-use computers are surprisingly cheap, according to lkcl. I hope they don’t contain toxic e-waste. I must be getting old. [Antti-Juhani Kaijanaho] [...]
53 weeks later
[...] Thanks to MJ Ray and Stuart Langridge, hopefully this will save me getting the screwdriver out in future! [...]
53 weeks later
Thanks a lot! dmidecode is just perfect on CentOS 5 on my laptop! I upgraded my Dell Inspiron 500m from 512 to 1024 Mb, but there’s errors on one of the blocks, so now I again run on 512. :-(
Well, what I was actually searching for was a tool that could scan the RAM-block - and possible map out bad-blocks like on harddisks - if there’s any such thing possible.
But then I instead - at last - got another problem solved instead - with dmidecode: What is the max amount of RAM, my laptop can handle? Some say 1GB, some 2GB - even Dell’s own homepage conflicts on this issue (and with the manual)! Thanks again! Just added “dmidecode” to my “Special Linux Commands” doc. :-)
62 weeks later
lshw and dmidecode to odd things on older boards, like list a 32MB pc100 as:
Installed Size: 16 MB (Double-bank Connection)
and also list it 2 times, and a 128MB as:
Installed Size: 64 MB (Double-bank Connection)
but does not list it 2 times.
and Jon, as for remapping like HDD’s, no such thing, but memtest86 can help you verify that the ram is indeed the issue. Supposedly DDR3 will support something similar to this, as does ECC ram.
69 weeks later
Works for opensuse 10.3 . Using “dmidecode –type memory” limits the output. Not entirely sure it tells me exactly what I should order however…
71 weeks later
You guys rule. That `sudo dmidecode’ command in my Ubuntu Linux box did the trick.. I now know much more about my hardware than I ever cared or wanted to. Good stuff. :)
73 weeks later