一、利用udev(scsi_id -g -s /block/sdb )
/etc/udev/rules.d/20-names.rules
KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id –g –u –s %p”, RESULT==”xxxxxx”, NAME=”disk%n”
/etc/udev/rules.d/60-raw.rules
ACTION=="add", NAME=="disk1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", NAME=="disk2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", NAME=="disk3", RUN+="/bin/raw /dev/raw/raw3 %N"
KERNEL=="raw[0-9]*",OWNER="root",GROUP="disk",MODE="640"
二、利用/etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sda1
/dev/raw/raw2 8 2 (cat /proc/partitions major,minor)
阅读(1340) | 评论(0) | 转发(0) |