4

When I type

mdadm --detail /dev/md0

I get a lots of useful information most of which I understand. However I also get a line that reads:

Events : 0.710

Where the number varies.

Naively, I thought an event either happened or it didn't. How can I have only 0.710 of an event? Or if you prefer why is "Events" not an integer value?

EDIT

After seeing user's answer below, I dug into the code a bit and found

`#if __BYTE_ORDER == __BIG_ENDIAN

144 __u32 events_hi; /* 7 high-order of superblock update count */

145 __u32 events_lo; /* 8 low-order of superblock update count */

...

148 #else

149 __u32 events_lo; /* 7 low-order of superblock update count */

150 __u32 events_hi; /* 8 high-order of superblock update count */

...

153 #endif`

So "Events" is high-order and low order of "superblock update count" https://raid.wiki.kernel.org/index.php/Superblock

Jaydee
  • 371
  • 3
  • 11

1 Answers1

1

It's actually 1 64-bit integer split in two.

printf("\n         Events : %d.%d\n\n", sb->events_hi, sb->events_lo);

events_hi and events_lo are two 32-bit halves of one 64-bit number. Unless you have more than 2^31 "events," you'll probably only ever see one of those.

As far as what they mean, I'll quote the wiki page:

An 'event' is one of:

  • switch from 'active' to 'clean'
  • switch from 'clean' to '
  • device
  • device is
  • spare replaces a failed device after a rebuild

Notice a normal read/write is not an event.

None of these are meaningful for RAID0, so the 'events' counter on RAID0 should be stable.

Unfortunately, the number looks like a decimal but isn't. It is a 64bit number. We print out the top 32 bits, a period and then the bottom 32 bits. Maybe it'll be 'fixed' someday...

gido5731
  • 5
  • 3
user
  • 1,418
  • 8
  • 10
  • Ah ha! So the .710 is 710 (presumably) low priority events. Many thanks for digging this out. I wonder if there is a list of "events_lo" type events (and indead events_hi) anywhere. – Jaydee Jul 10 '13 at 14:14