UDEV for Oracle RAC ASM
1) Here I use the RHEL6 iscsi-target server to share a logical volume to host rac1.example.com, then this host find this device as /dev/sdb.# service iscsi status
iSCSI Transport> version 2.0-872.41.el6
Target: iqn.2013-03-26.com.example.racsd:rac-sharedisk
Current Portal: 172.16.51.233:3260,1
Persistent Portal: 172.16.51.233:3260,1
**********
Interface:
**********
Iface Name: default
Iface Transport: tcp
Iface Initiatorname: iqn.1994-05.com.redhat:e0dacf9722c9
Iface IPaddress: 172.16.51.213
Iface HWaddress:
Iface Netdev:
SID: 1
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
*********
Timeouts:
*********
Recovery Timeout: 120
Target Reset Timeout: 30
LUN Reset Timeout: 30
Abort Timeout: 15
*****
CHAP:
*****
username:
password: ********
username_in:
password_in: ********
************************
Negotiated iSCSI params:
************************
HeaderDigest: None
DataDigest: None
MaxRecvDataSegmentLength: 262144
MaxXmitDataSegmentLength: 8192
FirstBurstLength: 65536
MaxBurstLength: 262144
ImmediateData: Yes
InitialR2T: Yes
MaxOutstandingR2T: 1
************************
Attached SCSI devices:
************************
Host Number: 3 State: running
scsi3 Channel 00>
scsi3 Channel 00> Attached scsi disk sdb State: running
# fdisk -l /dev/sdb
Disk /dev/sdb: 42.6 GB, 42630905856 bytes
255 heads, 63 sectors/track, 5182 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector>
I/O>
Disk>
Device Boot Start End Blocks> /dev/sdb1 1 5182 41624383+ 5Extended
/dev/sdb5 1 262 2104452 83Linux
/dev/sdb6 263 524 2104483+83Linux
/dev/sdb7 525 786 2104483+83Linux
/dev/sdb8 787 3137 18884376 83Linux
/dev/sdb9 3138 5182 16426431 83Linux
2)Then use the command below to bound the five partitions of /dev/sdb to local as asm-disk.
@@@method 1
# cat generate_udev.sh
#!/bin/sh
rm -rf /etc/udev/rules.d/99-oracle-asmdevices.rules
for i in 5 6 7 8 9
do
echo "KERNEL==\"sdb$i\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$parent\", RESULT==\"`scsi_id --whitelisted --replace-whitespace --device=/dev/sdb`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\" " >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done
@@@method 2
# cat generate_udev.sh
#!/bin/sh
cat > /etc/udev/rules.d/99-oracle-asmdevices.rules/etc/udev/rules.d/99-oracle-asmdevices.rules
done
页:
[1]