Redhat7 Udev繫結單路徑裝置方法
1.取得磁碟UUID:
for disk in `ls /dev/sd*`
do
echo $disk
/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=$disk
done
/dev/sdb
36000c29cffb16d0ab6e706d8474b8185
/dev/sdc
36000c294296b162323c3d18f218c8ebe
/dev/sdd
36000c293d28c648b8ea3780f31d3aebe
/dev/sde
36000c29fde25492009f3fe4882603755
/dev/sdf
36000c29845ce8733dcd8f3929da7b5cd
/dev/sdi
36000c2915522598d7dc3510d3b2f684c
/dev/sdj
36000c299864887911287c47884386547
/dev/sdk
36000c29d4618f7df9988b2b35a5519a1
/dev/sdl
36000c293efbdb7dcd808213db15a0113
/dev/sdm
36000c294c9da2b5885758cf6bcc3647a
/dev/sdn
36000c2905f57bc45665172b71346051e
/dev/sdo
36000c299475e8f0fdf40ad2606e78168
/dev/sdp
36000c293a88560cbd6232bc838960608
2.生成rules檔案
cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c29cffb16d0ab6e706d8474b8185", SYMLINK+="asm_ocr_1_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c294296b162323c3d18f218c8ebe", SYMLINK+="asm_ocr_2_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c293d28c648b8ea3780f31d3aebe", SYMLINK+="asm_vote_1_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c29fde25492009f3fe4882603755", SYMLINK+="asm_vote_2_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c29845ce8733dcd8f3929da7b5cd", SYMLINK+="asm_vote_3_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c2915522598d7dc3510d3b2f684c", SYMLINK+="asm_data_1_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c299864887911287c47884386547", SYMLINK+="asm_data_1_2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c29d4618f7df9988b2b35a5519a1", SYMLINK+="asm_data_1_3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c293efbdb7dcd808213db15a0113", SYMLINK+="asm_data_2_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c294c9da2b5885758cf6bcc3647a", SYMLINK+="asm_data_2_2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c2905f57bc45665172b71346051e", SYMLINK+="asm_data_2_3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c299475e8f0fdf40ad2606e78168", SYMLINK+="asm_fra_1_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c293a88560cbd6232bc838960608", SYMLINK+="asm_fra_2_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
3.載入rules檔案
udevadm control --reload-rules
udevadm trigger
4.繫結後裝置資訊如下:
ls -l /dev/sd*
brw-rw---- 1 grid asmadmin 8, 16 Aug 29 09:28 /dev/sdb
brw-rw---- 1 grid asmadmin 8, 32 Aug 29 09:28 /dev/sdc
brw-rw---- 1 grid asmadmin 8, 48 Aug 29 09:28 /dev/sdd
brw-rw---- 1 grid asmadmin 8, 64 Aug 29 09:28 /dev/sde
brw-rw---- 1 grid asmadmin 8, 80 Aug 29 09:28 /dev/sdf
brw-rw---- 1 grid asmadmin 8, 128 Aug 29 09:28 /dev/sdi
brw-rw---- 1 grid asmadmin 8, 144 Aug 29 09:28 /dev/sdj
brw-rw---- 1 grid asmadmin 8, 160 Aug 29 09:27 /dev/sdk
brw-rw---- 1 grid asmadmin 8, 176 Aug 29 09:28 /dev/sdl
brw-rw---- 1 grid asmadmin 8, 192 Aug 29 09:27 /dev/sdm
brw-rw---- 1 grid asmadmin 8, 208 Aug 29 09:28 /dev/sdn
brw-rw---- 1 grid asmadmin 8, 224 Aug 29 09:28 /dev/sdo
brw-rw---- 1 grid asmadmin 8, 240 Aug 29 09:28 /dev/sdp
ls -l /dev/asm*
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_1_1 -> sdi
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_1_2 -> sdj
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_1_3 -> sdk
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_2_1 -> sdl
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_2_2 -> sdm
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_2_3 -> sdn
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_fra_1_1 -> sdo
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_fra_2_1 -> sdp
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_ocr_1_1 -> sdb
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_ocr_2_1 -> sdc
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_vote_1_1 -> sdd
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_vote_2_1 -> sde
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_vote_3_1 -> sdf
for disk in `ls /dev/sd*`
do
echo $disk
/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=$disk
done
/dev/sdb
36000c29cffb16d0ab6e706d8474b8185
/dev/sdc
36000c294296b162323c3d18f218c8ebe
/dev/sdd
36000c293d28c648b8ea3780f31d3aebe
/dev/sde
36000c29fde25492009f3fe4882603755
/dev/sdf
36000c29845ce8733dcd8f3929da7b5cd
/dev/sdi
36000c2915522598d7dc3510d3b2f684c
/dev/sdj
36000c299864887911287c47884386547
/dev/sdk
36000c29d4618f7df9988b2b35a5519a1
/dev/sdl
36000c293efbdb7dcd808213db15a0113
/dev/sdm
36000c294c9da2b5885758cf6bcc3647a
/dev/sdn
36000c2905f57bc45665172b71346051e
/dev/sdo
36000c299475e8f0fdf40ad2606e78168
/dev/sdp
36000c293a88560cbd6232bc838960608
2.生成rules檔案
cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c29cffb16d0ab6e706d8474b8185", SYMLINK+="asm_ocr_1_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c294296b162323c3d18f218c8ebe", SYMLINK+="asm_ocr_2_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c293d28c648b8ea3780f31d3aebe", SYMLINK+="asm_vote_1_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c29fde25492009f3fe4882603755", SYMLINK+="asm_vote_2_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c29845ce8733dcd8f3929da7b5cd", SYMLINK+="asm_vote_3_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c2915522598d7dc3510d3b2f684c", SYMLINK+="asm_data_1_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c299864887911287c47884386547", SYMLINK+="asm_data_1_2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c29d4618f7df9988b2b35a5519a1", SYMLINK+="asm_data_1_3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c293efbdb7dcd808213db15a0113", SYMLINK+="asm_data_2_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c294c9da2b5885758cf6bcc3647a", SYMLINK+="asm_data_2_2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c2905f57bc45665172b71346051e", SYMLINK+="asm_data_2_3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c299475e8f0fdf40ad2606e78168", SYMLINK+="asm_fra_1_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="36000c293a88560cbd6232bc838960608", SYMLINK+="asm_fra_2_1", OWNER="grid", GROUP="asmadmin", MODE="0660"
3.載入rules檔案
udevadm control --reload-rules
udevadm trigger
4.繫結後裝置資訊如下:
ls -l /dev/sd*
brw-rw---- 1 grid asmadmin 8, 16 Aug 29 09:28 /dev/sdb
brw-rw---- 1 grid asmadmin 8, 32 Aug 29 09:28 /dev/sdc
brw-rw---- 1 grid asmadmin 8, 48 Aug 29 09:28 /dev/sdd
brw-rw---- 1 grid asmadmin 8, 64 Aug 29 09:28 /dev/sde
brw-rw---- 1 grid asmadmin 8, 80 Aug 29 09:28 /dev/sdf
brw-rw---- 1 grid asmadmin 8, 128 Aug 29 09:28 /dev/sdi
brw-rw---- 1 grid asmadmin 8, 144 Aug 29 09:28 /dev/sdj
brw-rw---- 1 grid asmadmin 8, 160 Aug 29 09:27 /dev/sdk
brw-rw---- 1 grid asmadmin 8, 176 Aug 29 09:28 /dev/sdl
brw-rw---- 1 grid asmadmin 8, 192 Aug 29 09:27 /dev/sdm
brw-rw---- 1 grid asmadmin 8, 208 Aug 29 09:28 /dev/sdn
brw-rw---- 1 grid asmadmin 8, 224 Aug 29 09:28 /dev/sdo
brw-rw---- 1 grid asmadmin 8, 240 Aug 29 09:28 /dev/sdp
ls -l /dev/asm*
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_1_1 -> sdi
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_1_2 -> sdj
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_1_3 -> sdk
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_2_1 -> sdl
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_2_2 -> sdm
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_data_2_3 -> sdn
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_fra_1_1 -> sdo
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_fra_2_1 -> sdp
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_ocr_1_1 -> sdb
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_ocr_2_1 -> sdc
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_vote_1_1 -> sdd
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_vote_2_1 -> sde
lrwxrwxrwx 1 root root 3 Aug 29 09:27 /dev/asm_vote_3_1 -> sdf
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21754115/viewspace-2131866/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- linux udev裸裝置繫結Linuxdev
- Oracle Linux 7.8 多路徑(Multipath)+Udev繫結磁碟OracleLinuxdev
- 12C__單機安裝Grid+Oracle的方法,ASM使用UDEV進行磁碟繫結OracleASMdev
- 什麼是 SAP UI5 的繫結路徑UI
- UDEV掛載EMC多路徑盤dev
- 使用 udev 高效、動態地管理 Linux 裝置檔案devLinux
- 使用udev高效、動態的管理Linux裝置檔案devLinux
- rhel 7.x 使用 udev scsi rules 配置裸裝置dev
- ubuntu 為USB串列埠繫結固定的裝置名Ubuntu串列埠
- 定位器裝置繫結新增手機號欄位
- python-物件導向(繫結方法與非繫結方法)Python物件
- 類,物件繫結方法物件
- Oracle 11g RAC安裝--基於openfiler儲存+多路徑+udev方式Oracledev
- IOC容器的繫結解析過程(繫結單例)單例
- nodejs路徑處理方法和絕對路徑NodeJS
- 在邊緣裝置上擬合大型神經網路的方法總結神經網路
- 網路裝置
- webpack + ts 配置路徑別名無死角方法總結Web
- 裝置樹總結
- win10無法訪問指定裝置路徑或檔案怎麼辦Win10
- conda安裝庫所在路徑
- Laravel 單裝置登入Laravel
- sx-work網路繫結IP
- Linux配置和管理裝置對映多路徑multipathLinux
- Linux裸裝置總結Linux
- mysql資料庫安裝及預設儲存路徑修改方法MySql資料庫
- 多種網路裝置的優缺點及網路故障的排除方法
- Linux單裝置多路USB串列埠的實現方法介紹Linux串列埠
- 呼叫 sap.ui.base.ManagedObject 的建構函式時,如何傳遞繫結路徑進去UIObject函式
- Centos7或RedHat7下安裝MysqlCentOSRedhatMySql
- windows10無法訪問指定裝置怎麼辦 Win10提示無法訪問指定裝置路徑或檔案WindowsWin10
- Android單項繫結MVVM專案模板AndroidMVVM
- Vue.js表單輸入繫結Vue.js
- angular雙向繫結簡單實現Angular
- angular 多選表單資料繫結Angular
- Linux 7.x 中 UDEV 生效的方法Linuxdev
- Mac下Chrome extension 安裝路徑MacChrome
- React事件繫結幾種方法測試React事件
- React.js繫結this的5種方法ReactJS