<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; multipath</title>
	<atom:link href="https://www.xifenfei.com/tag/multipath/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Sun, 22 Nov 2026 15:21:14 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>multipath实现设备用户组设置</title>
		<link>https://www.xifenfei.com/2014/01/multipath%e5%ae%9e%e7%8e%b0%e8%ae%be%e5%a4%87%e7%94%a8%e6%88%b7%e7%bb%84%e8%ae%be%e7%bd%ae.html</link>
		<comments>https://www.xifenfei.com/2014/01/multipath%e5%ae%9e%e7%8e%b0%e8%ae%be%e5%a4%87%e7%94%a8%e6%88%b7%e7%bb%84%e8%ae%be%e7%bd%ae.html#comments</comments>
		<pubDate>Tue, 07 Jan 2014 13:43:46 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[multipath]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=5066</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2014/01/multipath%e5%ae%9e%e7%8e%b0%e8%ae%be%e5%a4%87%e7%94%a8%e6%88%b7%e7%bb%84%e8%ae%be%e7%bd%ae.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2014/01/multipath%e5%ae%9e%e7%8e%b0%e8%ae%be%e5%a4%87%e7%94%a8%e6%88%b7%e7%bb%84%e8%ae%be%e7%bd%ae.html" target="_blank">multipath实现设备用户组设置</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>现在的Linux系统中,很多都会使用系统自带的multipath多路径软件,在以前的版本中,我们一般通过multipath+udev或者multipath+rc.local来实现多路径和权限设置,而在redhat 5.3-5.11的版本中multipath就直接可以实现多路径聚合、设备持久化、用户组设置<br />
<strong>操作系统版本</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac1 dev]# uname -r
2.6.39-300.26.1.el5uek

[root@rac1 dev]# more /etc/issue
Oracle Linux Server release 5.9
Kernel \r on an \m
</pre>
<p><strong>fdisk记录</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac1 dev]# fdisk -l 
…………
Disk /dev/sdh: 134.2 GB, 134217728000 bytes
255 heads, 63 sectors/track, 16317 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdi: 33.5 GB, 33554432000 bytes
64 heads, 32 sectors/track, 32000 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
</pre>
<p><strong>multipath包</strong><br />
检查安装multipath相关包(该版本系统默认安装)</p>
<pre class="brush: bash; title: ; notranslate">
[root@rac1 dev]# rpm -aq|grep mapper
device-mapper-multipath-libs-0.4.9-56.0.3.el5
device-mapper-event-1.02.67-2.el5
device-mapper-1.02.67-2.el5
device-mapper-multipath-0.4.9-56.0.3.el5
</pre>
<p><strong>获取wwid值</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac1 dev]# /sbin/scsi_id -g -u -s /block/sdh
14f504e46494c45527049754962662d395751372d68356743
[root@rac1 dev]# /sbin/scsi_id -g -u -s /block/sdi
14f504e46494c4552484d486249782d464471382d354f4b58
</pre>
<p><strong>获取uid和gid</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac1 dev]# id grid
uid=1100(grid) gid=54321(oinstall) groups=54321(oinstall),1020(asmadmin),1021(asmdba)
</pre>
<p><strong>multipath.conf配置</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac1 dev]# vi /etc/multipath.conf

defaults {
user_friendly_names no
queue_without_daemon no
flush_on_last_del yes
max_fds max
}

blacklist {
devnode &quot;^hd[a-z]&quot;
devnode &quot;^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*&quot;
devnode &quot;^cciss.*&quot;
}

devices {
        device {
                vendor                  &quot;OPNFILER &quot;
                product                 &quot;LUN&quot;
                path_grouping_policy    group_by_prio
                features             &quot;3 queue_if_no_path pg_init_retries 50&quot;
                getuid_callout          &quot;/sbin/scsi_id -g -u -s /block/%n&quot;
                path_checker            tur
                path_selector           &quot;round-robin 0&quot;
                hardware_handler        &quot;1 alua&quot;
                failback               immediate
                rr_weight              uniform
                rr_min_io             128
        }
}

multipaths {
        multipath {
                wwid                    14f504e46494c45527049754962662d395751372d68356743  #wwid
                alias                   xifenfei128
                uid                     1100                                               #uid
                gid                     1020                                               #gid
        }



        multipath {
                wwid                    14f504e46494c4552484d486249782d464471382d354f4b58   #wwid
                alias                   xifenfei32                                          
                uid                     1100                                                #uid
                gid                     1020                                                #gid
         }
}
</pre>
<p><strong>启动multipath</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac1 dev]# modprobe dm-multipath 
[root@rac1 dev]# modprobe dm-round-robin 
[root@rac1 dev]# chkconfig multipathd on
[root@rac1 dev]# service multipathd start 
Starting multipathd daemon: [  OK  ]
[root@rac1 dev]# multipath -F
[root@rac1 dev]# multipath -v2
create: xifenfei128 (14f504e46494c45527049754962662d395751372d68356743) undef OPNFILER,VIRTUAL-DISK
size=125G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
  `- 3:0:0:9  sdh 8:112 undef ready  running
create: xifenfei32 (14f504e46494c4552484d486249782d464471382d354f4b58) undef OPNFILER,VIRTUAL-DISK
size=31G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
  `- 3:0:0:10 sdi 8:128 undef ready  running
</pre>
<p><strong>查看生成多路径设备</strong><br />
注意设备名称、组、用户</p>
<pre class="brush: bash; title: ; notranslate">
[root@rac1 dev]# ls -l /dev/mapper/xifenfei*
brw-rw---- 1 grid asmadmin 252, 2 Jan  7 21:21 /dev/mapper/xifenfei128
brw-rw---- 1 grid asmadmin 252, 3 Jan  7 21:21 /dev/mapper/xifenfei32
</pre>
<p><strong>补充Linux 6.x中udev设置所属组和权限</strong><br />
对于linux 6.x,multipath不能设置磁盘所属组和权限,可以通过udev进行实现,类似配置如下</p>
<pre class="brush: bash; title: ; notranslate">
[root@bxrac03 mapper]#cat 99-diskownership.rules

SUBSYSTEM!=&quot;block&quot;, GOTO=&quot;quickexit&quot;
KERNEL!=&quot;dm-*&quot;, GOTO=&quot;quickexit&quot;
PROGRAM==&quot;/sbin/dmsetup info -c --noheadings -o name -m %m -j %M&quot;
RESULT==&quot;*ocr*&quot;, OWNER=&quot;grid&quot;, GROUP=&quot;oinstall&quot;, MODE=&quot;0660&quot;
RESULT==&quot;*oradata&quot;, OWNER=&quot;grid&quot;, GROUP=&quot;oinstall&quot;, MODE=&quot;0660&quot;
RESULT==&quot;*backup&quot;, OWNER=&quot;grid&quot;, GROUP=&quot;oinstall&quot;, MODE=&quot;0660&quot;
LABEL=&quot;quickexit&quot;
</pre>
<p>其中RESULT和dm的别名向匹配</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/08/linux-7-udev.html" rel="bookmark" class="crp_title">linux 7(redhat,oracle linux,centos)中使用udev</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2026/05/warning-detected-duplicate-paths-to-the-same-disk.html" rel="bookmark" class="crp_title">WARNING: detected duplicate paths to the same disk导致crs无法正常启动故障解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2010/09/shell%e7%bc%96%e7%a8%8b%e2%80%94%e2%80%94%e5%9f%ba%e6%9c%ac%e8%af%ad%e6%b3%95.html" rel="bookmark" class="crp_title">shell编程——基本语法</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/gzexe%e5%8a%a0%e5%af%86shell%e8%84%9a%e6%9c%ac.html" rel="bookmark" class="crp_title">gzexe加密shell脚本</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/%e4%bd%bf%e7%94%a8dd%e5%a4%8d%e5%88%b6asm%e4%b8%ad%e6%96%87%e4%bb%b6.html" rel="bookmark" class="crp_title">使用dd复制asm中文件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/12/how-to-dump-the-contents-of-an-spfile-on-asm-when-asmgrid-is-down.html" rel="bookmark" class="crp_title">How to Get the Contents of an Spfile on ASM when ASM/GRID is down</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/08/oracle-12c-dbms_utility-expand_sql_text-%e6%9f%a5%e7%9c%8bsql%e8%a7%86%e5%9b%be%e5%9f%ba%e8%a1%a8.html" rel="bookmark" class="crp_title">ORACLE 12C dbms_utility.expand_sql_text 查看SQL视图基表</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/10/dd-npohasd.html" rel="bookmark" class="crp_title">11.2 crs启动超时dd  npohasd 处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2026/01/oracle-linux-8-10-pmlogger.html" rel="bookmark" class="crp_title">oracle linux 8.10注意pmlogger导致空间被大量占用</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/12/olr%e7%9b%b8%e5%85%b3%e7%bb%b4%e6%8a%a4.html" rel="bookmark" class="crp_title">OLR相关维护</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2010/08/fckeditor%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e.html" rel="bookmark" class="crp_title">fckeditor使用说明</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/09/%e5%ae%89%e8%a3%85oracle-db-tmp%e7%a9%ba%e9%97%b4%e4%b8%8d%e8%b6%b3%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html" rel="bookmark" class="crp_title">安装ORACLE db /tmp空间不足解决办法</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2014/01/multipath%e5%ae%9e%e7%8e%b0%e8%ae%be%e5%a4%87%e7%94%a8%e6%88%b7%e7%bb%84%e8%ae%be%e7%bd%ae.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
