How to change the name of Disk in RHEL 7 from something like /dev/sdb to /dev/data1 using udev
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to change the name of Disk in RHEL 7 from something like /dev/sdb to /dev/data1 using udev
Hi All,
I am trying to change the NAME of the disk in RHEL 7 eg /dev/sdb to /dev/data1
I tried the following method to try it.
I am using NAME="data1" here at the end of the udev rule file.
But it doesnt create "/dev/data1"
[root@localhost rules.d]# cat 99-myrules.rules
ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="3600605b0071b4c0020ca61bd1c625ccc", NAME="data1"
[root@localhost rules.d]# vi 99-myrules.rules
[root@localhost rules.d]# /sbin/udevadm control --reload-rules
[root@localhost rules.d]# /sbin/udevadm trigger --type=devices --action=change
[root@localhost rules.d]# ls -l /dev/data1
ls: cannot access /dev/data1: No such file or directory
[root@localhost rules.d]#
However i replace NAME="data1" with SYMLINK+="data1" and it does create a symlink to "/dev/sdb". But i need to get the first method working.
i.e. rename "/dev/sdb" to "/dev/data1". Please help.
Hi All,
I am trying to change the NAME of the disk in RHEL 7 eg /dev/sdb to /dev/data1 I tried the following method to try it.
I am using NAME="data1" here at the end of the udev rule file. But it doesnt create "/dev/data1"
[root@localhost rules.d]# cat 99-myrules.rules
ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="3600605b0071b4c0020ca61bd1c625ccc", NAME="data1"
[root@localhost rules.d]# vi 99-myrules.rules
[root@localhost rules.d]# /sbin/udevadm control --reload-rules
[root@localhost rules.d]# /sbin/udevadm trigger --type=devices --action=change
[root@localhost rules.d]# ls -l /dev/data1
ls: cannot access /dev/data1: No such file or directory
[root@localhost rules.d]#
However i replace NAME="data1" with SYMLINK+="data1" and it does create a symlink to "/dev/sdb". But i need to get the first method working.
i.e. rename "/dev/sdb" to "/dev/data1". Please help.
The first and most obvious question I have here is "why???" Instead of messing with udev rules to do something like this, it would be FAR simpler to just edit your fstab file, and just mount that device as "data1" in some path. What are you trying to accomplish here?? What is your actual goal in renaming a device like this?
And as you've been told before, you're using Red Hat Enterprise...so contact Red Hat support, since you're PAYING for RHEL...RIGHT???
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.