免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 917 | 回复: 0
打印 上一主题 下一主题

linux 下scsi磁盘热插拔 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-28 15:44 |只看该作者 |倒序浏览

First thing you have to do is make sure nothing is using the device. Check if you have software raid that it's been faild. Hopefully you didn't have a directory hard mounted on the system.
then you must find some information on the drive that was pulled....
cat /proc/scsi/scsi
Get the HOST CHAN ID and LUN #'s for the device. Then...
echo "scsi-remove-single-device HOST CHAN DEV LUN' > /proc/scsi/scsi
That removes the device from the system.
Hot Add the drive
echo "scsi-add-single-device HOST CHAN DEV LUN' > /proc/scsi/scsi
Adds it back in and spins it up.
-Nate
EXAMPLE: ASSUME IT WAS SDC REMOVEDB:
# cat /proc/scsi/scsi
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: DMVS09M          Rev: 0220
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: SEAGATE  Model: ST318406LC       Rev: 8A03
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: DELL     Model: 1x4 U2W SCSI BP  Rev: 1.16
  Type:   Processor                        ANSI SCSI revision: 02
So that would be
host 0 Channel 0 id 3 lun 0
echo 'scsi-remove-single-device 0 0 2 0' > /proc/scsi/scsi
cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: DMVS09M          Rev: 0220
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: SEAGATE  Model: ST318406LC       Rev: 8A03
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: DELL     Model: 1x4 U2W SCSI BP  Rev: 1.16
  Type:   Processor                        ANSI SCSI revision: 02
Device is now gone
echo 'scsi-add-single-device 0 0 3 0' > /proc/scsi/scsi
And the device is back.
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: DMVS09M          Rev: 0220
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: SEAGATE  Model: ST318406LC       Rev: 8A03
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: DELL     Model: 1x4 U2W SCSI BP  Rev: 1.16
  Type:   Processor                        ANSI SCSI revision: 02


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/47198/showart_369709.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP