Tool to scan SCSI bus

Tool to scan SCSI bus

Post by Michael Sticklin » Sat, 03 Mar 2001 18:24:57



Hi,

does anybody knows a tool to scan the SCSI-Adapters and list the installed
devices on it? The lsdev - command is only looking in the Database, and
shows the configured devices.

Many Thanks

Michael Stickling

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

Tool to scan SCSI bus

Post by J.Smit » Sat, 03 Mar 2001 21:19:59


Maybe 'diag' ?


Quote:> Hi,

> does anybody knows a tool to scan the SCSI-Adapters and list the installed
> devices on it? The lsdev - command is only looking in the Database, and
> shows the configured devices.

> Many Thanks

> Michael Stickling

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


 
 
 

Tool to scan SCSI bus

Post by Arne Soda » Sat, 03 Mar 2001 22:16:24


You just have to trust the 'lsdev' command. The command 'cfgmgr' scans all the
devices and gives you a picture of the devices. Look at the 'lsdev' examples
below:


hdisk0 Available 04-B0-00-0,0  Other SCSI Disk Drive
hdisk1 Available 04-B0-00-1,0  16 Bit SCSI Disk Drive
hdisk2 Defined   04-B0-00-2,0  16 Bit SCSI Disk Drive
cd0    Available 04-B0-00-3,0  SCSI Multimedia CD-ROM Drive
rmt0   Available 04-B0-00-5,0  Other SCSI Tape Drive
hdisk3 Available 04-02-00-0,0  Other SCSI Disk Drive
hdisk4 Available 04-02-00-4,0  4.5 GB 16 Bit Differential SCSI Disk Drive
hdisk5 Available 04-02-00-12,0 4.5 GB 16 Bit Differential SCSI Disk Drive
rmt1   Available 04-02-00-14,0 Differential SCSI 1/4-Inch Tape Drive


hdisk0 Available 04-B0-00-0,0  Other SCSI Disk Drive
hdisk1 Available 04-B0-00-1,0  16 Bit SCSI Disk Drive
cd0    Available 04-B0-00-3,0  SCSI Multimedia CD-ROM Drive
rmt0   Available 04-B0-00-5,0  Other SCSI Tape Drive
hdisk3 Available 04-02-00-0,0  Other SCSI Disk Drive
hdisk4 Available 04-02-00-4,0  4.5 GB 16 Bit Differential SCSI Disk Drive
hdisk5 Available 04-02-00-12,0 4.5 GB 16 Bit Differential SCSI Disk Drive
rmt1   Available 04-02-00-14,0 Differential SCSI 1/4-Inch Tape Drive

Arne S
Norway


> Hi,

> does anybody knows a tool to scan the SCSI-Adapters and list the installed
> devices on it? The lsdev - command is only looking in the Database, and
> shows the configured devices.

> Many Thanks

> Michael Stickling

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

Tool to scan SCSI bus

Post by sp2 admi » Sat, 03 Mar 2001 22:45:41


you *could* use cfgmgr to do this... but that would require running
cfgmgr, and i dont know if you would want to do so or not...
ie: cfgmgr -l scsi0 -v
would scan everything on scsi0 and report on each part it does...

> You just have to trust the 'lsdev' command. The command 'cfgmgr' scans all the
> devices and gives you a picture of the devices. Look at the 'lsdev' examples
> below:

> hdisk0 Available 04-B0-00-0,0  Other SCSI Disk Drive
> hdisk1 Available 04-B0-00-1,0  16 Bit SCSI Disk Drive
> hdisk2 Defined   04-B0-00-2,0  16 Bit SCSI Disk Drive
> cd0    Available 04-B0-00-3,0  SCSI Multimedia CD-ROM Drive
> rmt0   Available 04-B0-00-5,0  Other SCSI Tape Drive
> hdisk3 Available 04-02-00-0,0  Other SCSI Disk Drive
> hdisk4 Available 04-02-00-4,0  4.5 GB 16 Bit Differential SCSI Disk Drive
> hdisk5 Available 04-02-00-12,0 4.5 GB 16 Bit Differential SCSI Disk Drive
> rmt1   Available 04-02-00-14,0 Differential SCSI 1/4-Inch Tape Drive

> hdisk0 Available 04-B0-00-0,0  Other SCSI Disk Drive
> hdisk1 Available 04-B0-00-1,0  16 Bit SCSI Disk Drive
> cd0    Available 04-B0-00-3,0  SCSI Multimedia CD-ROM Drive
> rmt0   Available 04-B0-00-5,0  Other SCSI Tape Drive
> hdisk3 Available 04-02-00-0,0  Other SCSI Disk Drive
> hdisk4 Available 04-02-00-4,0  4.5 GB 16 Bit Differential SCSI Disk Drive
> hdisk5 Available 04-02-00-12,0 4.5 GB 16 Bit Differential SCSI Disk Drive
> rmt1   Available 04-02-00-14,0 Differential SCSI 1/4-Inch Tape Drive
> Arne S
> Norway

>> Hi,

>> does anybody knows a tool to scan the SCSI-Adapters and list the installed
>> devices on it? The lsdev - command is only looking in the Database, and
>> shows the configured devices.

>> Many Thanks

>> Michael Stickling

>> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

Tool to scan SCSI bus

Post by Michael Sticklin » Sun, 04 Mar 2001 01:59:31


Hi again,

Thanx for the tipp's, but they did not shows everything at the busses. What
i need is a tool to scan the scsi-bus and tells me things like the vendor or
product id's.
Lsdev reeds only the configuration from the ODM and cfgmgr also with
parameters brings not the information i need. I.e. cfgmgr does not shows
harddrives or Jukebox devices.

Is there any tool to send scsi-commands directly to the scsi-cards to read
the informations?

Thanx
Michael Stickling



Quote:> Hi,

> does anybody knows a tool to scan the SCSI-Adapters and list the installed
> devices on it? The lsdev - command is only looking in the Database, and
> shows the configured devices.

> Many Thanks

> Michael Stickling

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 
 
 

Tool to scan SCSI bus

Post by Jens-Uwe Mag » Sun, 04 Mar 2001 07:00:28



>does anybody knows a tool to scan the SCSI-Adapters and list the installed
>devices on it? The lsdev - command is only looking in the Database, and
>shows the configured devices.

I use the following small utility for that:

inquire.c:
-----------------------------------------------------------------------
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/scsi.h>

#define LUN     0
char scsibus[] = "/dev/scsi0";

main(argc, argv)
int argc;
char **argv;
{
        int fd;
        struct sc_inquiry si;
        u_char buf[255];
        int target;
        int isbusy;
        char *bus = scsibus;

        if (argc > 1)
                bus = argv[1];
        if ((fd = open(bus, O_RDWR)) == -1)
                errxit(bus);
        for (target = 0; target < 7; target++) {
                printf("Target %d:\n", target);
                if (ioctl(fd, SCIOSTART, IDLUN(target, LUN)) == -1) {
                        if (errno == EINVAL) {
                                printf("is in use\n");
                                isbusy = 1;
                        } else
                                errxit("SCIOSTART");
                } else
                        isbusy = 0;
                bzero(&si, sizeof(si));
                si.scsi_id = target;
                si.lun_id = LUN;
                si.inquiry_len = 255;
                si.inquiry_ptr = buf;
                if (ioctl(fd, SCIOINQU, &si) == -1)
                        printf("SCIOINQU: %s\n", strerror(errno));
                else {
                        dump(si.inquiry_ptr, si.inquiry_len);
                }
                if (!isbusy && ioctl(fd, SCIOSTOP, IDLUN(target, LUN)) == -1)
                        errxit("SCIOSTOP");
        }

Quote:}

errxit(s)
char *s;
{
        perror(s);
        exit(1);

Quote:}

dump.c
-----------------------------------------------------------------------
#include <stdio.h>
#include <ctype.h>
#define LLEN    16

void
dump(p, count)
unsigned char *p;
int count;
{
        register unsigned char *l;
        unsigned char *ol;
        register int    i, amount;
        register int    same = -1;

        for (l = p; count > 0; l += amount) {
                amount = count > LLEN ? LLEN : count;
                count -= amount;
                if (same != -1 && count && !memcmp(l, ol, LLEN)) {
                        if (!same++)
                                printf("*\n");
                        continue;
                } else {
                        same = 0;
                        ol = l;
                }
                printf("%.8lx: ", l - p);
                for (i = 0; i < amount; i++) {
                        register int c = l[i];
                        printf("%02x ", c);
                        if ((i & 3) == 3)
                                printf(" ");
                }
                while (i < LLEN) {
                        printf("   ");
                        if ((i & 3) == 3)
                                printf(" ");
                        i++;
                }
                printf(" ");
                for (i = 0; i < amount; i++)
                        printf("%c", isprint(l[i]) ? l[i] : '.');
                printf("\n");
        }

Quote:}

--
Jens-Uwe Mager  <pgp-mailto:62CFDB25>
 
 
 

Tool to scan SCSI bus

Post by Arne Soda » Mon, 05 Mar 2001 07:55:48


Try 'lscfg -v' for all devices and 'lcsfg -vl <device-name>' for part. device
name ('eg. lscfg -vl hdisk0')

Arne S


> Hi again,

> Thanx for the tipp's, but they did not shows everything at the busses. What
> i need is a tool to scan the scsi-bus and tells me things like the vendor or
> product id's.
> Lsdev reeds only the configuration from the ODM and cfgmgr also with
> parameters brings not the information i need. I.e. cfgmgr does not shows
> harddrives or Jukebox devices.

> Is there any tool to send scsi-commands directly to the scsi-cards to read
> the informations?

> Thanx
> Michael Stickling



> > Hi,

> > does anybody knows a tool to scan the SCSI-Adapters and list the installed
> > devices on it? The lsdev - command is only looking in the Database, and
> > shows the configured devices.

> > Many Thanks

> > Michael Stickling

> > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> > -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

1. xcdroast installation results in: "Failed to scan the SCSI-bus"

I'm trying to enable the CD-RW device on my system. I get this when
executing "xcdroast" on RH7.1:

"Failed to scan the SCSI-bus. Either no permission to access the generic
scsi devices or no SCSI support enabled in the kernel. For ATAPI devices
you have to install the SCSI-emulation first. Please see the
CD-Writing-HOWTO ..."

I have the /dev/sg1,2... devices with permissions set per
"CD-Writing-HOWTO" (cwr------- root root ... /dev/sg1). So, I need a
clue. How do I know SCSI support or the SCSI-emulation is present? Is a
modern CD unit an ATAPI device?

2. QIC-W 3080 Tape Drive, How To?

3. "scanning scsi bus" hang

4. HP Monitor

5. Re-scan SCSI bus?

6. java binary support

7. Crash Install: Scanning the scsi bus..."

8. IBM AIX for PS/2 PC's

9. Scanning SCSI Bus (Eureka!!)

10. Scan SCSI-Bus manually?

11. Re-scan SCSI-Bus

12. Scanning SCSI Bus...

13. scsi disk shows in bus scan, but no device