Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

There are several ways for Linux systems to scan SCSI disks

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about several ways the Linux system scans SCSI disks. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

More information

The Linux system provides multiple mechanisms to rescan the SCSI bus and recognize the SCSI devices added to the system. In the 2.4 kernel scheme, because the dynamic LUN scanning mechanism is not consistent, it is often necessary to interrupt Ihand O.

In the kernel, LUN scanning has been significantly improved and dynamic LUN scanning mechanism has been added. Linux currently lacks commands like drvconfig or ioscan that allow dynamic SCSI channel reconfiguration.

The ways in which Linux hosts reconfigure disk devices include:

◦ restart the system

◦ unloads and reloads the HBA driver module

List of SCSI devices under ◦ Echo / proc

◦ runs the SCSI scan through the property settings under / sys

◦ runs SCSI scan through HBA vendor script

System restart

Rebooting the host is a reliable way to detect newly added disk devices. Do not restart the host until all Icano stops, and connect the disk drive statically or as a module. The PCI bus is scanned during system initialization, so the SCSI host adapter mounted on it is scanned and a PCI device is generated. The scanning software then loads the appropriate driver for the PCI device. When the SCSI host driver is loaded, its probe function initializes the SCSI host, registers the interrupt handling function, and finally calls the scsi_scan_host function to scan all scsi buses managed by scsi host adapter.

Reload the HBA driver

Typically, the HBA driver is loaded as a module in the system. This allows the module to be unloaded and reloaded, during which the SCSI scan function is called. In general, before uninstalling the HBA driver, all SCSI devices should be stopped, the file system should be unmounted, and the multipath service application should be stopped. If there is an agent or HBA application help module, it should also be aborted.

Example of the command:

For example, if a server on the rac node executes the fdisk-l command and cannot see the shared disk, try the following command:

# modprobe-r lpfc (uninstall driver)

# modprobe lpfc (load driver)

/ SCSI scan under proc

In the kernel, the / proc file system provides a list of available SCSI devices. If the SCSI device in the system is reconfigured, all these changes are reflected in the SCSI device through the echo / proc interface. Add a device, host, channel,target ID, and disk device LUN number will be added to / proc/scsi/, need to specify the scsi number.

Example of the command:

# echo "scsi add-single-device 0 1 2 3" > / proc/scsi/scsi

0: host ID

1:channel ID

2:target ID

3:LUN number

This command adds the new disk device to the / proc/scsi/scsi file. If the file is not found, you need to create a device file name for the new disk device under the / dev path.

If you want to delete a disk device, run the following format command with the appropriate host, channel,target ID, and LUN number:

# echo "scsi remove-single-device 0 1 2 3" > / proc/scsi/scsi

0: host ID

1:channel ID

2:target ID

3:LUN number

/ SCSI scan under sys

In the kernel, the HBA driver exports the SCAN function to the / sys directory, which can be used to rescan SCSI disk devices under this interface. The command is as follows:

# cd / sys/class/scsi_host/host4/

# ls-al scan

# echo'---'> scan

'- -' stands for channel,target and LUN numbers. The above command will cause all channel,target and visible LUN under hba4 to be scanned.

RHEL5 or SUSE10:

Echo'---'> / sys/class/scsi_host/host0/scan

/ sys/class/scsi_host/ there are several host under the scan only a few times

RHEL4 or SUSE9:

Echo 1 > > / sys/class/scsi_host/host0/issue_lip

Also / sys/class/scsi_host/, there are several host under it, just execute it several times.

Echo "- -" > > / sys/class/scsi_host/host0/scan

Thank you for reading! This is the end of this article on "there are several ways for Linux systems to scan SCSI disks". I hope the above content can be of some help to you, so that 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report