Consistent Dell raid device names

amosk asked:

We have a Dell PowerEdge R740 server running CentOS7 with raid disks configured via PERC H730P Mini controller.
On each reboot the device names (sda, sdb …) for the vdisks are assigned out of the order the vdisks were created (see below) and each time differently. This is kind of expected as the naming order depends on the readiness of the devices during the boot, which may vary.
But anyway is there a way to make the order, in which the vdisk devices appear in the system, consistent e.g. via some controller option? (Provided the physical devices are not changed)

# omreport storage vdisk controller=0  -fmt ssv | awk -F';' '{print $1, $3, $11}'
List of Virtual Disks on Controller PERC H730P Mini (Embedded)  
Controller PERC H730P Mini (Embedded)  
ID Name Device Name
0 OS_DISK /dev/sda
1 Virtual Disk1 /dev/sdc
2 Virtual Disk2 /dev/sdb
3 Virtual Disk3 /dev/sdg
4 Virtual Disk4 /dev/sde
5 Virtual Disk5 /dev/sdd
6 Virtual Disk6 /dev/sdh
7 Virtual Disk7 /dev/sdf
8 Virtual Disk8 /dev/sdi
9 Virtual Disk9 /dev/sdj
10 Virtual Disk10 /dev/sdk
11 Virtual Disk11 /dev/sdl
12 Virtual Disk12 /dev/sdm
13 Virtual Disk13 /dev/sdn
14 Virtual Disk14 /dev/sdp
15 Virtual Disk15 /dev/sdo
16 Virtual Disk16 /dev/sdq
17 Virtual Disk17 /dev/sdr
18 Virtual Disk18 /dev/sds
19 Virtual Disk19 /dev/sdt
20 Virtual Disk20 /dev/sdu
21 Virtual Disk21 /dev/sdy
22 Virtual Disk22 /dev/sdv
23 Virtual Disk23 /dev/sdw
24 Virtual Disk24 /dev/sdx

My answer:

Consistency of /dev/sd* device names can not be guaranteed. Full stop.

If you have an application which requires a consistent name, such as actually mounting a filesystem, use its ID or WWN instead. You can find symlinks with consistent names in the /dev/disk/by-id directory which you can use instead of /dev/sd*. (And note that WWNs of a RAID array are virtual and can only be guaranteed unique on the controller to which they’re attached.) And the virtual disk UUID can be used in /etc/fstab instead of the device path.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.