Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

ECC in One Paragraph

Memory chips can change a stored bit by themselves: a 0 becomes a 1. Ordinary memory has no way to notice, so the wrong value reaches the program, the file, or the database. ECC memory adds check bits to each block of data. When the block is read, the memory controller recomputes the check and, if one bit is wrong, corrects it on the spot. The program never sees the error, and the system logs that a correction happened.

Why Bits Flip

  • Radiation: particles from space and traces of radioactive material in chip packaging can disturb a memory cell.
  • Electrical noise and heat: small cells hold small charges, and interference can tip them.
  • Aging or faulty modules: a weak cell may fail again and again at the same address.

A single flip is rare, but a server with a large amount of memory running around the clock sees enough bit-hours that errors are expected over its life. The effect can be a crash, a kernel panic, or, worse, wrong data written to disk without any message.

How the Correction Works

The common scheme is called SECDED: single-error correction, double-error detection. For every 64 bits of data, the module stores 8 more check bits, which is why ECC modules are 72 bits wide instead of 64. From those check bits the controller can tell:

  • No error: the data is passed on.
  • One wrong bit: it knows which bit, flips it back, and counts a corrected error.
  • Two wrong bits: it cannot repair them, but it knows the data is bad and reports an uncorrected error. The system usually stops the affected process or halts, rather than use bad data.

Server platforms often add stronger schemes on top, which can survive the failure of a whole memory chip on a module.

What ECC Needs

ECC works only when the CPU, the memory controller, the motherboard, and the modules all support it. ECC modules in a board without support usually run as plain memory, with no protection. Server memory also comes in two kinds: registered (RDIMM), with a chip that buffers signals so a board can carry more modules, and unbuffered (UDIMM). The two kinds cannot be mixed, and most boards accept only one of them. The on-die error correction built into DDR5 chips protects only inside the chip and is not the same as ECC across the memory channel.

Check for ECC on Linux

sudo dmidecode -t memory

Look at the Physical Memory Array section: the Error Correction Type field names the ECC type, or None. For each module, a Total Width of 72 bits with a Data Width of 64 bits also points to ECC.

The kernel's EDAC (error detection and correction) driver counts errors per memory controller:

grep . /sys/devices/system/edac/mc/mc*/ce_count /sys/devices/system/edac/mc/mc*/ue_count

ce_count is corrected errors and ue_count uncorrected ones. If the directory does not exist, no EDAC driver is loaded for the memory controller. The edac-utils package on Debian and Ubuntu adds a summary command:

sudo apt install edac-utils
edac-util -v

On AlmaLinux and Rocky Linux, the rasdaemon package records memory events from the moment its service runs:

sudo dnf install rasdaemon
sudo systemctl enable --now rasdaemon
sudo ras-mc-ctl --errors

The last command lists the stored errors, and --summary counts them. rasdaemon is also packaged for Debian and Ubuntu.

Reading a Corrected-Error Line

A corrected error appears in the kernel log as a line that starts with EDAC, names the memory controller, and contains CE (corrected error), often with the slot or DIMM label. Find such lines with dmesg:

sudo dmesg | grep -i edac

One corrected error now and then is normal. Corrected errors that keep coming from the same module mean it is wearing out: plan to replace it. Any UE line means data could not be repaired and needs attention now.

ECC on a Virtual Server

Inside a virtual machine, dmidecode shows the values the hypervisor presents, not the physical modules, and EDAC usually finds nothing. Memory errors are handled on the host. On a dedicated server you can read them yourself, and the out-of-band controller described in what is IPMI keeps its own hardware event log.

Was this answer helpful?
Loading...