CentOS 5上部署udev

字体大小: 中小 标准 ->行高大小: 标准

首先来简要的介绍下什么是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      Physical volume "/dev/sdb" successfully created  
  2. [root@db1 ~]# vgcreate data /dev/sdb     /dev/hdc: open failed: Read-only file system  
  3.   /dev/cdrom: open failed: Read-only file system     Attempt to close device '/dev/cdrom' which is not open.  
  4.   Volume group "data" successfully created   [root@db1 ~]# lvcreate -n crs1 -L 2G data  
  5.   Logical volume "crs1" created   [root@db1 ~]# lvcreate -n crs2 -L 2G data  
  6.   Logical volume "crs2" created   [root@db1 ~]# lvcreate -n crs3 -L 2G data  
  7.   Logical volume "crs3" created   [root@db1 ~]# lvcreate -n data -L 10G data  
  8.   Logical volume "data" created   [root@db1 ~]# lvcreate -n fra -L 10G data  
  9.   Logical volume "fra" created    
  10. [root@db1 ~]# lvs     LV   VG   Attr   LSize  Origin Snap%  Move Log Copy%  Convert  
  11.   crs1 data -wi-a-  2.00G                                           crs2 data -wi-a-  2.00G                                        
  12.   crs3 data -wi-a-  2.00G                                           data data -wi-a- 10.00G                                        
  13.   fra  data -wi-a- 10.00G      
  14. [root@db1 ~]# service tgtd start   Starting SCSI target daemon: [  OK  ]  
  15.   [root@db1 ~]# cat iscsi.sh   
  16. tgtadm  --lld iscsi --op new --mode target --tid 1 -T iqn.2012-07-04.com.yang.rac:crs1   tgtadm  --lld iscsi --op new --mode target --tid 2 -T iqn.2012-07-04.com.yang.rac:crs2  
  17. tgtadm  --lld iscsi --op new --mode target --tid 3 -T iqn.2012-07-04.com.yang.rac:crs3   tgtadm  --lld iscsi --op new --mode target --tid 4 -T iqn.2012-07-04.com.yang.rac:data  
  18. tgtadm  --lld iscsi --op new --mode target --tid 5 -T iqn.2012-07-04.com.yang.rac:fra    
  19. tgtadm  --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/data/crs1   tgtadm  --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 -b /dev/data/crs2  
  20. tgtadm  --lld iscsi --op new --mode logicalunit --tid 1 --lun 3 -b /dev/data/crs3   tgtadm  --lld iscsi --op new --mode logicalunit --tid 1 --lun 4 -b /dev/data/data  
  21. tgtadm  --lld iscsi --op new --mode logicalunit --tid 1 --lun 5 -b /dev/data/fra    
  22. tgtadm  --lld iscsi --op bind --mode target --tid 1 -I ALL   tgtadm  --lld iscsi --op bind --mode target --tid 2 -I ALL  
  23. tgtadm  --lld iscsi --op bind --mode target --tid 3 -I ALL   tgtadm  --lld iscsi --op bind --mode target --tid 4 -I ALL  
  24. tgtadm  --lld iscsi --op bind --mode target --tid 5 -I ALL    
  25. [root@db1 ~]# tgtadm --lld iscsi -o show -m target   [root@db1 ~]# sh iscsi.sh   
  26. [root@db1 ~]# tgtadm --lld iscsi -o show -m target   Target 1: iqn.2012-07-04.com.yang.rac:crs1  
  27.     System information:           Driver: iscsi  
  28.         State: ready       I_T nexus information:  
  29.     LUN information:           LUN: 0  
  30.             Type: controller               SCSI ID: deadbeaf1:0  
  31.             SCSI SN: beaf10               Size: 0 MB  
  32.             Online: Yes               Removable media: No  
  33.             Backing store: No backing store           LUN: 1  
  34.             Type: disk               SCSI ID: deadbeaf1:1  
  35.             SCSI SN: beaf11               Size: 2147 MB  
  36.             Online: Yes               Removable media: No  
  37.             Backing store: /dev/data/crs1           LUN: 2  
  38.             Type: disk               SCSI ID: deadbeaf1:2  
  39.             SCSI SN: beaf12               Size: 2147 MB  
  40.             Online: Yes               Removable media: No  
  41.             Backing store: /dev/data/crs2           LUN: 3  
  42.             Type: disk               SCSI ID: deadbeaf1:3  
  43.             SCSI SN: beaf13               Size: 2147 MB  
  44.             Online: Yes               Removable media: No  
  45.             Backing store: /dev/data/crs3           LUN: 4  
  46.             Type: disk               SCSI ID: deadbeaf1:4  
  47.             SCSI SN: beaf14               Size: 10737 MB  
  48.             Online: Yes               Removable media: No  
  49.             Backing store: /dev/data/data           LUN: 5  
  50.             Type: disk               SCSI ID: deadbeaf1:5  
  51.             SCSI SN: beaf15               Size: 10737 MB  
  52.             Online: Yes               Removable media: No  
  53.             Backing store: /dev/data/fra       Account information:  
  54.     ACL information:           ALL  
  55. Target 2: iqn.2012-07-04.com.yang.rac:crs2       System information:  
  56.         Driver: iscsi           State: ready  
  57.     I_T nexus information:       LUN information:  
  58.         LUN: 0               Type: controller  
  59.             SCSI ID: deadbeaf2:0               SCSI SN: beaf20  
  60.             Size: 0 MB               Online: Yes  
  61.             Removable media: No               Backing store: No backing store  
  62.     Account information:       ACL information:  
  63. Target 3: iqn.2012-07-04.com.yang.rac:crs3       System information:  
  64.         Driver: iscsi           State: ready  
  65.     I_T nexus information:       LUN information:  
  66.         LUN: 0               Type: controller  
  67.             SCSI ID: deadbeaf3:0               SCSI SN: beaf30  
  68.             Size: 0 MB               Online: Yes  
  69.             Removable media: No               Backing store: No backing store  
  70.     Account information:       ACL information:  
  71. Target 4: iqn.2012-07-04.com.yang.rac:data       System information:  
  72.         Driver: iscsi           State: ready  
  73.     I_T nexus information:       LUN information:  
  74.         LUN: 0               Type: controller  
  75.             SCSI ID: deadbeaf4:0               SCSI SN: beaf40  
  76.             Size: 0 MB               Online: Yes  
  77.             Removable media: No               Backing store: No backing store  
  78.     Account information:       ACL information:  
  79. Target 5: iqn.2012-07-04.com.yang.rac:fra       System information:  
  80.         Driver: iscsi           State: ready  
  81.     I_T nexus information:       LUN information:  
  82.         LUN: 0               Type: controller  
  83.             SCSI ID: deadbeaf5:0               SCSI SN: beaf50  
  84.             Size: 0 MB               Online: Yes  
  85.             Removable media: No               Backing store: No backing store  
  86.     Account information:       ACL information: 

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/66370.html