[Linux7] Centos7 multipath 盤許可權繫結.
Centos7 multipath 盤許可權繫結.
[root@centos7 ~]$ more /etc/udev/rules.d/99-oracle.rules
KERNEL=="dm-0",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-1",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-2",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-3",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-4",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-5",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-6",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-7",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-8",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-9",OWNER="oragrid",GROUP="dba",MODE="0660"
關機前的對應關係
[root@centos7 ~]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 26 12:18 control
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 data03 -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data04 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 fra01 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 fra02 -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr01 -> ../dm-8
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr02 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr03 -> ../dm-9
lrwxrwxrwx. 1 root root 8 Jan 26 12:18 ocr04 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 virtual -> ../dm-2
lrwxrwxrwx. 1 root root 8 Jan 26 12:18 virtual1 -> ../dm-11
重啟後.對應關係發生了變化。如下:
data01重啟是都要dm-3,重啟後是dm-2
[root@centos7 ~]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 29 2018 control
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data01 -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data02 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data03 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data04 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 29 2018 fra01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 2018 fra02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr01 -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr02 -> ../dm-8
lrwxrwxrwx. 1 root root 8 Jan 29 2018 ocr03 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr04 -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jan 29 2018 virtual -> ../dm-6
lrwxrwxrwx. 1 root root 8 Jan 29 2018 virtual1 -> ../dm-11
所以 KERNEL=="dm-0",OWNER="oragrid",GROUP="dba",MODE="0660"
這種繫結許可權的方式有問題。
如果恰好沒有繫結到...許可權則不能正常賦予了。
採用如下方式,繫結許可權。
[root@centos7 /etc/udev/rules.d]$ more 99-oracle.rules
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr02"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr03"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr04"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data02"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data03"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data04"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/fra01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/fra02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr03"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr04"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data03"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data04"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/fra01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/fra02"
重啟後檢視許可權,給ASM用的盤的許可權正常。
[root@centos7 /etc/udev/rules.d]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 29 2018 control
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data02 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 data03 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data04 -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 fra01 -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 fra02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr01 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr02 -> ../dm-8
lrwxrwxrwx. 1 root root 8 Jan 29 09:41 ocr03 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr04 -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jan 29 2018 virtual -> ../dm-1
lrwxrwxrwx. 1 root root 8 Jan 29 2018 virtual1 -> ../dm-11
[root@centos7 /etc/udev/rules.d]$ ls -l /dev/dm*
brw-rw----. 1 oragrid dba 253, 0 Jan 29 09:41 /dev/dm-0
brw-rw----. 1 root disk 253, 1 Jan 29 2018 /dev/dm-1
brw-rw----. 1 oragrid dba 253, 10 Jan 29 09:41 /dev/dm-10
brw-rw----. 1 root disk 253, 11 Jan 29 2018 /dev/dm-11
brw-rw----. 1 oragrid dba 253, 2 Jan 29 09:47 /dev/dm-2
brw-rw----. 1 oragrid dba 253, 3 Jan 29 09:51 /dev/dm-3
brw-rw----. 1 oragrid dba 253, 4 Jan 29 09:41 /dev/dm-4
brw-rw----. 1 oragrid dba 253, 5 Jan 29 09:51 /dev/dm-5
brw-rw----. 1 oragrid dba 253, 6 Jan 29 09:51 /dev/dm-6
brw-rw----. 1 oragrid dba 253, 7 Jan 29 09:51 /dev/dm-7
brw-rw----. 1 oragrid dba 253, 8 Jan 29 09:51 /dev/dm-8
brw-rw----. 1 oragrid dba 253, 9 Jan 29 09:41 /dev/dm-9
***裡面不能用*代替,*不起作用。chown,chmod加上命令的全路徑。
[root@centos7 ~]$ more /etc/udev/rules.d/99-oracle.rules
KERNEL=="dm-0",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-1",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-2",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-3",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-4",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-5",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-6",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-7",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-8",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-9",OWNER="oragrid",GROUP="dba",MODE="0660"
關機前的對應關係
[root@centos7 ~]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 26 12:18 control
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 data03 -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data04 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 fra01 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 fra02 -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr01 -> ../dm-8
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr02 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr03 -> ../dm-9
lrwxrwxrwx. 1 root root 8 Jan 26 12:18 ocr04 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 virtual -> ../dm-2
lrwxrwxrwx. 1 root root 8 Jan 26 12:18 virtual1 -> ../dm-11
重啟後.對應關係發生了變化。如下:
data01重啟是都要dm-3,重啟後是dm-2
[root@centos7 ~]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 29 2018 control
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data01 -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data02 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data03 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data04 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 29 2018 fra01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 2018 fra02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr01 -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr02 -> ../dm-8
lrwxrwxrwx. 1 root root 8 Jan 29 2018 ocr03 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr04 -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jan 29 2018 virtual -> ../dm-6
lrwxrwxrwx. 1 root root 8 Jan 29 2018 virtual1 -> ../dm-11
所以 KERNEL=="dm-0",OWNER="oragrid",GROUP="dba",MODE="0660"
這種繫結許可權的方式有問題。
如果恰好沒有繫結到...許可權則不能正常賦予了。
採用如下方式,繫結許可權。
[root@centos7 /etc/udev/rules.d]$ more 99-oracle.rules
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr02"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr03"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr04"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data02"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data03"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data04"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/fra01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/fra02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr03"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr04"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data03"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data04"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/fra01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/fra02"
重啟後檢視許可權,給ASM用的盤的許可權正常。
[root@centos7 /etc/udev/rules.d]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 29 2018 control
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data02 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 data03 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data04 -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 fra01 -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 fra02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr01 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr02 -> ../dm-8
lrwxrwxrwx. 1 root root 8 Jan 29 09:41 ocr03 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr04 -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jan 29 2018 virtual -> ../dm-1
lrwxrwxrwx. 1 root root 8 Jan 29 2018 virtual1 -> ../dm-11
[root@centos7 /etc/udev/rules.d]$ ls -l /dev/dm*
brw-rw----. 1 oragrid dba 253, 0 Jan 29 09:41 /dev/dm-0
brw-rw----. 1 root disk 253, 1 Jan 29 2018 /dev/dm-1
brw-rw----. 1 oragrid dba 253, 10 Jan 29 09:41 /dev/dm-10
brw-rw----. 1 root disk 253, 11 Jan 29 2018 /dev/dm-11
brw-rw----. 1 oragrid dba 253, 2 Jan 29 09:47 /dev/dm-2
brw-rw----. 1 oragrid dba 253, 3 Jan 29 09:51 /dev/dm-3
brw-rw----. 1 oragrid dba 253, 4 Jan 29 09:41 /dev/dm-4
brw-rw----. 1 oragrid dba 253, 5 Jan 29 09:51 /dev/dm-5
brw-rw----. 1 oragrid dba 253, 6 Jan 29 09:51 /dev/dm-6
brw-rw----. 1 oragrid dba 253, 7 Jan 29 09:51 /dev/dm-7
brw-rw----. 1 oragrid dba 253, 8 Jan 29 09:51 /dev/dm-8
brw-rw----. 1 oragrid dba 253, 9 Jan 29 09:41 /dev/dm-9
***裡面不能用*代替,*不起作用。chown,chmod加上命令的全路徑。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2150608/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Guest許可權突破——許可權提升方法總結(轉)
- udev+multipath配合繫結磁碟dev
- Oracle的物件許可權、角色許可權、系統許可權Oracle物件
- 許可權之選單許可權
- 如何用 Vue 實現前端許可權控制(路由許可權 + 檢視許可權 + 請求許可權)Vue前端路由
- linux 檔案許可權 s 許可權和 t 許可權解析Linux
- 總結sysdba和sysoper許可權
- 許可權系統:一文搞懂功能許可權、資料許可權
- Linux-許可權管理(ACL許可權)Linux
- AIX 的許可許可權(轉)AI
- Android系統許可權和root許可權Android
- postgresql關於許可權的總結SQL
- Android動態許可權總結Android
- Vue許可權路由實現總結Vue路由
- odoo 許可權管理學習總結Odoo
- Linux 檔案許可權總結Linux
- 列許可權的一點總結!
- oracle的許可權管理的總結Oracle
- VIM在CentOS7上的無root許可權安裝CentOS
- mysql許可權MySql
- MySQL 許可權MySql
- ORACLE許可權Oracle
- 鍵盤俠Linux教程(五)| 基本許可權管理Linux
- Linux 許可權管理之目錄許可權限制Linux
- Oracle 使用者、物件許可權、系統許可權Oracle物件
- 【LIUNX】目錄或檔案許可權,許可權授予
- 選單許可權和按鈕許可權設定
- 【自然框架】許可權的視訊演示(二):許可權到欄位、許可權到記錄框架
- Oracle Linux 7.8 多路徑(Multipath)+Udev繫結磁碟OracleLinuxdev
- CentOS7學習筆記(六) 使用者許可權管理CentOS筆記
- 柳大的Linux講義·基礎篇(3)許可權、連結與許可權管理Linux
- vue許可權路由實現方式總結Vue路由
- Android6.0------許可權申請管理(單個許可權和多個許可權申請)Android
- django開發之許可權管理(一)——許可權管理詳解(許可權管理原理以及方案)、不使用許可權框架的原始授權方式詳解Django框架
- android動態許可權到自定義許可權框架Android框架
- Atitit godaddy 檔案許可權 root許可權設定Go
- 【許可權管理】Oracle中檢視、回收使用者許可權Oracle
- 許可權系統:許可權應用服務設計