Hi. On Sat, 27 Feb 2016 06:43:44 +1100 Andrew McGlashan <andrew.mcglas...@affinityvision.com.au> wrote:
> > > On 27/02/2016 6:22 AM, Dan Ritter wrote: > > On Sat, Feb 27, 2016 at 06:10:49AM +1100, Andrew McGlashan wrote: > >> > >> On 27/02/2016 5:46 AM, Christopher Swingley wrote: > >>> udevadm info --query=name --name=/dev/ttyUSB0 --attribute-walk > >> > >> udevadm info --query=name --name=/dev/sdg --attribute-walk > >> > >> Could you do something similar for mdadm RAID [external USB drives] > >> devices? Probably only need the serial number form the output. > > > > That's more or less exactly what LABEL, UUID and ID are for: > > Yes, but can you define RAID devices by UUID or Label? That's exactly why they invented /etc/mdadm/mdadm.conf. Mdadm never used /dev/sd* names internally anyway. > If I have a drive go out, I might unplug it and plug it in again and the > drive goes from /dev/sdg to /dev/sdh -- the RAID device won't assemble > because it isn't /dev/sdg. No. The RAID won't assemble because there's nobody to tell it to assemble. Device name change is irrelevant. But if you need to automate it, you need an udev rule for underlying disk devices (to trigger 'mdadm --re-add'), not md ones. > > $ cat /proc/mdstat > > Personalities : [raid1] > > md0 : active raid1 sda3[0] sdb3[1] > > 973827010 blocks super 1.2 [2/2] [UU] > > Those drives are not showing via UUID or label here... Because it's a *human* readable pseudo-file. They give us 'mdadm --detail --scan' which shows how really mdadm does RAID assembly. The same 'mdadm --detail --scan' is used for /etc/mdadm/mdadm.conf generation btw. Reco