Creating Persistent Drive Labels With UDEV Using /dev/disk/by-path

Posted by Matt on Server Fault See other posts from Server Fault or by Matt
Published on 2012-09-19T18:48:29Z Indexed on 2013/06/25 10:23 UTC
Read the original article Hit count: 409

Filed under:
|
|
|
|

I have a new BackBlaze Pod (BackBlaze Pod 2.0).

It has 45 3TB drives and they when I first set it up they were labeled /dev/sda through /dev/sdz and /dev/sdaa through /dev/sdas.

I used mdadm to setup three really big 15 drive RAID6 arrays.

However, since first setup a few weeks ago I had a couple of the hard drives fail on me. I've replaced them but now the arrays are complaining because they can't find the missing drives. When I list the the disks...

ls -l /dev/sd*

I see that

/dev/sda
/dev/sdf
/dev/sdk
/dev/sdp

no longer appear and now there are 4 new ones...

/dev/sdau
/dev/sdav
/dev/sdaw
/dev/sdax

I also just found that I can do this...

ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 10 Sep 19 18:08 pci-0000:02:04.0-scsi-0:0:0:0 -> ../../sdau
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-0:1:0:0 -> ../../sdb
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-0:2:0:0 -> ../../sdc
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-0:3:0:0 -> ../../sdd
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-0:4:0:0 -> ../../sde
lrwxrwxrwx 1 root root 10 Sep 19 18:08 pci-0000:02:04.0-scsi-2:0:0:0 -> ../../sdae
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-2:1:0:0 -> ../../sdg
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-2:2:0:0 -> ../../sdh
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-2:3:0:0 -> ../../sdi
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-2:4:0:0 -> ../../sdj
lrwxrwxrwx 1 root root 10 Sep 19 18:08 pci-0000:02:04.0-scsi-3:0:0:0 -> ../../sdav
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-3:1:0:0 -> ../../sdl
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-3:2:0:0 -> ../../sdm
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-3:3:0:0 -> ../../sdn
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:02:04.0-scsi-3:4:0:0 -> ../../sdo
lrwxrwxrwx 1 root root 10 Sep 19 18:08 pci-0000:04:04.0-scsi-0:0:0:0 -> ../../sdax
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-0:1:0:0 -> ../../sdq
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-0:2:0:0 -> ../../sdr
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-0:3:0:0 -> ../../sds
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-0:4:0:0 -> ../../sdt
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:0:0:0 -> ../../sdu
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:1:0:0 -> ../../sdv
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:2:0:0 -> ../../sdw
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:3:0:0 -> ../../sdx
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-2:4:0:0 -> ../../sdy
lrwxrwxrwx 1 root root  9 Sep 19 18:08 pci-0000:04:04.0-scsi-3:0:0:0 -> ../../sdz

I didn't list them all....you can see the problem above. They're sorted by scsi id here but sda is missing...replaced by sdau...etc...

So obviously the arrays are complaining. Is it possible to get Linux to reread the drive labels in the correct order or am I screwed?

My initial design with 15 drive arrays is not ideal. With 3TB drives the rebuild times were taking 3 or 4 days....maybe more. I'm scrapping the whole design and I think I am going to go with 6 x 7 RAID5 disk arrays and 3 hot spares to make the arrays a bit easier to manage and shorten the rebuild times. But I'd like to clean up the drive labels so they aren't out of order. I haven't figured out how to do this yet.

Does anyone know how to get this straightened out?

Thanks,

Matt

© Server Fault or respective owner

Related posts about linux

Related posts about hard-drive