Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The command dd if=/dev/mem of=/dev/null seek=16k bs=4k count=1 is used to test erroect injection for edac. Why? As far as I know, dd is simply copying data from those devices to somewhere else. What bad can happen to cause an error to memory by copying?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

You skipped the important part before the dd command, from the kernel documentation:

For example, the following code will generate an error for any write access at socket 0, on any DIMM/address on channel 2:

 echo 2 >/sys/devices/system/edac/mc/mc0/inject_addrmatch/channel
 echo 2 >/sys/devices/system/edac/mc/mc0/inject_type
 echo 64 >/sys/devices/system/edac/mc/mc0/inject_eccmask
 echo 3 >/sys/devices/system/edac/mc/mc0/inject_section
 echo 1 >/sys/devices/system/edac/mc/mc0/inject_enable
 dd if=/dev/mem of=/dev/null seek=16k bs=4k count=1 >& /dev/null

The kernel driver generate errors, this has nothing to do with dd, dd is just used to trigger it.

share|improve this answer
    
So how does dd trigger a memory error exactly? I understand the inject things are for the configuration of error injection registers: lxr.linux.no/#linux+v3.0.42/drivers/edac/i7core_edac.c#L963 . The values the inject interfaces will be anded with each other and write to a register. But I don't understand how using dd can trigger error in memory. –  Amumu Dec 26 '12 at 3:45
2  
@Amumu any read operation will trigger the error, this has NOTHING to do with dd, you could either use dd, cat, any other tool or just wait until it would read from that specific channel. –  Ulrich Dangel Dec 26 '12 at 3:55
    
I see. Thanks. In the document (the Nehalem part), it mentions about using address match for error injection . What does it do? Does it mean, by using address match, it will cause an error at that specific physical memory address that is specified in address match register? And if edac hardware is working, when that faulty memory address is read, it should correct the error. Is that right? –  Amumu Dec 26 '12 at 4:05
    
@Amumu It depends, there are 5 different methods to match an address, like channel, dimm etc. And yes the error should be fixed. –  Ulrich Dangel Dec 26 '12 at 4:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.