?Linux 6???UDEV??RAC ASM???????
- by Liu Maclean(???)
Maclean?????UDEV??ASMLIB?RAC???????????,???????????????????:Why ASMLIB and why not???UDEV????RAC ASM?????
?«??UDEV????RAC ASM????? »???????????????,????????udev rule????:
for i in b c d e f g h i j k ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id -g -u -s %p\", RESULT==\"`scsi_id -g -u -s /block/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
?????Linux 5?????, ????????redhat/Oracle Linux 6????????????
????:
?OEL6??RHEL6?,?????????
??????:1. scsi_id??????????,scsi_id -g -u -s??????????2. udevtest???????,????udevadm??How to use udev for Oracle ASM in Oracle Linux 6
???????????,???redhat/Oracle Linux 6??????udev rule ????:
1.
#????? Linux 6.0????
[root@vrh6 dev]# cat /etc/issue
Oracle Linux Server release 6.2
Kernel \r on an \m
2.
#?????/etc/scsi_id.config
echo "options=--whitelisted --replace-whitespace" >> /etc/scsi_id.config
3.
#?????????udev??
[root@vrh6 dev]# ls -l sd*
brw-rw----. 1 root disk 8, 0 Jun 30 09:29 sda
brw-rw----. 1 root disk 8, 1 Jun 30 09:29 sda1
brw-rw----. 1 root disk 8, 2 Jun 30 09:29 sda2
brw-rw----. 1 root disk 8, 16 Jun 30 09:29 sdb
brw-rw----. 1 root disk 8, 32 Jun 30 09:29 sdc
brw-rw----. 1 root disk 8, 48 Jun 30 09:29 sdd
brw-rw----. 1 root disk 8, 64 Jun 30 09:29 sde
brw-rw----. 1 root disk 8, 80 Jun 30 09:29 sdf
??????? sdb-> sdf????????
4. ? b->f?????for ???,??:
# AUTO UDEV RULE BY Maclean Liu 2012/06/30
for i in b c d e f ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
????sdb->sdf ?????RULE,????RULE???/etc/udev/rules.d/99-oracle-asmdevices.rules?
??????????? ,??RULE?99-oracle-asmdevices.rules
# AUTO UDEV RULE BY Maclean Liu 2012/06/30
for i in b c d e f ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done
5. ?????root??/sbin/start_udev ??
??????:
[root@vrh6 dev]# echo "options=--whitelisted --replace-whitespace" >> /etc/scsi_id.config
[root@vrh6 dev]# for i in b c d e f ;
> do
> echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules
> done
[root@vrh6 dev]#
[root@vrh6 dev]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB09cadb31-cfbea255", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB5f097069-59efb82f", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB4e1a81c0-20478bc4", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBdcce9285-b13c5a27", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB82effe1a-dbca7dff", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@vrh6 dev]#
[root@vrh6 dev]# /sbin/start_udev
Starting udev: [ OK ]
[root@vrh6 dev]# ls -l asm*
brw-rw----. 1 grid asmadmin 8, 16 Jun 30 09:34 asm-diskb
brw-rw----. 1 grid asmadmin 8, 32 Jun 30 09:34 asm-diskc
brw-rw----. 1 grid asmadmin 8, 48 Jun 30 09:34 asm-diskd
brw-rw----. 1 grid asmadmin 8, 64 Jun 30 09:34 asm-diske
brw-rw----. 1 grid asmadmin 8, 80 Jun 30 09:34 asm-diskf