真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Linux下如何更換HBA卡重新掃盤

這篇文章將為大家詳細(xì)講解有關(guān)Linux下如何更換HBA卡重新掃盤,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。

在冷水灘等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站建設(shè)、網(wǎng)站建設(shè) 網(wǎng)站設(shè)計(jì)制作按需定制網(wǎng)站,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),成都品牌網(wǎng)站建設(shè),營(yíng)銷型網(wǎng)站,外貿(mào)網(wǎng)站制作,冷水灘網(wǎng)站建設(shè)費(fèi)用合理。

Linux 主機(jī)上外接FC 存儲(chǔ)時(shí),一般都會(huì)在主機(jī)上加裝HBA 卡,HBA卡通過(guò)WWN號(hào)連接光纖交換機(jī)或直接存儲(chǔ)。如果HBA卡出問(wèn)題需要更換時(shí),WWN號(hào)相應(yīng)的也會(huì)改變,中間的這個(gè)紐帶相當(dāng)于斷了,就無(wú)法正常識(shí)別存儲(chǔ)磁盤分區(qū)。當(dāng)然有些HBA上面貼的有WWN號(hào),可以在更換HBA卡之前在光交或存儲(chǔ)上更換相應(yīng)的配置。不過(guò)很多沒(méi)有標(biāo)這個(gè),需要到系統(tǒng)下通過(guò)命令查看新識(shí)別的WWN號(hào)。

查看HBA卡WWN號(hào)的操作方法如下:

[root@seaing host4]# cat /sys/class/fc_host/host4/node_name

0x200000e08b86fd5c

也可以參考文章:linux下查看wwn號(hào)(http://www.361way.com/linux-wwwn-hba/4200.html)。

更改完成WWN號(hào)后,系統(tǒng)無(wú)法直接更新掛載的后端存儲(chǔ)盤。需要重新掃下盤,可以使用如下方法進(jìn)行掃盤操作:

[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 

//某些存儲(chǔ)或系統(tǒng)沒(méi)有scan文件,可以通issue_lip文件識(shí)別

掃描前的磁盤狀態(tài):

[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

掃描后的磁盤狀態(tài):

[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、可以在掃描之前先運(yùn)行fdisk -l 與掃描之后fdisk -l 的結(jié)果進(jìn)行比對(duì)。更換成功的話會(huì)發(fā)現(xiàn)后者查看到的結(jié)果比前者多。所以此類操作前,最好將df 、fdisk 、mount、fstab 等和磁盤相關(guān)的信息做個(gè)備份,掃描完成后,和原始數(shù)據(jù)做一個(gè)比對(duì)是最為保險(xiǎn)的。

2、記不住上面的掃描指令也沒(méi)關(guān)系 ,通過(guò)重啟主機(jī),可以達(dá)到同樣的效果。

3、掃盤前后,可以通過(guò)查看/proc/scsi/scsi 確認(rèn)存儲(chǔ)掛載信息

[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官網(wǎng)給出的存儲(chǔ)掃盤說(shuō)明:

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.

關(guān)于Linux下如何更換HBA卡重新掃盤就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到。


網(wǎng)頁(yè)標(biāo)題:Linux下如何更換HBA卡重新掃盤
標(biāo)題URL:http://weahome.cn/article/gejigh.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部