A Linux engineer is troubleshooting a newly added SCSI device for a Linux server that needed more disk space without rebooting.
The engineer discovers that the new device is not visible by the Linux kernel in fdisk -l output.
Which of the following commands should be used to rescan the entire SCSI bus?
Click on the arrows to vote for the correct answer
A. B. C. D.A.
https://geekpeek.net/rescan-scsi-bus-on-linux-system/The correct answer is A. echo "- - -" > /sys/class/scsi_host/host0/scan.
Explanation:
When a new SCSI device is added to a Linux system, the kernel needs to be made aware of it before it can be used. This process is called rescanning the SCSI bus.
The SCSI bus can be rescanned using the following command:
echo "- - -" > /sys/class/scsi_host/host0/scan
Here's what each part of the command does:
echo
: This command is used to print text to the console."- - -"
: These are three hyphens, separated by spaces. They tell the SCSI subsystem to rescan all channels, IDs, and LUNs.>
: This is the redirection operator. It tells the shell to redirect the output of the echo command to a file./sys/class/scsi_host/host0/scan
: This is the file where the SCSI subsystem listens for commands to rescan the SCSI bus.The reason why this command is the correct answer is that it uses the correct file path to the SCSI host adapter's scan file. In contrast, the other options use incorrect file paths, incorrect commands, or spaces instead of hyphens.
Overall, this command is a useful tool to know when working with Linux systems, especially when adding new SCSI devices.