mounting a SCSI generic device

mounting a SCSI generic device

Post by Daniel D. Barbe » Wed, 18 Feb 1998 04:00:00

I really feel like this should be simple, but I haven't been able to
find an answer anywhere.

My system sees the scsi card and the CD-RW upon boot up.  
cat /proc/devices tells me:

Character Devices:
yada    yada
yada    yada
21      sg

Block Devices:
yada    yada
yada    yada

So, my machine is telling me it's there, and should be /dev/sg0, but I
cannot figure out how to actually mount the damn thing.  I assumed
(wrongly it seems) that it would be mounted as are all the other
devices, but a command of:

mount -t iso9660 /dev/sg0 /cdrw  does not work.

Is there a different syntax or procedure for character devices, or just
scsi?  Any help would be appreciated


Dan Barber
Applications and Utilities... for newer linux users.


1. How to get SCSI-Host nr from generic SCSI device?

can any SCSI-Expert out there help me?
All I want to do is finding to a specific generic device its host,id,lun
and channel.

I found the SCSI_IOCTL_GET_IDLUN very helpful, but this does not output
the least not in a format I understand it.

Here is my simple test-programm:

#include <stdio.h>
#include <scsi/scsi.h>

struct  sg_id {
                long    l1; /* target | lun << 8 | channel << 16 | low_ino << 24
                long    l2; /* Unique id */

main() {
int fd;

        fd = open ("/dev/sg0",2);
        ioctl(fd, SCSI_IOCTL_GET_IDLUN, &sg_id);

        printf("l1: 0x%lX l2: 0x%lX\n", sg_id.l1, sg_id.l2);


When I run it I get:

l1: 0x7000000 l2: 0x0

Fine..this means my device /dev/sg0 is ID 0, Lun 0, Channel 0. Very good
so far...but what does the "low_ino" of 0x07 mean?
Is there a way to conclude from the 0x07 to Host 0?

I have run this programm for different devices on linux (all 2.0.x) with
more than one controllers:

-> For different controllers the low_ino changes, with seems to be fine, but
I still dont know which low_ino corresponds to which host!

Thanx for any answer,


  ___ ___              
 /   |   \  ___________   | REAL   : Thomas Niederreiter: Munich, Germany  

\    Y    (  <_> )  | \/  | MUD/IRC: Hor/_Hor  
 \___|_  / \____/|__|     |
       \/ All I want is a warm bed and a kind word and unlimited power        
                      -- Ashleigh Brilliant

2. hp tr4 density code for compression?

3. How to recognize SCSI CD-ROM as a "Generic SCSI" device?

4. LILO: doesn't have a valid LILO signature

5. IDE Generic SCSI devices (emulated)

6. Desparation: Linux & Win Networking - ping doesn't work

7. Solaris 8 uscsi does not work with /dev/sg device (SCSI generic)

8. Installation of Linux 5.1 on 32 Bit ATA -33 Controller and Drive

9. SCO OpenServer 5 Generic SCSI device Query.

10. generic SCSI for ATAPI devices

11. Generic SCSI devices

12. Generic SCSI Driver/device access USCSI.

13. Generic SCSI device drivers