众所周知,SATA和SCSI是支持热插拔的,但是新装了这类支持热插拔的驱动器,系统不会马上识别的,往往我们需要重启系统来识别,但是有另外一种方法可以很方面的让系统识别新的设备。

作为系统管理员,需要了解的最有用内容是,在有热交换驱动器情况下,如何不重启系统就可以添加更多磁盘空间。假使不使用 /proc,您可以插入驱动器,但为了使系统识别新磁盘,必须随即重新引导系统。
这里,可以用以下命令来使系统识别新的驱动器:
# echo "scsi add-single-device w x y z" > /proc/scsi/scsi
为使该命令正常运行,必须指定正确的参数值 w、x、y 和 z,如下所示:
w 是主机适配器标识,第一个适配器为零(0)
x 是主机适配器上的 SCSI 通道,第一个通道为零(0)
y 是设备的 SCSI 标识
z 是 LUN 号,第一个 LUN 为零(0) 相反的,在不重新引导系统的情况下将设备从系统中除去的命令是:
echo "scsi remove-single-device w x y z" > /proc/scsi/scsi
在输入这条命令并将热交换 SCSI 磁盘从系统中除去之前,请确保首先卸下已从该磁盘安装的任何文件系统。先用 cat /proc/partitions 看看系统认没有认该硬盘。
例如:
添加硬盘并查看
# echo "scsi add-single-device 0 0 1 0" >/proc/scsi/scsi
# fdisk -l
删除硬盘并查看
# echo "scsi remove-single-device 0 0 1 0" >/proc/scsi/scsi
# fdisk -l 我在vmware station虚拟机中,不关机新添加了2块scsi硬盘做而来实验: # echo "scsi add-single-device 0 0 1 0" > /proc/scsi/scsi
# echo "scsi add-single-device 0 0 2 0" > /proc/scsi/scsi
# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0 
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0 
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0 
Type: Direct-Access ANSI SCSI revision: 02 上面的代码表示已经找到了新加的2块硬盘

SCSI add-single-device and remove-single-device的更多相关文章

  1. Docker - 解决在容器内删除和主机映射的目录而报错 rm: cannot remove 'webapps': Device or resource busy 的问题

    问题背景 docker run -d --name tomcat7 -v /usr/local/tomcat/webapps:/usr/local/tomcat/webapps tomcat:7 使用 ...

  2. 【总文档】rac增加新节点的方法步骤 How to Add Node/Instance or Remove Node/Instance in 10gR2, 11gR1, 11gR2 and 12c Oracle Clusterware and RAC

    [总文档]How to Add Node/Instance or Remove Node/Instance in 10gR2, 11gR1, 11gR2 and 12c Oracle Clusterw ...

  3. Is an MTD device a block device or a char device?

    转:http://www.linux-mtd.infradead.org/faq/general.html#L_mtd_what Note, you can find Ukranian transla ...

  4. "The connection for the USB device '###' was unsuccessful. The device is currently in use"

    一.问题描述 1.情景描述 笔者的物理主机系统是“windows7 64位”,想使用“摄像头录像大师”.这个软件在录制视频的过程中,需要调用windows自带的"windows media ...

  5. tensorflow报错:Attempting to fetch value instead of handling error Internal: failed to get device attribute 13 for device 0: CUDA_ERROR_UNKNOWN:

    就是在spyder跑上一篇文章的代码然后就报错: Attempting to fetch value instead of handling error Internal: failed to get ...

  6. rm: cannot remove ‘overlay/’: Device or resource busy

    umount /var/lib/docker/overlay #取消挂载就可以啦 rm -rf overlay/

  7. rm: cannot remove `dir': Device or resource busy解决办法

    使用df查看系统发现: [ops@bs038 cm-5.4.0]$ df -hFilesystem Size Used Avail Use% Mounted on/dev/sda3 1.1T 200G ...

  8. [platform]linux platform device/driver(二)--Platform Device和Platform_driver注册过程之详细代码

    转自:http://www.cnblogs.com/haimeng2010/p/3582403.html 目录: 1.platform_device注册过程 2.platform_driver注册过程 ...

  9. Architecture of Device I/O Drivers, Device Driver Design

    http://www.kalinskyassociates.com/Wpaper4.html Architecture of Device I/O Drivers Many embedded syst ...

  10. [platform]linux platform device/driver(三)--Platform Device和Platform_driver注册过程之代码对比

    转自:http://blog.csdn.net/thl789/article/details/6723350 Linux 2.6的设备驱动模型中,所有的device都是通过Bus相连.device_r ...

随机推荐

  1. spark 机器学习 朴素贝叶斯 实现(二)

    已知10月份10-22日网球场地,会员打球情况通过朴素贝叶斯算法,预测23,24号是否适合打网球.结果,日期,天气 温度 风速结果(0否,1是)天气(0晴天,1阴天,2下雨)温度(0热,1舒适,2冷) ...

  2. [转]SE43 修改SAP标准菜单、登陆界面、背景图片

    1.事务码se43 复制标准菜单S000 到 ZS000  2.按实际需要修改 ZS000  3.在事务码SSM2中用ZS000 代替 S000  4.注销后重新登陆 o 修改SAP登陆界面(在本博客 ...

  3. angularJs解决模态框下echarts不显示问题

    例如:摸态框myModal.html,给它命名一个id,id='myModal'; myModal.html页面想画一个echarts图表 这里是angularJs已经封装好的echarts在html ...

  4. Windows 命令行方式打印和设置变量

    echo %PATH% http://blog.csdn.net/snlei/article/details/7211770

  5. Gdiplus的使用 gdi+

    使用步骤: 1.包括相应的头文件及引入相应的lib 1 #include <GdiPlus.h> 2 #pragma comment(lib, "gdiplus.lib" ...

  6. nodejs安装及使用步骤详解

    就一段小小的时间不用,就忘得差不多了,果然好记性不如乱笔头. 1.必须要安装node环境(建议装在C盘,这是一个系统盘)+安装mongoose数据库  +Robot 3T之于mongodb就相当于so ...

  7. HTTP的学习记录(二)头部

    本文主要讲一些 HTTP头部的信息 首先看一段 惊为天人 的文章. 来自于 <淘宝技术这十年> 你发现快要过年了,于是想给你的女朋友买一件毛衣,你打开了www.taobao.com.这时你 ...

  8. weblogic.xml

    <?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns="ht ...

  9. js获取文件MD5值

    原文链接:http://www.jianshu.com/p/940a9226fbbd   要在web页面中计算文件的md5值,还好这个项目是只需兼容现代浏览器的,不然要坑死了. 其实对文件进行md5, ...

  10. Java多线程与并发——进程与线程

    1.什么是进程 程序是指令和数据的有序集合,其本身没有任何运行的含义,是一个静态的概念.而进程是程序在处理机上的一次执行过程,它是一个动态的概念. 进程是一个具有一定独立功能的程序,一个实体,每一个进 ...