Hot swapping and online identification of SCSI hard disks in Linux
Source: Internet
Author: User
Linux implements SCSI hard drive hot swapping and online identification-Linux Enterprise Application-Linux server application information. The following is a detailed description. Today, we need to add a hard disk (SCSI) to a server, but the server cannot be shut down, so we thought of hot swapping. We can let the system identify the new hard disk with no downtime, the procedure is as follows:
Step 1: Insert the new hard disk to the machine;
Step 2: run the command as the root user:
Echo "scsi add-single-device x y z u">/proc/scsi
Where:
X is the SCSI controller Number of the hard disk (usually a SCSI controller, so it is 0 );
Y is the serial number of the SCSI channel where the hard disk is located (generally, the serial number of the single channel is 0, and the multi-channel depends on the Channel );
Z is the scsi id of the hard disk (which can be determined by the hard disk slot Inserted );
U is the lun Number of the hard disk (both are 0 by default)
Since I inserted the third hard disk, the command I run is:
Echo "scsi add-single-device 0 0 2 0">/proc/scsi
If the x y z parameter is incorrect, the system cannot identify the added hard disk. You can check the content of the/proc/scsi file to determine whether the added disk is successful. After the file is added, a device is added to the file. This file contains detailed information about all SCSI devices identified by the system, including the vendor, model, and media access type.
After running the above command, I checked the file/proc/scsi and found that there was one more device (the last one ):
Then look at the/proc/partition file and find that the hard disk has been identified! Next, you can partition, format, and use the partition tool. Because you do not need to reboot the system when using the parted partition tool, you do not need to restart the system during the entire hard disk adding process.
To remove a hard disk, perform the following operations:
Step 1: run the command as the root user:
Echo "scsi remove-single-device x y z u">/proc/scsi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.