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

参考

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值