环境
RHEL6|RHEL7,LVM2,RAW device
用途
使用LVM的lv逻辑卷绑定裸设备
1. 编辑 /etc/udev/rules.d/60-raw.rules 添加如下:
ACTION!="add|change", GOTO="raw_end"
# Create raw character device mapping:
ENV{DM_VG_NAME}=="vgoradata", ENV{DM_LV_NAME}=="lv_5G_1", RUN+="/bin/raw /dev/raw/raw1 %N"
ENV{DM_VG_NAME}=="vgoradata", ENV{DM_LV_NAME}=="lv_5G_2", RUN+="/bin/raw /dev/raw/raw2 %N"
ENV{DM_VG_NAME}=="vgoradata", ENV{DM_LV_NAME}=="lv_5G_3", RUN+="/bin/raw /dev/raw/raw3 %N"
# To set permissions:
KERNEL=="raw*", OWNER:="grid", GROUP:="asmadmin", MODE:="0660" LABEL="raw_end
2.使规则生效
udevadm control --reload-rules
udevadm trigger --type=devices --action=change
3.查看结果
# raw -qa
# vs -o +lv_kernel_major,lv_kernel_minor
参考