Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
I am trying to create a udev rule that will automatically rename a device to an Oracle ASM path on system boot.
For example:
/dev/sdd should become /dev/oracleasm/disk001
/dev/sde should become /dev/oracleasm/disk002
I am aware of how to do this with UUID's, however, the issue with UUID's is that you always have to know the value. Each time a new disk is added, you have to go and get the UUID.
In my situation, I know that any disk from /dev/sdd will be an Oracle ASM disk.
Here is my current rule, however it doesn't work on more than 1 disk:
KERNEL=="sd[d-z]", BUS=="scsi", ENV{DEVTYPE}=="disk", NAME="oracleasm/disk00%n", OWNER="oracle", GROUP="oinstall", MODE="0660"
The idea being that each time another disk is found, the disk number will increment by one.
From SlackwareŽ-Links; -- UDEV: Udev: Introduction to Device Management In Modern Linux System <- 'Udev supplies a dynamic device directory containing only the nodes for devices which are connected to the system. It creates or removes the device node files in the /dev directory as they are plugged in or taken out.' Writing udev rules <- 'This document assumes that you have udev installed and running OK with default configurations. This is usually handled by your Linux distribution.' Persistent block device naming <- 'This article describes how to use persistent names for your block devices. This has been made possible by the introduction of udev and has some advantages over bus-based naming.'
Thanks for the links. In the end I couldn't get the numeric thing to work, i.e. call the disks disk001, disk002 and so on.
I compromised and ended up going with this: disk00sdd, disk00sde etc
The rule to do this was:
file = /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd[d-z]", BUS=="scsi", ENV{DEVTYPE}=="disk", NAME="oracleasm/disk00%k", OWNER="oracle", GROUP="oinstall", MODE="0660"
Thus any disk from sdd onwards will have that rule applied. For me this is fine as only sda,b&c need to be non-ASM disks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.