在操作系统redhat 6上,重启multipath服务,盘的权限就变root了,需要用udev绑定设置权限。

查看设备

[root@oradbca ~]# dmsetup ls 
data01  (253:2)
crs03   (253:3)
VG0-LV_ROOT     (253:6)
crs02   (253:1)
crs01   (253:0)
data03  (253:5)
data02  (253:4)

 

配置参数

[root@oradbca ~]# cat /etc/udev/rules.d/12-dm-permissions.rules 
ENV{DM_NAME}=="crs01", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="crs02", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="crs03", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="data01", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="data02", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="data03", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/oraasm-$env{DM_NAME}"

 

重启服务

	service multipath restart

 

查看权限

[root@oradbca ~]# ll /dev/dm-*
brw-rw---- 1 grid asmadmin 253, 0 Jul 23 14:26 /dev/dm-0
brw-rw---- 1 grid asmadmin 253, 1 Jul 23 14:26 /dev/dm-1
brw-rw---- 1 grid asmadmin 253, 2 Jul 13 03:48 /dev/dm-2
brw-rw---- 1 grid asmadmin 253, 3 Jul 23 14:26 /dev/dm-3
brw-rw---- 1 grid asmadmin 253, 4 Jul 13 03:48 /dev/dm-4
brw-rw---- 1 grid asmadmin 253, 5 Jul 23 14:26 /dev/dm-5
brw-rw---- 1 root disk     253, 6 Jul 13 03:04 /dev/dm-6

 

贴multipath配置文件:

blacklist {
        devnode "^(sda)"
#       devnode "^(ram|raw|loop|fd|md|sr|scd|st|sdh|sdq)[0-9]*"
        devnode "^cciss.*"
}

## Use user friendly names, instead of using WWIDs as names.
defaults {
        user_friendly_names yes
        max_fds             max
        queue_without_daemon no  
        flush_on_last_del yes 
        dev_loss_tmo infinity
        fast_io_fail_tmo 5
}


devices {
        device {
                vendor                  "NetAPP"
                product                 "FAS2240"
                path_grouping_policy    group_by_prio
                features                "3 queue_if_no_path pg_init_retries 50"
                prio                    "ontap"
                getuid_callout          "/lib/udev/scsi_id -g -u -d /dev/%n"
                path_checker            tur
                path_selector           "round-robin 0"
                hardware_handler        "0"
                failback                imediate
                rr_weight               uniform
                rr_min_io               128
        }
}




multipaths {
        multipath {
                wwid                    360a98000426b5953423f456e30774c61
                alias                   crs01
        }
        multipath {
                wwid                    360a98000426b5953423f456e30774c63
                alias                   crs02
        }
        multipath {
                wwid                    360a98000426b5953423f456e30774c65
                alias                   crs03
        }
                multipath {
                wwid                    360a98000426b5953423f456e30774c67
                alias                   data01
        }
                multipath {
                wwid                    360a98000426b5953423f456e30774c69
                alias                   data02
        }
                multipath {
                wwid                    360a98000426b5953423f456e30774c6b
                alias                   data03
        }
}

原创文章,转载请注明: 转载自ORADBCA

本文链接地址: redhat 6用udev设置multipath盘的权限

36.3K