Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > AS/ES/WS v. 4 > Issue <<  31 of 628 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 8082
Last update: 07-16-08
Issue:
How can static names be assigned for devices in udev for Red Hat Enterprise Linux 4?
Resolution:

Release Found: Red Hat Enterprise Linux 4

Limitation:
udev is found in Red Hat Enterprise 4. This article is not applicable to Red Hat Enterprise 3 and earlier releases.

  1. The first step would be to acquire UUIDs. Open the /etc/scsi_id.config file.
  2. Comment out the line:

    # options=-b
    
  3. In its place, add the following line:

    options=-g
    

    This tells udev to assume that all the SCSI devices on the system will return a UUID.

  4. To get the UUID, run this command:
    # scsi_id -g -s /block/sdc
    

    The output will look something like the following:

    [root@devices]# scsi_id -g -s /block/sdc
    3600a0b800013275100000015427b625e
    

    The result (the long string of charecters) will be the UUID. Verify that the UUID ID is the same for each path to the device. The UUID is what the device names will be keyed off of. UUIDs do not change if a device is added to the system.

  5. Now, rules need to be created for naming the device. Create the /etc/udev/rules.d/20-names.rules file.

    Within this file, the naming rule will be added. Any subsequent rules will be added in this file with the same format.

    Rules should have the following format:

    KERNEL="sd*", BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="UUID", NAME="devicename%n"
    

    Replace UUID and devicename with the UUID retrived above, and the desired name for the device. In the example, the rule would look as follows:

    KERNEL="sd*", BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="3600a0b800013275100000015427b625e", NAME="mydevice%n"
    

    This will cause the system to check all devices which match /dev/sd* to be checked for the given UUID. When it finds a matching device, it will create a device node named /dev/devicename. In the example, the device node would be /dev/mydevice.


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > AS/ES/WS v. 4 > Issue <<   31  of  628  >>