[CentOS] What files to edit when changing the sdX of hard drives?

Jobst Schmalenbach

jobst at barrett.com.au
Thu Feb 28 03:12:15 UTC 2019


Hi

I have read instructions for udev, I also found many example on how to do this.
I want to lock in the SDA/SDB/SDC for my drives and I came up with a rule like this

  KERNEL=="sd?", SUBSYSTEM=="block", ENV{ID_SERIAL}=="ST500DM002-1BC142_W2A56H8A", NAME="sda", RUN+="/usr/bin/logger ID_SERIAL=$ENV{ID_SERIAL} set to /dev/sda ", GOTO="END_PERSISTENT_DISK"

However, it is not clear to me is in what files I need to add my rules.


Do I add a random file "99-my-rules.rules" in "/etc/udev/rules.d/"?

Do I copy a file from "/usr/lib/udev" to "/etc/udev/rules.d/" and add my rules?

Do I need to be careful with the NUMBER, e.g. "60-my-rule.rules"?


Jobst




-- 
186,262 miles/second :  Not just a good idea, it's the LAW.

  | |0| |   Jobst Schmalenbach, General Manager
  | | |0|   Barrett & Sales Essentials
  |0|0|0|   +61 3 9533 0000, POBox 277, Caulfield South, 3162, Australia


More information about the CentOS mailing list