Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #235879 > unrolled thread
| Started by | Reiner Buehl <reiner.buehl@gmail.com> |
|---|---|
| First post | 2021-06-04 14:50 +0200 |
| Last post | 2021-06-04 22:40 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.debian.user
Add /dev/disk/by-id path to mdadm error emails? Reiner Buehl <reiner.buehl@gmail.com> - 2021-06-04 14:50 +0200
Re: Add /dev/disk/by-id path to mdadm error emails? Dan Ritter <dsr@randomstring.org> - 2021-06-04 15:20 +0200
Re: Add /dev/disk/by-id path to mdadm error emails? Reiner Buehl <reiner.buehl@gmail.com> - 2021-06-04 22:40 +0200
| From | Reiner Buehl <reiner.buehl@gmail.com> |
|---|---|
| Date | 2021-06-04 14:50 +0200 |
| Subject | Add /dev/disk/by-id path to mdadm error emails? |
| Message-ID | <CmhqV-6Fg-5@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
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
[toc] | [next] | [standalone]
| From | Dan Ritter <dsr@randomstring.org> |
|---|---|
| Date | 2021-06-04 15:20 +0200 |
| Message-ID | <CmhTX-73G-3@gated-at.bofh.it> |
| In reply to | #235879 |
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-
[toc] | [prev] | [next] | [standalone]
| From | Reiner Buehl <reiner.buehl@gmail.com> |
|---|---|
| Date | 2021-06-04 22:40 +0200 |
| Message-ID | <CmoLL-2w8-9@gated-at.bofh.it> |
| In reply to | #235880 |
[Multipart message — attachments visible in raw view] — view raw
That seems perfect. Many thanks! Am Fr., 4. Juni 2021 um 15:10 Uhr schrieb Dan Ritter <dsr@randomstring.org>: > 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- >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web