zoukankan      html  css  js  c++  java
  • ESX中的Linux热添加磁盘

          给VM新加了一个磁盘,不想重启VM又想认出这个磁盘怎么办呢?

          可以用这个命令:

    echo "scsi add-single-device A B C D" >/proc/scsi/scsi

          参数 A、B、C、D 的内容是:

    A : SCSI HBA ID
    B : SCSI Channel
    C : SCSI ID
    D : LUN ID

          就下图的设置命令可以写成这样:

    echo "scsi add-single-device 1 0 1 0" >/proc/scsi/scsi

    image

          效果如下:

    [root@rac02 ~]# cat /proc/scsi/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: scsi1 Channel: 00 Id: 00 Lun: 00
      Vendor: VMware   Model: Virtual disk     Rev: 1.0 
      Type:   Direct-Access                    ANSI SCSI revision: 02
    [root@rac02 ~]# 
    [root@rac02 ~]# 
    [root@rac02 ~]# echo "scsi add-single-device 1 0 1 0" >/proc/scsi/scsi
    [root@rac02 ~]# cat /proc/scsi/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: 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

          相反可以使用这个命令移除磁盘:

    echo "scsi remove-single-device A B C D" > /proc/scsi/scsi
  • 相关阅读:
    性能测试分析
    常见的性能缺陷
    性能测试中TPS上不去的几种原因浅析
    Linux新增和删除环境变量
    JProfiler的详细使用介绍
    详解Tomcat的连接数和线程池
    造数据存储过程
    shell脚本解压多个jar包
    使用shell快速建立上万个文件夹
    df、du命令
  • 原文地址:https://www.cnblogs.com/killkill/p/1951530.html
Copyright © 2011-2022 走看看