UDEV RULES ¿¡ ´ëÇÑ example À§ÁÖÀÇ ³»¿ë ÀÔ´Ï´Ù.
º»ÀÎÀÌ Âü°í¿ëÀ¸·Î ¸¸µç ºÎºÐÀÌ¶ó¡¦ ¾Õ, µÚ ³»¿ëÀÌ ¿¬°áÀÌ ¾È µÉ¼öµµ ÀÖ½À´Ï´Ù.
³»¿ë ¿¬°áÀÌ ¾È µÇ½Ç °æ¿ì¿£ ¾Æ·¡ÀÇ Âü°í »çÀÌÆ®¸¦ ÀÌ¿ëÇØ ÁÖ¼¼¿ä
### RHEL5 scsi id È®ÀÎ ¿¹Á¦
[root@rhel5 rules.d]# /sbin/scsi_id -g -u -s /block/sdc
3600a0b800013275100000015427b625e
[root@rehel5 rules.d]# /sbin/scsi_id -g -u -s /class/scsi_tape/nst0
SHP_C7438A_HU110180G4
### RHEL6 scsi id È®ÀÎ ¿¹Á¦
# /sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/sda
1ATA_ST31000524AS_6VPDF8ML
# /sbin/scsi_id -g -u -d /dev/sda
1ATA_ST31000524AS_6VPDF8ML
### RHEL 5 È®ÀÎµÈ scsi id ·Î udev rules Àû¿ë ¿¹Á¦
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="{UniqueIdentifier}",
SYMLINK+="devicename%n"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="3600a0b800013275100000015427b625e",
SYMLINK+="mydevice%n"
KERNEL=="nst[0-9]*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -u -g", RESULT=="{UniqueIdentifier}",
NAME="rmt0"
### RHEL 6 È®ÀÎµÈ scsi id ·Î udev rules Àû¿ë ¿¹Á¦
### block device udev rule
# cat /etc/udev/rules.d/75-localdisks.rules
KERNEL==¡±sd*¡±, BUS==¡±scsi¡±, PROGRAM==¡±/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$name¡±,RESULT==¡±1ATA_ST31000524AS_6VPDF8ML¡±,NAME+=¡±lvm_disk%n¡±, OWNER=¡±root¡± GROUP=¡±root¡± MODE=¡±0660¡È
# ls -al /dev/lvm_disk*
brw-rw—- 1 root root 8, 0 2013-02-06 07:57 /dev/lvm_disk
or
KERNEL==¡±sd*¡±, BUS==¡±scsi¡±, PROGRAM==¡±/sbin/scsi_id -g -u -d /dev/$parent¡±, RESULT==¡±1ATA_ST31000524AS_6VPDF8ML¡±, NAME=¡±unlvm_disk¡±, OWNER=¡±root¡±, GROUP=¡±root¡±, MODE=¡±0660¡È
# ls -al /dev/unlvm_disk*
brw-rw—- 1 root root 8, 1 2013-02-05 05:04 /dev/unlvm_disk
KERNEL==¡±sd*¡±, BUS==¡±scsi¡±, PROGRAM==¡±/sbin/scsi_id -g -u -d /dev/$parent¡±, RESULT==¡±1ATA_ST31000524AS_6VPDF8ML¡±, NAME=¡±unlvm_disk%n¡±, OWNER=¡±root¡±, GROUP=¡±root¡±, MODE=¡±0660¡È
# ls -al /dev/unlvm_disk*
brw-rw—- 1 root root 8, 1 2013-02-05 05:04 /dev/unlvm_disk
brw-rw—- 1 root root 8, 1 2013-02-02 23:13 /dev/unlvm_disk1
brw-rw—- 1 root root 8, 2 2013-02-02 23:13 /dev/unlvm_disk2
brw-rw—- 1 root root 8, 3 2013-02-02 23:13 /dev/unlvm_disk3
brw-rw—- 1 root root 8, 4 2013-02-02 23:13 /dev/unlvm_disk4
brw-rw—- 1 root root 8, 5 2013-02-02 23:13 /dev/unlvm_disk5
### SYMLINK device udev rule
KERNEL==¡±sd*¡±, BUS==¡±scsi¡±, PROGRAM==¡±/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$parent¡±,RESULT==¡±1ATA_ST31000524AS_6VPDF8ML¡±,SYMLINK=¡±polvm_disk%n¡±, OWNER=¡±root¡± GROUP=¡±root¡± MODE=¡±0660¡È
# ls -al /dev/polvm_disk*
lrwxrwxrwx 1 root root 4 2013-02-03 08:12 /dev/polvm_disk1 -> sda1
lrwxrwxrwx 1 root root 4 2013-02-03 08:12 /dev/polvm_disk2 -> sda2
lrwxrwxrwx 1 root root 4 2013-02-03 08:12 /dev/polvm_disk3 -> sda3
lrwxrwxrwx 1 root root 4 2013-02-03 08:12 /dev/polvm_disk4 -> sda4
lrwxrwxrwx 1 root root 4 2013-02-03 08:12 /dev/polvm_disk5 -> sda5
KERNEL==¡±sd*¡±, BUS==¡±scsi¡±, PROGRAM==¡±/sbin/scsi_id -g -u -d /dev/$parent¡±, RESULT==¡±1ATA_ST31000524AS_6VPDF8ML¡±, SYMLINK=¡±pwlvm_disk%n¡±, OWNER=¡±root¡±, GROUP=¡±root¡±, MODE=¡±0660¡È
# ls -al /dev/pwlvm_disk*
lrwxrwxrwx 1 root root 4 2013-02-04 20:08 /dev/pwlvm_disk1 -> sda1
lrwxrwxrwx 1 root root 4 2013-02-04 20:08 /dev/pwlvm_disk2 -> sda2
lrwxrwxrwx 1 root root 4 2013-02-04 20:08 /dev/pwlvm_disk3 -> sda3
lrwxrwxrwx 1 root root 4 2013-02-04 20:08 /dev/pwlvm_disk4 -> sda4
lrwxrwxrwx 1 root root 4 2013-02-04 20:08 /dev/pwlvm_disk5 -> sda5
### UDEV RULES ±¸¼º°ü·Ã È®ÀÎ
# RHEL6
udevadm test /block/sda 2>&1|grep pwlvm_disk
# RHEL5
udevtest /block/sda | grep pwlvm_disk
### UDEV RULES Àû¿ë
#start_udev