In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to replace the HBA card under Linux and re-sweep the disk. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
When external FC storage is connected to the Linux host, the HBA card is usually installed on the host, and the HBA card is connected to the fiber switch or direct storage through the WWN number. If there is a problem with the HBA card and needs to be replaced, the WWN number will be changed accordingly, and the link in the middle is equivalent to breaking, so that the storage disk partition cannot be recognized properly. Of course, some HBA have a WWN number on it, and you can change the configuration on the optical traffic or storage before replacing the HBA card. However, many do not mark this, need to go to the system through the command to check the newly identified WWN number.
The way to check the HBA card WWN number is as follows:
[root@seaing host4] # cat / sys/class/fc_host/host4/node_name
0x200000e08b86fd5c
You can also refer to the article: check the wwn number (http://www.361way.com/linux-wwwn-hba/4200.html) under linux.
After changing the WWN number, the system cannot directly update the mounted backend storage disk. If you need to re-scan the next disk, you can use the following methods to do so:
[root@seaing ~] # cd / sys/class/scsi_host/host4/
[root@seaing host4] # echo'> scan
Or
[root@seaing host4] # echo "1" > / sys/class/fc_host/host4/issue_lip
/ / some storage or systems do not have scan files, which can be identified by issue_lip files
Disk status before scanning:
[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 status after scanning:
[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
Note:
1. You can run fdisk-l before scanning and compare the results of fdisk-l after scanning. If the replacement is successful, you will find that the latter will see more results than the former. Therefore, before this kind of operation, it is best to make a backup of df, fdisk, mount, fstab and other information related to the disk. After the scan is completed, it is the safest to make a comparison with the original data.
2. It doesn't matter if you can't remember the above scanning instructions, the same effect can be achieved by rebooting the host.
3. Before and after the disk sweep, you can confirm the storage mount information by viewing / 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
The following is the storage sweep instructions given on redhat's official website:
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.
On how to change the HBA card under the Linux to re-share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.