Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
@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

Your Answer


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.