[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



Reiner Buehl wrote: 
> 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?


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


Reply to: