Tape rewind using scsi CDB
Author
Discussion

mph999

Original Poster:

2,780 posts

251 months

Tuesday 18th September 2018
quotequote all
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

8bit

5,593 posts

186 months

Wednesday 19th September 2018
quotequote all
Just about to dash into a meeting so not had a proper look but any reason you can't use the mt command instead?

EDIT to add - sorry, just re-read the bit where you said you can't do that. I'll have a look on a server we have here after meeting.

mph999

Original Poster:

2,780 posts

251 months

Wednesday 19th September 2018
quotequote all
Appreciate that .. I have no idea at the moment.