linux lv绑定裸设备,RHEL 6.9 udev 将lv绑定raw devices

环境

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

/dev/raw/raw1:  bound to major 253, minor 0

/dev/raw/raw2:  bound to major 253, minor 1

/dev/raw/raw3:  bound to major 253, minor 2

# lvs -o +lv_kernel_major,lv_kernel_minor

LV      VG        Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert KMaj KMin

lv_5G_1 vgoradata -wi-a----- 2.00g                                                      253    0

lv_5G_2 vgoradata -wi-a----- 2.00g                                                      253    1

lv_5G_3 vgoradata -wi-a----- 2.00g                                                      253    2

参考

内容来源于网络如有侵权请私信删除

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 1024 设计师:白松林 返回首页