Sometimes we need to add hot-swappable SCSI hard drives to the online system, we cannot stop at this time, we can add the new hard disk to the system with the following instructions
# echo "scsi add-single-device 0 0 1 0" >/PROC/SCSI/SCSI//Add HDD
# echo "scsi remove-single-device 0 0 1 0" >/proc/scsi/scsi//delete HDD
For the four numbers in the directive, the SCSI, channel, ID, and LUN numbers, respectively
We can view this information for SCSI drives in the system by following the instructions below
# MORE/PROC/SCSI/SCSI
Attached devices:
Host:scsi0 channel:00 id:00 lun:00//four digits meaning
Vendor:seagate MODEL:ST373405LC rev:0003
Type:direct-access ANSI SCSI revision:03
Host:scsi0 channel:00 id:06 lun:00
Vendor:super model:gem318 rev:0
Type:processor
For servers that support hot-swappable SCSI technology, SCSI hard drives and tape drives can be added and removed online under Linux in the following ways:
To add a hard disk or a tape drive:
The first step: the new hard disk or tape drive to do physical connection;
Step two: Run the command as root in the Linux system:
echo "scsi add-single-device x y z u" ">/proc/scsi/scsi
which
X is the SCSI controller number where the hard disk or tape drive resides;
Y is the number of the SCSI channel where the hard disk or tape drive resides;
Z is the SCSI ID number of the hard disk or tape drive;
U is the LUN number of the hard disk or tape drive is 0 by default
If the x y z parameter is incorrect, the system is unable to identify the added hard disk and the tape drive can be verified by the CAT/PROC/SCSI/SCSI command to add success.
This command will return the details of all SCSI devices identified in the system, error maker, model capacity, type of media access, etc.
To remove a hard disk or a tape drive:
First step: Run the command as root in the Linux system:
echo "scsi remove-single-device x y z u" >/proc/scsi/scsi
The definition of x y z u ibid.
Step three: Physically disconnect the hard disk or the tape drive.
Instructions for hot-swappable hard drives under Linux