How to activate and de-activate a scsi drive under Linux

I came across these commands because I wanted to add a new drive (not replace, add) to a Linux system that has hot-swap scsi drives. When I put the new drive in the OS couldn’t see it. I finally found out the command below to “activate” the drive so that you can use it.

Activate the drive:

echo "scsi add-single-device    " > /proc/scsi/scsi

for example:

echo "scsi add-single-device 0 00 01 00" > /proc/scsi/scsi

Deactivate the drive:

echo "scsi remove-single-device    " /proc/scsi/scsi

for example:

echo "scsi remove-single-device 0 0 1 0" /proc/scsi/scsi

See what drives are active:

cat /proc/scsi/scsi
for example:
[root@hostname root]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: COMPAQ   Model: MAB3091SC        Rev: 0814
  Type:   Direct-Access                    ANSI SCSI revision: 02
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s