Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Add /dev/disk/by-id path to mdadm error emails?

63 views
Skip to first unread message

Reiner Buehl

unread,
Jun 4, 2021, 8:50:04 AM6/4/21
to
Hello all,

I have setup mdadm to email me when disks in one of my RAID arrays fail. Unfortunately the email messages only contain the device as /dev/sdb1 which does not give any hint which of the four identical disks in the array is the affected one. 
As /dev/sdb1 is only a symbolic link to a device in /dev/disk/by-id and that device contains the serial number of the disk, I was wondering if there is a way to add the /dev/disk/by-id information - or just a ls -l /dev/disk/by-id - to that email that would allow me to see which disk really is the failed one?

Best regards,
Reiner

Dan Ritter

unread,
Jun 4, 2021, 9:20:04 AM6/4/21
to
--prefer=
When mdadm needs to print the name for a device it
normally finds the name in /dev which refers to the device
and is shortest. When a path component is given with
--prefer mdadm will prefer a longer name if it contains
that component. For example --prefer=by-uuid will
prefer a name in a subdirectory of /dev called by-uuid.
This functionality is currently only provided by --detail
and --monitor.

If you have a cron job to run mdadm -F, this can be added. If
you have a system service to run mdadm -F in daemon mode, that
can be edited to include --prefer=by-id

-dsr-

Reiner Buehl

unread,
Jun 4, 2021, 4:40:05 PM6/4/21
to
That seems perfect. Many thanks!
0 new messages