LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 06-27-2005, 10:53 AM   #1
tornatom
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Rep: Reputation: 0
Question SCSI device drivers for tape drives


I am trying to gain acces to a SCSI tape drive on a Redhat v3 linux computer. My goal is to gain access to the drive through the scsi generic(sg) driver. I have gained acces with the scsi tape(st) driver. I am suppose to write C++ code that accesses the driver though the scsi pass through interface.

The tape drive gets attached to /dev/st0 and when i run my program that uses the sg driver, when i open() the device it opens the st0 but it doesnt allow me to use any of the sg functions. How do i make the tape drive become attached to /dev/sg0 or any of those device files so that i can use the sg driver?

is it even possible to use the sg driver on linux to controll the tape drive?

is there a function with the st driver that allows my to write to the tape in C++?

thanks
 
Old 06-27-2005, 02:37 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,985

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
You can access the tape drive using the regular data file open/read/write/close functions.
 
Old 06-27-2005, 05:45 PM   #3
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
Generally when you load the sg driver it tells you what is attached to what, you can see that output via dmesg. As for determining which sg device is attached to it at runtime, I couldn't tell you. You'll probably have to go through each one and feed it some inquiry command and see what type of device it is.

Code:
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
Attached scsi generic sg1 at scsi0, channel 0, id 1, lun 0,  type 0
Attached scsi generic sg2 at scsi0, channel 0, id 2, lun 0,  type 0
Attached scsi generic sg3 at scsi0, channel 0, id 3, lun 0,  type 0
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
RHEL load with SCSI drives - NO DRIVERS rwo_linux Red Hat 3 01-12-2005 06:27 PM
SCSI Tape - No such device- debian woody kimc Linux - Hardware 3 09-20-2004 08:26 AM
SCSI tape device detected but no response on st0 tungaw2001 Linux - Hardware 0 08-13-2003 01:15 AM
SCSI Tape Device Append Issue sbctec Linux - Hardware 3 05-05-2003 05:28 PM
Figuring out what SCSI device my tape drive is on chrisk5527 Linux - General 1 12-24-2002 03:37 PM


All times are GMT -5. The time now is 02:02 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration