System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Remove SAN Tape Device From RHEL System

Alzhy
Honored Contributor

Remove SAN Tape Device From RHEL System

If Removing Disk Devices meant:

echo 1 > /sys/block/sdY/device/delete

Is there a similar trick for Tape Drives?


We are in a situation wherein 2 FC Tape HBAs for SAN Tape Devices are being reused for SAN Disk Devices.

The SAN Tape devices have alerady been depresented and SAN disks present. Scan and lip were issued but the Tape Devices remain and no sign of the SAN Disk devices.

TIA!
Hakuna Matata.
5 REPLIES
Alzhy
Honored Contributor

Re: Remove SAN Tape Device From RHEL System

Hmm.. maybe:


lsscsi and find the H:B:T:L for each Tape Device.

Then, for each H:B:T:L do:

echo 1 > /sys/bus/scsi/devices/H:B:T:L/delete

Hakuna Matata.

Re: Remove SAN Tape Device From RHEL System

Hi

Tapes can be found under /sys/class/scsi_tape.
To delete a tape device use:
echo 1 > /sys/class/scsi_tape/nst0/device/delete

cheers
Reto
Alzhy
Honored Contributor

Re: Remove SAN Tape Device From RHEL System

Reto,

Thanks nonetheless but on our system:

echo 1 > /sys/bus/scsi/devices/H:B:T:L/delete

did the trick.

There was no dir structure for scsi_tape on our system under /sys/class.

Cheers!
Hakuna Matata.
Matti_Kurkela
Honored Contributor

Re: Remove SAN Tape Device From RHEL System

The /sys directory tree has been under constant development in the Linux 2.6.* kernel series. RHEL 4, 5 and 6 have significant differences in their /sys filesystems: the newer versions tend to have more stuff in /sys.

This was another fine example about why it's important to state your OS version when asking a technical question.

MK
MK
Alzhy
Honored Contributor

Re: Remove SAN Tape Device From RHEL System

My bad Matti sir.

But in the absence of a version -- I always deem it as a general question.

Version is RHEL 5.3/4/5/6.

No /sys/class/scsi_tape.

I did due diligence and simply sought out the device path for the tape drives. And bingo - there was a "delete" file in the structure. And it worked.

Beauty of Linux (and danger too?) -- everything seems to be dynamic and controllable via file switches.
Hakuna Matata.