视频地址:https://edu.51cto.com/center/course/lesson/index?id=82403
关机,编辑虚拟机vmx文件,在其中添加
disk.EnableUUID="TRUE"
配置3块40g的磁盘--grid
fdisk -l|grep "/dev/sd" |grep "42"
/dev/sde
/dev/sdd
/dev/sdc
#列出磁盘UUID
for i in c d e;
do
echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\",PROGRAM==\"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\",SYMLINK+=\"asm-disk$i\",OWNER=\"grid\", GROUP=\"asmadmin\",MODE=\"0660\""
done
#拷贝系统输出信息
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29bb637241039bf706ddc31b6bd",SYMLINK+="asm-grid01",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c292c2a4be6a077dd16422149d8c",SYMLINK+="asm-grid02",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29c6c33b38f1b115a6c21c36265",SYMLINK+="asm-grid03",OWNER="grid", GROUP="asmadmin",MODE="0660"
#修改SYMLINK参数
#SYMLINK+="asm-diskc" 修改为 SYMLINK+="asm-grid01"
#SYMLINK+="asm-diskd" 修改为 SYMLINK+="asm-grid02"
#SYMLINK+="asm-diske" 修改为 SYMLINK+="asm-grid03"
#写入配置文件
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
配置2块200g的磁盘--dgsystem
fdisk -l|grep "/dev/sd" |grep "21"
/dev/sdf
/dev/sdg
#列出磁盘UUID
for i in f g;
do
echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\",PROGRAM==\"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\",SYMLINK+=\"asm-disk$i\",OWNER=\"grid\", GROUP=\"asmadmin\",MODE=\"0660\""
done
#拷贝系统输出信息
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c295abb7155ca982311453baf576",SYMLINK+="asm-dgsystem01",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29dbdd18024a275e2f85debffcd",SYMLINK+="asm-dgsystem02",OWNER="grid", GROUP="asmadmin",MODE="0660"
#修改SYMLINK参数
#SYMLINK+="asm-diskf" 修改为 SYMLINK+="asm-dgsystem01"
#SYMLINK+="asm-diskg" 修改为 SYMLINK+="asm-dgsystem02"
#写入配置文件
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
配置4块500g的磁盘--dgrecovery
fdisk -l|grep "/dev/sd" |grep "53"
/dev/sdk
/dev/sdj
/dev/sdl
/dev/sdi
#列出磁盘UUID
for i in i j k l;
do
echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\",PROGRAM==\"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\",SYMLINK+=\"asm-disk$i\",OWNER=\"grid\", GROUP=\"asmadmin\",MODE=\"0660\""
done
#拷贝系统输出信息
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c299e6c5dc06c32482d6e3b868a8",SYMLINK+="asm-dgrecovery01",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29278cafab88d6f44b117e4c76a",SYMLINK+="asm-dgrecovery02",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29576b4999b3efdbced9d72fadf",SYMLINK+="asm-dgrecovery03",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29b40841f7cddbf60b14701d707",SYMLINK+="asm-dgrecovery04",OWNER="grid", GROUP="asmadmin",MODE="0660"
#修改SYMLINK参数
#SYMLINK+="asm-diski" 修改为 SYMLINK+="asm-dgrecovery01"
#SYMLINK+="asm-diskj" 修改为 SYMLINK+="asm-dgrecovery02"
#SYMLINK+="asm-diskk" 修改为 SYMLINK+="asm-dgrecovery03"
#SYMLINK+="asm-diskl 修改为 SYMLINK+="asm-dgrecovery04"
#写入配置文件
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
配置10块500g的磁盘--dgdata01
fdisk -l|grep "/dev/sd" |grep "53"
/dev/sdh
/dev/sdn
/dev/sdm
/dev/sdq
/dev/sdo
/dev/sdr
/dev/sdu
/dev/sdz
/dev/sdy
/dev/sdab
#列出磁盘UUID
for i in h n m q o r u z y ab;
do
echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\",PROGRAM==\"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\",SYMLINK+=\"asm-disk$i\",OWNER=\"grid\", GROUP=\"asmadmin\",MODE=\"0660\""
done
#拷贝系统输出信息
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29b2d18e94779afd3afea3d4c02",SYMLINK+="asm-dgdata0101",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c2941a790c317f433bc285eeef97",SYMLINK+="asm-dgdata0102",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c294815b7887b8e826f33bb52431",SYMLINK+="asm-dgdata0103",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c2997c0558259f1cd6fe8e276b02",SYMLINK+="asm-dgdata0104",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29fff94a77410c6ba38a3b6dc3c",SYMLINK+="asm-dgdata0105",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c2922bafc661d7f6e9c923da8695",SYMLINK+="asm-dgdata0106",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c2973e1b89256b314ee2d922e733",SYMLINK+="asm-dgdata0107",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c2948cf8e9a4fd5ae2679aaa8c28",SYMLINK+="asm-dgdata0108",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29be9433fa1407f599726ed6b96",SYMLINK+="asm-dgdata0109",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/$name",RESULT=="36000c29cd15c4afcfc3dbf2977d44e4d",SYMLINK+="asm-dgdata0110",OWNER="grid", GROUP="asmadmin",MODE="0660"
#修改SYMLINK参数
#SYMLINK+="asm-diskh" 修改为 SYMLINK+="asm-dgdata0101"
#SYMLINK+="asm-diskn" 修改为 SYMLINK+="asm-dgdata0102"
#SYMLINK+="asm-diskm" 修改为 SYMLINK+="asm-dgdata0103"
#SYMLINK+="asm-diskq" 修改为 SYMLINK+="asm-dgdata0104"
#SYMLINK+="asm-disko" 修改为 SYMLINK+="asm-dgdata0105"
#SYMLINK+="asm-diskr" 修改为 SYMLINK+="asm-dgdata0106"
#SYMLINK+="asm-disku" 修改为 SYMLINK+="asm-dgdata0107"
#SYMLINK+="asm-diskz" 修改为 SYMLINK+="asm-dgdata0108"
#SYMLINK+="asm-disky" 修改为 SYMLINK+="asm-dgdata0109"
#SYMLINK+="asm-diskab" 修改为 SYMLINK+="asm-dgdata0110"
#写入配置文件
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
--dgdata02 10个500g
/dev/sdt
/dev/sdx
/dev/sdv
/dev/sdaa
/dev/sdad
/dev/sdac
/dev/sdw
/dev/sdaf
/dev/sds
/dev/sdae
激活修改的配置文件
/sbin/udevadm trigger --type=devices --action=change
#检查ASM设备列表
ls -lsa /dev/asm*
#检查磁盘列表
ls -lsa /dev/sd*
配置15块1500g的磁盘--backup
#备份磁盘组用lvm管理
fdisk -l|grep "/dev/sd" |grep "16"
/dev/sdp
/dev/sdag
/dev/sdaq
/dev/sdam
/dev/sdap
/dev/sdao
/dev/sdaj
/dev/sdan
/dev/sdai
/dev/sdak
/dev/sdah
/dev/sdar
/dev/sdal
/dev/sdat
/dev/sdas