UDEV Rules
Posted 03-27-2009 at 09:25 AM by farslayer
Tags device, hard drive, rules, udev
udev Rules for the Hard drives..
Use udevinfo to get unique attributes about the devices you are going to write a rule for.
udevinfo -a -p /sys/block/sda | grep -i model
Gives the following output: SYSFS{model}="LD 0 RAID1 139G"
udevinfo -a -p /sys/block/sda | grep -i size
Gives the following output: SYSFS{size}="286515200"
udevinfo -a -p /sys/block/sdb | grep -i model
Gives the following output: SYSFS{model}="PERC 5/E Adapter"
udevinfo -a -p /sys/block/sdb | grep -i size
Gives the following output: SYSFS{size}="10732699648"
2. Now that we have unique information about each device, we can write a udev rule and rename each device.
cd /etc/udev/rules.d
vi 51-perc.rules
Place the following into the file:
SYSFS{size}="10732699648", SYSFS{model}="PERC 5/E Adapter", NAME="sdb"
SYSFS{size}="286515200", SYSFS{model}="LD 0 RAID1 139G", NAME="sda"
Issue a "udevstart"
Use udevinfo to get unique attributes about the devices you are going to write a rule for.
udevinfo -a -p /sys/block/sda | grep -i model
Gives the following output: SYSFS{model}="LD 0 RAID1 139G"
udevinfo -a -p /sys/block/sda | grep -i size
Gives the following output: SYSFS{size}="286515200"
udevinfo -a -p /sys/block/sdb | grep -i model
Gives the following output: SYSFS{model}="PERC 5/E Adapter"
udevinfo -a -p /sys/block/sdb | grep -i size
Gives the following output: SYSFS{size}="10732699648"
2. Now that we have unique information about each device, we can write a udev rule and rename each device.
cd /etc/udev/rules.d
vi 51-perc.rules
Place the following into the file:
SYSFS{size}="10732699648", SYSFS{model}="PERC 5/E Adapter", NAME="sdb"
SYSFS{size}="286515200", SYSFS{model}="LD 0 RAID1 139G", NAME="sda"
Issue a "udevstart"
Total Comments 0