LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-08-2014, 10:11 AM   #1
davnetuk
Member
 
Registered: Feb 2003
Location: Great Britain
Distribution: Fedora 5
Posts: 62

Rep: Reputation: 15
UDEV Question


Hi there,

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.

Can anyone help with the above?

Thanks.
 
Old 10-08-2014, 02:48 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Member Response

Hi,

Maybe these links can be of help;

Quote:
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.'
Hope this helps.
Have fun & enjoy!
 
1 members found this post helpful.
Old 10-10-2014, 04:14 AM   #3
davnetuk
Member
 
Registered: Feb 2003
Location: Great Britain
Distribution: Fedora 5
Posts: 62

Original Poster
Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
udev question diamond_D Linux - Newbie 1 03-03-2012 02:41 PM
udev question greplinux Linux - Newbie 1 04-09-2009 07:36 PM
UDEV error question. mpajoh Fedora 1 01-08-2007 08:25 AM
Slack11 udev question syvy Slackware 8 10-09-2006 03:26 AM
udev question cferron Slackware 4 03-28-2006 11:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration