Forum Discussion

thahif's avatar
thahif
Level 3
14 years ago
Solved

sg build

Hello,

 

I want to know why sgbuild is done on solaris machine before drive configuration.

Also why this is specifically for solaris OS not for any other unix flavours. Also can someone please explain what exactly sgbuild does from OS perspective.

 

Regards,

Thahif

 

  • On Solaris, NBU does not write to the drives (or any other os for that matter).  Write/ read /posutioning/ load/ unload are all done by the operating system (NBU asks the OS to do these things). The commands needed to do these things can be passed to the tape drives via the operating system device filr.eg /dev/rmt/0cbn.  For example,  commands such as mt -f <device file> fsf 1 (you see mtfsf / mtrew etc in bptm log).

    OK, now, when for example  a tape is loaded by the os for NBU to run say a backup, NBU needs to know when the drive is ready.  During the load, various scsi commands are sent to the drive, for example 'mode sense' and 'test unit ready'.

    These 'commands' cannot be sent dia the /dev/rmt/ files, they have to go via a special device file, hence the sg file.

     

    /dev/sg/xxx

    If we look in this dir. these files are just links to the raw device.

     

     

    root@womble  $ ls -al /dev/sg
    total 22
    drwxr-xr-x   2 root     root        2048 Mar  2 16:06 .
    drwxr-xr-x  24 root     sys         5120 Apr 20 09:58 ..
    lrwxrwxrwx   1 root     root          71 Mar  2 16:06 c0t5l0 -> ../../devices/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/scsi@2/sg@5,0:raw
    lrwxrwxrwx   1 root     root          71 Mar  2 16:06 c0t5l1 -> ../../devices/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/scsi@2/sg@5,1:raw
    lrwxrwxrwx   1 root     root          73 Mar  2 16:06 c1t5l0 -> ../../devices/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/scsi@2,1/sg@5,0:raw
    lrwxrwxrwx   1 root     root          73 Mar  2 16:06 c1t5l1 -> ../../devices/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/scsi@2,1/sg@5,1:raw
     
     
    When you run the sg build, using sg.conf and sg.links files, these /dev/sg files are created, lines are added to /etc/devlinks.conf and /kernel/drv/sg.conf.
     
    In a nutshell - it's partly down to the OS I think  - other Unixs do have passthru - it['s just that Solaris has the most complex passthrough driver build.
     
    Regards,
     
    Martin
     

     

     

2 Replies

  • On Solaris, NBU does not write to the drives (or any other os for that matter).  Write/ read /posutioning/ load/ unload are all done by the operating system (NBU asks the OS to do these things). The commands needed to do these things can be passed to the tape drives via the operating system device filr.eg /dev/rmt/0cbn.  For example,  commands such as mt -f <device file> fsf 1 (you see mtfsf / mtrew etc in bptm log).

    OK, now, when for example  a tape is loaded by the os for NBU to run say a backup, NBU needs to know when the drive is ready.  During the load, various scsi commands are sent to the drive, for example 'mode sense' and 'test unit ready'.

    These 'commands' cannot be sent dia the /dev/rmt/ files, they have to go via a special device file, hence the sg file.

     

    /dev/sg/xxx

    If we look in this dir. these files are just links to the raw device.

     

     

    root@womble  $ ls -al /dev/sg
    total 22
    drwxr-xr-x   2 root     root        2048 Mar  2 16:06 .
    drwxr-xr-x  24 root     sys         5120 Apr 20 09:58 ..
    lrwxrwxrwx   1 root     root          71 Mar  2 16:06 c0t5l0 -> ../../devices/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/scsi@2/sg@5,0:raw
    lrwxrwxrwx   1 root     root          71 Mar  2 16:06 c0t5l1 -> ../../devices/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/scsi@2/sg@5,1:raw
    lrwxrwxrwx   1 root     root          73 Mar  2 16:06 c1t5l0 -> ../../devices/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/scsi@2,1/sg@5,0:raw
    lrwxrwxrwx   1 root     root          73 Mar  2 16:06 c1t5l1 -> ../../devices/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/scsi@2,1/sg@5,1:raw
     
     
    When you run the sg build, using sg.conf and sg.links files, these /dev/sg files are created, lines are added to /etc/devlinks.conf and /kernel/drv/sg.conf.
     
    In a nutshell - it's partly down to the OS I think  - other Unixs do have passthru - it['s just that Solaris has the most complex passthrough driver build.
     
    Regards,
     
    Martin
     

     

     

  • to add, aix /ibm no longer needs passthru driver if using ibm library, and i think hp creares it automatically