Every once in a while admins need to add more RAM to the server. If you don’t have the exact specs handy (not everyone has a CMDB to do a quick lookup) you need to somehow get the crucial information using software. Here’s how I do it using dmidecode.
The story
For starters it’s good to know your motherboard details. dmidecode can output data from many sections called DMI types. Actually if you take a look into man 8 dmidecode you’ll see that there are 39 of those, including things like Power Supply, OEM Strings, Processor, Chassis or Cache. There also is a type called Base Board Information. Its numeric type is 2 and it is actually very easy to output just that with the following command:
root@dns:~# dmidecode -t 2
# dmidecode 2.9
SMBIOS 2.4 present.
Handle 0x0005, DMI type 2, 16 bytes
Base Board Information
Manufacturer: Intel
Product Name: S3000AH
Version: D40859-208
Serial Number: AZAY73900054
Asset Tag: Not Specified
Features:
Board is a hosting board
Board is replaceable
Location In Chassis: Not Specified
Chassis Handle: 0x0000
Type: Motherboard
Contained Object Handles: 0
Here we can see that I have an Intel S3000AH motherboard. With that I can find out the exact specifications and see that it supports:
Dual memory-channel, four DIMM slots for DDR2
533/667 MHz
Unbuffered ECC/non-ECC DIMMs (8 GB Max)
So far so good, I know my limits, let’s sniff around some more for Physical Memory Array (type 16):
root@dns:~# dmidecode -t 16 # dmidecode 2.9 SMBIOS 2.4 present. Handle 0x0022, DMI type 16, 15 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Single-bit ECC Maximum Capacity: 8 GB Error Information Handle: Not Provided Number Of Devices: 4
This confirmed the ECC type, Maximum Capacity and number of memory banks/slots. Good! Now let’s see what chips are actually in there? Let’s look for Memory Device types.
root@dns:~# dmidecode -t 17 # dmidecode 2.9 SMBIOS 2.4 present. Handle 0x0023, DMI type 17, 27 bytes Memory Device Array Handle: 0x0022 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: DIMM Set: None Locator: J8J1 Bank Locator: CHAN A DIMM 1 Type: DDR2 Type Detail: Synchronous Speed: 533 MHz (1.9 ns) Manufacturer: 0x7F98000000000000 Serial Number: 0x813625B6 Asset Tag: Unknown Part Number: 0x393930353332312D3030312E4130334C4600 Handle 0x0025, DMI type 17, 27 bytes Memory Device Array Handle: 0x0022 Error Information Handle: Not Provided Total Width: Unknown Data Width: Unknown Size: No Module Installed Form Factor: DIMM Set: None Locator: J8J2 Bank Locator: CHAN A DIMM 2 Type: DDR2 Type Detail: None Speed: Unknown Manufacturer: NO DIMM Serial Number: NO DIMM Asset Tag: NO DIMM Part Number: NO DIMM Handle 0x0026, DMI type 17, 27 bytes Memory Device Array Handle: 0x0022 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: DIMM Set: None Locator: J9J1 Bank Locator: CHAN B DIMM 1 Type: DDR2 Type Detail: Synchronous Speed: 533 MHz (1.9 ns) Manufacturer: 0x7F98000000000000 Serial Number: 0x82363EB6 Asset Tag: Unknown Part Number: 0x393930353332312D3030312E4130334C4600 Handle 0x0028, DMI type 17, 27 bytes Memory Device Array Handle: 0x0022 Error Information Handle: Not Provided Total Width: Unknown Data Width: Unknown Size: No Module Installed Form Factor: DIMM Set: None Locator: J9J2 Bank Locator: CHAN B DIMM 2 Type: DDR2 Type Detail: None Speed: Unknown Manufacturer: NO DIMM Serial Number: NO DIMM Asset Tag: NO DIMM Part Number: NO DIMM
Now here we have 4 sections. First two are Channel A and the other two are Channel B. This output shows I have one 1GB 533 MHz DDR in the first bank of each channel, totalling 2GB of RAM. Now I can go shopping!
Conclussion
When you are in need of information about hardware specs on a Linux box, you can use dmidecode to fetch all you need without actually having to be near the machine or have any documentation. All the details I needed with RAM in this story could be easily provided by one dmidecode -t 2,16,17. Hope you find that useful. I did
'IT-Consultant' 카테고리의 다른 글
tomat plugin setting with klt (0) | 2010.11.16 |
---|---|
MCRDR 을 응용한다면 어떻게 될까? (0) | 2010.11.11 |
torrent 검색 사이트 (국내) (0) | 2010.11.10 |
클래스 다이어그램(확장자 USD 파일) 사용 (0) | 2010.11.10 |
모니터 하나 더 써볼까? (0) | 2010.11.10 |