Sponsored Content
Top Forums UNIX for Dummies Questions & Answers passthrough devices vs. named devices Post 302202416 by Perderabo on Wednesday 4th of June 2008 09:13:48 PM
Old 06-04-2008
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.
 

10 More Discussions You Might Find Interesting

1. HP-UX

HP-UX 10.20 devices

Is it possible to create the CDROM device file for a drive attached to the parallel port? I have a removable CDROM drive (gift - I'm trying not to return it, but may have to anyways) that attaches via parallel port. The only device that I can attach to that hardware address is /dev/c1t0d0_lp, a... (9 Replies)
Discussion started by: LivinFree
9 Replies

2. UNIX for Dummies Questions & Answers

Unix devices

Hi I am trying to determine the access to unix devices. I found the follow access description which I have been told is a symbolic link and is not the actual file. I was also told that all symbolic links will have rwxrwxrwx access. kmem: lrwxrwxrwx 1 root 27 May 28 16:06 /dev/kmem ->... (2 Replies)
Discussion started by: GW01
2 Replies

3. UNIX for Dummies Questions & Answers

printing devices

I am new in unix, and I need to fix a printer, but I don't even know the difference between /dev/ttys printers and lp printers. Can someone explain this to me and tell me how I cancel jobs in both of them? I will appreciate it, thank you. (15 Replies)
Discussion started by: HN19
15 Replies

4. Red Hat

USB Devices

I am trying to get a flash card reader to work with my machine. My question is, are all of my USB ports screwed up? Do I need to buy a seperate USB controller? I does not appear that the onboard USB ports work. In trying to get it to work, I typed cat /proc/scsi/scsi and got this: # cat... (2 Replies)
Discussion started by: davidkretsch
2 Replies

5. Solaris

Meta Devices

I have added a sun storage array from a faiulty server onto a new server and copied the md.conf files etc. I can now access the /dev/md/dsk file systems, but I want to delete some metadevices that do not exist (it still thinks the 0 and 1 (root /var /export) disk are mirrored. How do I do this? (8 Replies)
Discussion started by: ozzmosiz
8 Replies

6. Solaris

what is /devices/pseudo/ ??

Hi all, what does this mean? if then <something> fi here is what i know.. it checks if the specified argument no($devid) in some function call is made into a block device and then proceeds with the execution of the loop. However am not understand what lofi@0:means? also is there... (3 Replies)
Discussion started by: wrapster
3 Replies

7. UNIX for Dummies Questions & Answers

/dev X /devices

Hi folks, I am trying to learn Unix based in Linux... In Linux, in /Dev are files related to cards, mouse, etc.. how about Unix? What is the difference between /Dev and /Devices? Thanks, Fernanda (0 Replies)
Discussion started by: ffpradella
0 Replies

8. HP-UX

list of devices

Hi, I need to rediracte all the names of the devices (only disks) to a file. Thanks:confused: (3 Replies)
Discussion started by: yoavbe
3 Replies

9. Programming

Raw devices in C

Hi guys. what is the benefits of using raw devices in programming? which applications mostly use raw devices? how can i use raw devices in C programs? is there any system calls or library functions? (1 Reply)
Discussion started by: majid.merkava
1 Replies

10. Red Hat

Raw Devices

Can you please modify my script. This script is not working for i in /dev/sdf do /bin/raw /dev/raw/`/bin/basename ${i}` ${i} /bin/sleep 2 /bin/chown orasm:ordba /dev/raw/`/bin/basename ${i}` /bin/chmod 660... (9 Replies)
Discussion started by: karthik9358
9 Replies
AMTAPE(8)						      System Manager's Manual							 AMTAPE(8)

NAME
amtape - user interface to Amanda tape changer controls SYNOPSIS
amtape config command [ command options ] DESCRIPTION
Amtape performs tape changer control operations. It uses the underlying tape changer script defined by the tpchanger option for a particu- lar Amanda configuration as specified by the config argument. Tape changers maintain a notion of the current and next slot for each configuration. These may or may not correspond to an actual physical state of the device, but do tend to minimize searching through the tape storage slots. If the desired tape is in the current slot, it is likely the next tape needed is in the next slot rather than at some random position in the storage slots. See the amanda(8) man page for more details about Amanda. COMMANDS
reset Reset the tape changer to a known state. The current slot is set to the first slot. Other device-specific side effects may occur. Some gravity stackers need to be reset to the top position by hand. This command notifies Amanda the stacker is back in that posi- tion. eject If a tape is loaded in the drive, it is ejected and returned to the slot from which it was loaded. clean If a cleaning tape is defined for the changer, it is used to clean the drive. show Show the contents of all slots. This can be slow. label label Search for and load the Amanda tape with label label. taper Perform the taper scan algorithm. Load the next tape in the configuration's tape sequence, or a fresh tape with a suitable label. device Display the name of the current tape device on stdout. current Display the current slot. update Update the changer label database, if it has one, to match the tapes now available. slot slot Eject any tape in the drive and put it away, then load the tape from slot slot and reset current. slot current Eject any tape in the drive and put it away, then load the tape from the current slot. slot prev Eject any tape in the drive and put it away, then load the tape from the previous slot and reset current. slot next Eject any tape in the drive and put it away, then load the tape from the next slot and reset current. slot first Eject any tape in the drive and put it away, then load the tape from the first slot and reset current. slot last Eject any tape in the drive and put it away, then load the tape from the last slot and reset current. slot advance Eject any tape in the drive and put it away. Advance current to the next tape, but do not load it. This is useful with non-gravity stackers to unload the last tape used and set up Amanda for the next run. If you just use eject, the current tape will be mounted again in the next run, where it will be rejected as being still in use, ejected and the next tape requested. Using slot next followed by eject does an unnecessary mount. Note: most changers optimize the slot commands to not eject the loaded tape if it is the one being requested. AUTHOR
James da Silva <jds@cs.umd.edu> University of Maryland, College Park SEE ALSO
amanda(8) AMTAPE(8)
All times are GMT -4. The time now is 04:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy