LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-07-2009, 07:04 PM   #1
WojtekO
Member
 
Registered: May 2006
Distribution: CentOS 5
Posts: 47

Rep: Reputation: 15
Can't get tape drive status


Code:
[root@leda by-id]# mtx status
  Storage Changer /dev/sg5:1 Drives, 24 Slots ( 1 Import/Export )
Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = 000001L4
      Storage Element 1:Empty
      Storage Element 2:Full :VolumeTag=000002L4
      Storage Element 3:Full :VolumeTag=000003L4
      Storage Element 4:Full :VolumeTag=000004L4
      Storage Element 5:Full :VolumeTag=000005L4
      Storage Element 6:Full :VolumeTag=000006L4
      Storage Element 7:Full :VolumeTag=000007L4
      Storage Element 8:Full :VolumeTag=000008L4
      Storage Element 9:Full :VolumeTag=000009L4
      Storage Element 10:Full :VolumeTag=000010L4
      Storage Element 11:Empty
      Storage Element 12:Empty
      Storage Element 13:Empty
      Storage Element 14:Empty
      Storage Element 15:Empty
      Storage Element 16:Empty
      Storage Element 17:Empty
      Storage Element 18:Empty
      Storage Element 19:Empty
      Storage Element 20:Empty
      Storage Element 21:Empty
      Storage Element 22:Empty
      Storage Element 23:Empty
      Storage Element 24 IMPORT/EXPORT:Empty

[root@leda by-id]# mt -f /dev/st0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x46 (no translation).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN

[root@leda by-id]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x46 (no translation).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN

[root@leda by-id]# mt -f /dev/nst0 tell
/dev/nst0: Input/output error

[root@leda by-id]# mt -f /dev/st0 tell
/dev/st0: Input/output error


[root@leda by-id]# pwd
/dev/tape/by-id
[root@leda by-id]# ls
scsi-1IBM_3573-TL_00X2U78F8636_LL0  scsi-32001000e1111f393-nst
Tape 1 does contain some info as Amanda was able to use it.

I'd like to write my own script but it's not looking too well at the moment. I can't seem to be able to get a status of the tape loaded in drive0

I did try the rewind before but same results.

Any ideas?
 
Old 04-08-2009, 07:07 AM   #2
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
I don't understand.

Your `mt -f /dev/nst0 status` worked. The tell operation may just not be available for that drive. You should be able to read/write/access the tape just fine. Play with it a bit and see what does work. Things like fsf, rewind, status, should all work.
 
Old 04-08-2009, 07:57 PM   #3
WojtekO
Member
 
Registered: May 2006
Distribution: CentOS 5
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by choogendyk View Post
I don't understand.

Your `mt -f /dev/nst0 status` worked. The tell operation may just not be available for that drive. You should be able to read/write/access the tape just fine. Play with it a bit and see what does work. Things like fsf, rewind, status, should all work.
Code:
[root@leda by-id]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x46 (no translation).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN
Tape Block Size = 0 bytes

Shouldn't it give me me the total amount of bytes on that tape?
I'd like to know how many bytes are written on that tape to fed my script if it should continue writing or tell me to load the next tape.
 
Old 04-08-2009, 08:43 PM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Nope. Typically mt does not give that kind of information. You have to track it independently. Look at `man mt`. What you get may depend in some part on your drivers, but, typically, you will be able to tell where you are positioned in terms of file numbers (starting at 0). Doing `mt -f /dev/nst0 eod` will take you to the end of data on the tape. `mt -f /dev/nst0 status` will then tell you where that is in terms of file number.

Either your backup software or your own script tracks how much stuff you have put on the tape. When you get an end of tape failure, that item has to be re-written on the next tape. If you write in segments that aren't too large, then you don't waste too much in that process.

You haven't mentioned the type of tape drive or library, by the way.

The linux `man mt` gives, in part:

Quote:
status

Print status information about the tape unit. (If the density code is "no translation" in the status output, this does not affect working of the tape drive.)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Tar file to tape drive faster than dir/files to tape drive? Runge_Kutta Linux - General 2 03-11-2009 07:13 AM
How to find tape drive cleaning status? ksun Linux - Hardware 2 02-14-2009 09:44 AM
Tape Backups and How can i find out the Name (label) of the tape in the drive?? helptonewbie Linux - Newbie 2 10-27-2008 07:20 AM
Status from Tape units Thomas Wagner Linux - Newbie 1 09-09-2008 02:30 PM
Using a DDS5 tape drive to restore from a DDS3 backup tape. AndrewCAtWayofthebit Linux - Hardware 1 05-14-2006 09:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration