The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Meta Devices ozzmosiz SUN Solaris 8 05-16-2005 08:43 PM
USB Devices davidkretsch Linux 2 02-21-2005 03:32 PM
printing devices HN19 UNIX for Dummies Questions & Answers 15 12-23-2003 06:54 PM
Devices in Unix derekc132002 UNIX for Dummies Questions & Answers 1 11-06-2002 08:52 AM
HP-UX 10.20 devices LivinFree HP-UX 9 02-05-2002 03:02 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-04-2008
Supporter
 

Join Date: Feb 2005
Posts: 49
passthrough devices vs. named devices

I am having trouble understanding the difference between a passthrough device and a named device and when you would use one or the other to access equipment.

As an example, we have a tape library and giving the command
"camcontrol devlist" gives the following output:

akx[22]# camcontrol devlist
<SPECTRA 215 1014> at scbus3 target 3 lun 0 (pass4,ch0)
<SONY SDX-300C 04c7> at scbus3 target 8 lun 0 (pass5,sa0)

The SPECTRA 215 is the tape library the SONY SDX is the tape drive in the library.
To address the tape library a command such as "mtx -f /dev/pass4 command" is used, however to address the tape unit then /dev/sa0 would be used as in
"/sbin/dump -0uaf /dev/sa0 /dev/da4s1e".

Could someone give me a clue on when you address a passthrough device and when you address a named device, or at point me to some documentation that might clear this up?

Thanks
Thumper
Reply With Quote
Forum Sponsor
  #2  
Old 06-04-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
They are both the same type of objects. I don't know what os you're using so I talk talk specificly to that. But imagine a version of unix with device files like /dev/mt0 to talk to a tape drive. Any device file has a major and a minor number. The major number identifies which driver is being used. The minor number is passed to the driver for its use. It the case of a typical mt driver, it ids the particular tape drive. So you can open /dev/mt0 and read or write to the tape drive via it. You can also invoke the ioctl system call for special purposes like rewinding the tape. This is the typical type a tape driver that existed for years and it is what you call a "named device".

Now someone invents a new type of tape drive that can hold 5 tapes. How to control that? The mt ioctl doesn't handle stuff like that. Well one answer is to redefine the rewind or the unload command to now mean "go to the next tape". A lot of juke box style drives do just that and call it stacker mode. But we want something more... we want to just jump to tape number 4 (as an example) regardless of where we were. The tape drive can do that but the mt driver doesn't have a way to send the right command. All we need is some quick a dirty way to send a particular scsi command to the tape drive. This is where the pass-though driver comes in. It does not know it is controlling a tape drive. But you can give it a scsi command and it can send it to the device. And it can even return a status code. But that is it. It just passes simple commands to a device. Now a real smart program figures out what scsi command is needed to jump to tape number 4, it uses the pass though driver to send it, and it gets a status code back. So now we are using a secondary driver to access extra device features that the primary driver can't control.

But the pass through device is a special file too with a major and minor number. You don't use it to tranfer large blocks of data though. Just special commands.

In this case both special files referred to the same device. But often there will be a collection of tape drives in a juke box with a single pass-though device for the box itself.

We would use the mt driver where we can. And we use the pass-though driver only when we must. Drivers like mt have a man page that describes which ioctl command it can do. Pass though drivers usually have sparse man pages because you can't document all possible scsi commands.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0