Linux下更換HBA卡重新掃盤
Linux 主機上外接FC 儲存時,一般都會在主機上加裝HBA 卡,HBA卡透過WWN號連線光纖交換機或直接儲存。如果HBA卡出問題需要更換時,WWN號相應的也會改變,中間的這個紐帶相當於斷了,就無法正常識別儲存磁碟分割槽。當然有些HBA上面貼的有WWN號,可以在更換HBA卡之前在光交或儲存上更換相應的配置。不過很多沒有標這個,需要到系統下透過命令檢視新識別的WWN號。
檢視HBA卡WWN號的操作方法如下:
[root@seaing host4]# cat /sys/class/fc_host/host4/node_name
0x200000e08b86fd5c
也可以參考文章:()。
更改完成WWN號後,系統無法直接更新掛載的後端儲存盤。需要重新掃下盤,可以使用如下方法進行掃盤操作:
[root@seaing ~ ]# cd /sys/class/scsi_host/host4/
[root@seaing host4]# echo '- - - ' > scan
或
[root@seaing host4]# echo "1" > /sys/class/fc_host/host4/issue_lip
//某些儲存或系統沒有scan檔案,可以通issue_lip檔案識別
掃描前的磁碟狀態:
[root@seaing host4]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM
Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3916 31455238+ 8e Linux LVM
Disk /dev/sdc: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 3916 31455238+ 8e Linux LVM
掃描後的磁碟狀態:
[root@seaing host4]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM
Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3916 31455238+ 8e Linux LVM
Disk /dev/sdc: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 3916 31455238+ 8e Linux LVM
Disk /dev/sdd: 21.4 GB, 21474836480 bytes
64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 21.4 GB, 21474836480 bytes
64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sde doesn't contain a valid partition table
注意:
1、可以在掃描之前先執行fdisk -l 與掃描之後fdisk -l 的結果進行比對。更換成功的話會發現後者檢視到的結果比前者多。所以此類操作前,最好將df 、fdisk 、mount、fstab 等和磁碟相關的資訊做個備份,掃描完成後,和原始資料做一個比對是最為保險的。
2、記不住上面的掃描指令也沒關係 ,透過重啟主機,可以達到同樣的效果。
3、掃盤前後,可以透過檢視/proc/scsi/scsi 確認儲存掛載資訊
[root@seaing host4]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: WDC WD5003ABYX-1 Rev: 01.0
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: PLDS Model: DVD-ROM DH-16D6S Rev: BD11
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: HSV300 Rev: 0005
Type: RAID ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 01
Vendor: HP Model: HSV300 Rev: 0005
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 01 Lun: 00
Vendor: HP Model: HSV300 Rev: 0005
Type: RAID ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 01 Lun: 01
Vendor: HP Model: HSV300 Rev: 0005
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 02
Vendor: HP Model: HSV300 Rev: 0005
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 01 Lun: 02
Vendor: HP Model: HSV300 Rev: 0005
Type: Direct-Access ANSI SCSI revision: 05
下面是redhat官網給出的儲存掃盤說明:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/scanning-storage-interconnects.html
***********************************************************************************************************
9 Scanning Storage Interconnects
There are several commands available that allow you to reset and/or scan one or more interconnects, potentially adding and removing multiple devices in one operation. This type of scan can be disruptive, as it can cause delays while I/O operations timeout, and remove devices unexpectedly. As such, Red Hat recommends that this type of scan be used only when necessary. In addition, the following restrictions must be observed when scanning storage interconnects:
1、All I/O on the effected interconnects must be paused and flushed before executing the procedure, and the results of the scan checked before I/O is resumed.
2、As with removing a device, interconnect scanning is not recommended when the system is under memory pressure. To determine the level of memory pressure, run the command vmstat 1 100; interconnect scanning is not recommended if free memory is less than 5% of the total memory in more than 10 samples per 100. It is also not recommended if swapping is active (non-zero si and so columns in the vmstat output). The command free can also display the total memory.
The following commands can be used to scan storage interconnects.
echo "1" > /sys/class/fc_host/host/issue_lip
This operation performs a Loop Initialization Protocol (LIP) and then scans the interconnect and causes the SCSI layer to be updated to reflect the devices currently on the bus. A LIP is, essentially, a bus reset, and will cause device addition and removal. This procedure is necessary to configure a new SCSI target on a Fibre Channel interconnect.
Bear in mind that issue_lip is an asynchronous operation. The command may complete before the entire scan has completed. You must monitor /var/log/messages to determine when it is done.
The lpfc and qla2xxx drivers support issue_lip. For more information about the API capabilities supported by each driver in Red Hat Enterprise Linux, refer to Table 1, “Fibre-Channel API Capabilities”.
/usr/bin/rescan-scsi-bus.sh
This script is included in Red Hat Enterprise Linux 5.4 and all future updates. By default, this script scans all the SCSI buses on the system, updating the SCSI layer to reflect new devices on the bus. The script provides additional options to allow device removal and the issuing of LIPs. For more information about this script (including known issues), refer to Section 16, “Adding/Removing a Logical Unit Through rescan-scsi-bus.sh”.
echo "- - -" > /sys/class/scsi_host/hosth/scan
This is the same command described in Section 7, “Adding a Storage Device or Path” to add a storage device or path. In this case, however, the channel number, SCSI target ID, and LUN values are replaced by wildcards. Any combination of identifiers and wildcards is allowed, allowing you to make the command as specific or broad as needed. This procedure will add LUNs, but not remove them.
rmmod driver-name or modprobe driver-name
These commands completely re-initialize the state of all interconnects controlled by the driver. Although this is extreme, it may be appropriate in some situations. This may be used, for example, to re-start the driver with a different module parameter value.
作者:SEian.G(苦練七十二變,笑對八十一難)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31015730/viewspace-2146280/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux下HBA卡的WWN檢視Linux
- Redhat Linux下安裝HBA卡並檢視WWN號RedhatLinux
- redhat linux系統下檢視Emulex HBA卡基本命令RedhatLinux
- 查詢hba卡wwn號
- EMC系統盤更換
- linux作業系統如何識別hba卡的wwn號Linux作業系統
- 大資料直通盤更換大資料
- RAC資料庫一節點更換HBA卡導致emc儲存裝置序號變動處理記錄資料庫
- IBM P670更換PCI卡IBM
- ASM下更換磁碟ASM
- win10掃雷怎麼換主題 如何更換win10的掃雷主題Win10
- 更換主機光纖介面卡的故事
- 更換HP小型機系統映象故障盤
- 同文輸入法更換鍵盤主題
- Linux centor 更換 PHP 版本LinuxPHP
- Mac OS 下更換 Ruby 源Mac
- 光纖網路卡和HBA卡有什麼區別?
- HP-UX主機更換SAN卡操作筆記UX筆記
- linux CentOS更換 ali YUM源LinuxCentOS
- Redhat 5.3 安裝hba卡,配置emc powerpath,配置LVMRedhatLVM
- 12c下更換ASM磁碟ASM
- V880系統盤更換實踐 [轉貼]
- linux設定自動更換桌布Linux
- windows下node更換版本(簡單操作)Windows
- linux下nc掃描tcp,udp埠LinuxTCPUDP
- Linux下Tomcat重新啟動LinuxTomcat
- linux下udev重新繫結磁碟Linuxdev
- Linux下更換預設yum源為網易yum源的操作記錄Linux
- Linux掛載資料盤教程,Linux初始化系統盤後重新掛載資料盤方法Linux
- Redhat 5.3 安裝hba卡,配置emc powerpath,配置LVM-轉RedhatLVM
- 如何在 Linux Mint 中更換主題Linux
- Linux下掛載USB盤Linux
- Linux 下網路介面卡配置Linux
- 關於3650M4安裝HBA卡PCI報警解決方法
- H3C HBA H460-M1卡安全擦除硬碟資料硬碟
- js更換網頁背景顏色並且可以防止重新整理JS網頁
- Linux之RedHat7如何更換yum源LinuxRedhat
- Linux環境更換阿里源(CentOS+Ubuntu)Linux阿里CentOSUbuntu