歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS 5上部署udev

CentOS 5上部署udev

日期:2017/2/28 15:46:57   编辑:Linux教程

首先來簡要的介紹下什麼是udev,udev是Linux kernel 2.6系列的通用內核設備管理器,以守護進程的方式運行於Linux系統,並監聽在新設備初始化或設備從系統中移除時,內核(通過netlink socket)所發出的uevent;簡單點講就是當有多塊磁盤的時候,可以用udev來固定磁盤對應的設備名;之前在部署11g rac的時候都偏好使用asmlib,在最近一次的部署中asmlib出現了問題,而又沒有時間去排錯,因而采用udev部署,故而簡單記錄下udev的配置過程!

一:模擬共享盤陣,這裡采用先劃分lvm,再通過iscsi共享的方式來模擬

  1. [root@db1 ~]# pvcreate /dev/sdb
  2. Physical volume "/dev/sdb" successfully created
  3. [root@db1 ~]# vgcreate data /dev/sdb
  4. /dev/hdc: open failed: Read-only file system
  5. /dev/cdrom: open failed: Read-only file system
  6. Attempt to close device '/dev/cdrom' which is not open.
  7. Volume group "data" successfully created
  8. [root@db1 ~]# lvcreate -n crs1 -L 2G data
  9. Logical volume "crs1" created
  10. [root@db1 ~]# lvcreate -n crs2 -L 2G data
  11. Logical volume "crs2" created
  12. [root@db1 ~]# lvcreate -n crs3 -L 2G data
  13. Logical volume "crs3" created
  14. [root@db1 ~]# lvcreate -n data -L 10G data
  15. Logical volume "data" created
  16. [root@db1 ~]# lvcreate -n fra -L 10G data
  17. Logical volume "fra" created
  18. [root@db1 ~]# lvs
  19. LV VG Attr LSize Origin Snap% Move Log Copy% Convert
  20. crs1 data -wi-a- 2.00G
  21. crs2 data -wi-a- 2.00G
  22. crs3 data -wi-a- 2.00G
  23. data data -wi-a- 10.00G
  24. fra data -wi-a- 10.00G
  25. [root@db1 ~]# service tgtd start
  26. Starting SCSI target daemon: [ OK ]
  27. [root@db1 ~]# cat iscsi.sh
  28. tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2012-07-04.com.yang.rac:crs1
  29. tgtadm --lld iscsi --op new --mode target --tid 2 -T iqn.2012-07-04.com.yang.rac:crs2
  30. tgtadm --lld iscsi --op new --mode target --tid 3 -T iqn.2012-07-04.com.yang.rac:crs3
  31. tgtadm --lld iscsi --op new --mode target --tid 4 -T iqn.2012-07-04.com.yang.rac:data
  32. tgtadm --lld iscsi --op new --mode target --tid 5 -T iqn.2012-07-04.com.yang.rac:fra
  33. tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/data/crs1
  34. tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 -b /dev/data/crs2
  35. tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 3 -b /dev/data/crs3
  36. tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 4 -b /dev/data/data
  37. tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 5 -b /dev/data/fra
  38. tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
  39. tgtadm --lld iscsi --op bind --mode target --tid 2 -I ALL
  40. tgtadm --lld iscsi --op bind --mode target --tid 3 -I ALL
  41. tgtadm --lld iscsi --op bind --mode target --tid 4 -I ALL
  42. tgtadm --lld iscsi --op bind --mode target --tid 5 -I ALL
  43. [root@db1 ~]# tgtadm --lld iscsi -o show -m target
  44. [root@db1 ~]# sh iscsi.sh
  45. [root@db1 ~]# tgtadm --lld iscsi -o show -m target
  46. Target 1: iqn.2012-07-04.com.yang.rac:crs1
  47. System information:
  48. Driver: iscsi
  49. State: ready
  50. I_T nexus information:
  51. LUN information:
  52. LUN: 0
  53. Type: controller
  54. SCSI ID: deadbeaf1:0
  55. SCSI SN: beaf10
  56. Size: 0 MB
  57. Online: Yes
  58. Removable media: No
  59. Backing store: No backing store
  60. LUN: 1
  61. Type: disk
  62. SCSI ID: deadbeaf1:1
  63. SCSI SN: beaf11
  64. Size: 2147 MB
  65. Online: Yes
  66. Removable media: No
  67. Backing store: /dev/data/crs1
  68. LUN: 2
  69. Type: disk
  70. SCSI ID: deadbeaf1:2
  71. SCSI SN: beaf12
  72. Size: 2147 MB
  73. Online: Yes
  74. Removable media: No
  75. Backing store: /dev/data/crs2
  76. LUN: 3
  77. Type: disk
  78. SCSI ID: deadbeaf1:3
  79. SCSI SN: beaf13
  80. Size: 2147 MB
  81. Online: Yes
  82. Removable media: No
  83. Backing store: /dev/data/crs3
  84. LUN: 4
  85. Type: disk
  86. SCSI ID: deadbeaf1:4
  87. SCSI SN: beaf14
  88. Size: 10737 MB
  89. Online: Yes
  90. Removable media: No
  91. Backing store: /dev/data/data
  92. LUN: 5
  93. Type: disk
  94. SCSI ID: deadbeaf1:5
  95. SCSI SN: beaf15
  96. Size: 10737 MB
  97. Online: Yes
  98. Removable media: No
  99. Backing store: /dev/data/fra
  100. Account information:
  101. ACL information:
  102. ALL
  103. Target 2: iqn.2012-07-04.com.yang.rac:crs2
  104. System information:
  105. Driver: iscsi
  106. State: ready
  107. I_T nexus information:
  108. LUN information:
  109. LUN: 0
  110. Type: controller
  111. SCSI ID: deadbeaf2:0
  112. SCSI SN: beaf20
  113. Size: 0 MB
  114. Online: Yes
  115. Removable media: No
  116. Backing store: No backing store
  117. Account information:
  118. ACL information:
  119. Target 3: iqn.2012-07-04.com.yang.rac:crs3
  120. System information:
  121. Driver: iscsi
  122. State: ready
  123. I_T nexus information:
  124. LUN information:
  125. LUN: 0
  126. Type: controller
  127. SCSI ID: deadbeaf3:0
  128. SCSI SN: beaf30
  129. Size: 0 MB
  130. Online: Yes
  131. Removable media: No
  132. Backing store: No backing store
  133. Account information:
  134. ACL information:
  135. Target 4: iqn.2012-07-04.com.yang.rac:data
  136. System information:
  137. Driver: iscsi
  138. State: ready
  139. I_T nexus information:
  140. LUN information:
  141. LUN: 0
  142. Type: controller
  143. SCSI ID: deadbeaf4:0
  144. SCSI SN: beaf40
  145. Size: 0 MB
  146. Online: Yes
  147. Removable media: No
  148. Backing store: No backing store
  149. Account information:
  150. ACL information:
  151. Target 5: iqn.2012-07-04.com.yang.rac:fra
  152. System information:
  153. Driver: iscsi
  154. State: ready
  155. I_T nexus information:
  156. LUN information:
  157. LUN: 0
  158. Type: controller
  159. SCSI ID: deadbeaf5:0
  160. SCSI SN: beaf50
  161. Size: 0 MB
  162. Online: Yes
  163. Removable media: No
  164. Backing store: No backing store
  165. Account information:
  166. ACL information:
Copyright © Linux教程網 All Rights Reserved