I'm running an OMV server on a mini-PC with 1 SSD as boot and 4 external drives as storage. System randomly keeps on assigning /dev/sd[a-z] to external drives which sometimes fails to auto-mount due to this situation. I would like to assign each Disk a fixed /dev/sdX
From what I read till now :
I'm should "Persistent block device name", since I can change partitions in future, it should be done by-id.
Firstly Identify Disk by its Serial, via udevadm info /dev/sdX, note ID_SERIAL_SHORT
Then nano /etc/udev/rules.d/99-openmediavault-dev-disk-by-id.rules
ADD ACTION=="add", KERNEL=="sd[a-z]", ENV{ID_SERIAL_SHORT}=="X5ER1ALX", RUN+="/path/to/script /dev/%k"
eg: for my 4TB external ID_SERIAL_SHORT=XYZ123ABC456 which I want on /dev/sdb
ADD ACTION=="add", KERNEL=="sdb", ENV{ID_SERIAL_SHORT}=="XYZ123ABC456", RUN+="/path/to/script /dev/%k"
Tried this on my server. After reboot it it was still assigned the old /dev/sdX
I don't really understand the second half of the script, there maybe in issue there I cant understand.