ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Linux不重启识别新添加的磁盘

Linux不重启识别新添加的磁盘

原创 Linux操作系统 作者:guzhaoyu 时间:2013-06-28 10:23:39 1 删除 编辑

   在EXS4上面的2个VM上面安装11g R2的Gird Infrastucture,预先创建好了GRIDDISK1和GRIDDISK2这2个磁盘来给你OCR和Votedisk使用,安装到创建ASM时候才发现,需要3个磁盘才能是Normal级别的冗余,再主机上面创建了新的设备后,添加到机器上面,发现无法识别,fdisk -l看不到新加入的磁盘。不想因为这个事情来重启机器识别新硬盘(但是后来发现,实际上重启机器可能用的时间更少^-^),下面是动态盘识别的过程:

[root@node1-11gr2-rac host1]# cd /proc/scsi/
[root@node1-11gr2-rac scsi]# ls
device_info  mptspi  scsi  sg

列出已经发现的SCSI磁盘
[root@node1-11gr2-rac scsi]# cat scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 01 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 02 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 03 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02

#echo "scsi add-single-device a b c d">/proc/scsi/scsi

a是硬盘所在SCSI控制器号(我的VM有2个SCSI控制器,所以就是1);

b是硬盘所在SCSI通道的编号(一般单通道的就是0,多通道的要看是哪个通道了);

c是硬盘的SCSI ID号(可以通过具体插入的硬盘插槽来判断);

d是硬盘的lun号(默认情况都是0)

新加的磁盘在SCSI1上面的ID=04
[root@node1-11gr2-rac scsi]# echo  "scsi add-single-device 1 0 4 0">/proc/scsi/scsi
这个命令执行完可以看到/var/log/message中添加如下内容:
Oct 11 17:04:54 node1-11gr2-rac kudzu[6511]: obsolete kudzu ddcProbe called
Oct 11 17:10:48 node1-11gr2-rac kernel:   Vendor: VMware    Model: Virtual disk      Rev: 1.0
Oct 11 17:10:48 node1-11gr2-rac kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Oct 11 17:10:48 node1-11gr2-rac kernel:  target1:0:4: Beginning Domain Validation
Oct 11 17:10:48 node1-11gr2-rac kernel:  target1:0:4: Domain Validation skipping write tests
Oct 11 17:10:48 node1-11gr2-rac kernel:  target1:0:4: Ending Domain Validation
Oct 11 17:10:48 node1-11gr2-rac kernel:  target1:0:4: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)
Oct 11 17:10:48 node1-11gr2-rac kernel: SCSI device sdg: 2097152 512-byte hdwr sectors (1074 MB)
Oct 11 17:10:48 node1-11gr2-rac kernel: sdg: Write Protect is off
Oct 11 17:10:48 node1-11gr2-rac kernel: sdg: cache data unavailable
Oct 11 17:10:48 node1-11gr2-rac kernel: sdg: assuming drive cache: write through
Oct 11 17:10:48 node1-11gr2-rac kernel: SCSI device sdg: 2097152 512-byte hdwr sectors (1074 MB)
Oct 11 17:10:48 node1-11gr2-rac kernel: sdg: Write Protect is off
Oct 11 17:10:48 node1-11gr2-rac kernel: sdg: cache data unavailable
Oct 11 17:10:48 node1-11gr2-rac kernel: sdg: assuming drive cache: write through
Oct 11 17:10:48 node1-11gr2-rac kernel:  sdg: unknown partition table
Oct 11 17:10:48 node1-11gr2-rac kernel: sd 1:0:4:0: Attached scsi disk sdg
Oct 11 17:10:48 node1-11gr2-rac kernel: sd 1:0:4:0: Attached scsi generic sg6 type 0

[root@node1-11gr2-rac scsi]# cat scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 01 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 02 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 03 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 04 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02

这个是新发现的磁盘
[root@node1-11gr2-rac scsi]# fdisk -l

Disk /dev/sda: 15.0 GB, 15032385536 bytes
255 heads, 63 sectors/track, 1827 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1581    12699351   83  Linux
/dev/sda2            1582        1827     1975995   82  Linux swap / Solaris

Disk /dev/sdb: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         130     1044193+  83  Linux

Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         130     1044193+  83  Linux

Disk /dev/sde: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1         522     4192933+  83  Linux

Disk /dev/sdf: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         522     4192933+  83  Linux

Disk /dev/sdg: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdg doesn't contain a valid partition table
[root@node1-11gr2-rac scsi]#

/dev/sdg就是新加的磁盘!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7348112/viewspace-765000/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2013-05-24

  • 博文量
    1
  • 访问量
    138183