Re: How to get consistent names for USB ports...
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:
$ cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda3[0] sdb3[1]
973827010 blocks super 1.2 [2/2] [UU]
$ ls -al /dev/disk/by-label/
lrwxrwxrwx 1 root root 9 Feb 17 07:01 root ->
../../md0
$ ls -al /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 9 Feb 17 07:01
6b5ccf44-ec11-4e23-a546-e4243c39c845 -> ../../md0
$ ls -al /dev/disk/by-id/
lrwxrwxrwx 1 root root 9 Feb 17 07:01
md-uuid-1d9b46e6:89ade869:04d6e780:9b677057 -> ../../md0
lrwxrwxrwx 1 root root 10 Feb 17 07:01
ata-WDC_WD1003FBYX-01Y7B0_WD-WCAW31795621-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Feb 17 07:01
scsi-SATA_WDC_WD1003FBYX-_WD-WCAW31789093-part3 -> ../../sdb3
Reply to: