Tape rewind using scsi CDB
Discussion
Hi Guys,
OK, this one has beaten me - at least for the moment.
I am trying to rewind a tape (LTO6) using sg_raw from the sg_utils list of commands.
OS is Linux (RH 6.x / 7.x)
Now I can do it using >/dev/st1 for example .... but 1. I'm curious as to why it's not working and 2. I also want to fsf fsr etc , but one thing at once.
Yes, mt will do all this, but for various reasons, we can't install it.
So ...
I fsf'd a tape on my (lab) Linux server using mt, then tried the CDB to rewind ...
root@gpk630r2f-18 root $ /usr/bin/sg_raw /dev/nst0 01 00 00 00 00 00
SCSI Status: Good
Command appears to have worked ... but checking position of tape with mt status, shows it is still at File position 1.
root@gpk630r2f-18 root $ mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=1, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5a (no translation).
Soft error count since last status=0
Any ideas ???
Just to add, I was able set /unset 'prevent media removal' using the PMR CDB
/usr/bin/sg_raw /dev/nst0 1E 00 00 00 00 00 / 1E 00 00 00 01 00
... that worked fine, but rewind doesn't ...
Most things you can Google, but even that has failed me ....
Thanks in advance,
Martin
OK, this one has beaten me - at least for the moment.
I am trying to rewind a tape (LTO6) using sg_raw from the sg_utils list of commands.
OS is Linux (RH 6.x / 7.x)
Now I can do it using >/dev/st1 for example .... but 1. I'm curious as to why it's not working and 2. I also want to fsf fsr etc , but one thing at once.
Yes, mt will do all this, but for various reasons, we can't install it.
So ...
I fsf'd a tape on my (lab) Linux server using mt, then tried the CDB to rewind ...
root@gpk630r2f-18 root $ /usr/bin/sg_raw /dev/nst0 01 00 00 00 00 00
SCSI Status: Good
Command appears to have worked ... but checking position of tape with mt status, shows it is still at File position 1.
root@gpk630r2f-18 root $ mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=1, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5a (no translation).
Soft error count since last status=0
Any ideas ???
Just to add, I was able set /unset 'prevent media removal' using the PMR CDB
/usr/bin/sg_raw /dev/nst0 1E 00 00 00 00 00 / 1E 00 00 00 01 00
... that worked fine, but rewind doesn't ...
Most things you can Google, but even that has failed me ....
Thanks in advance,
Martin
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


