1829173 Members
2159 Online
109986 Solutions
New Discussion

Disk information

 
SOLVED
Go to solution
Sonison James
Frequent Advisor

Disk information

Hello,

I would like to know the following about all types of drives

1. Model Name
2. Manufacturer
3. Free space
4. Unmounted space

Also similar information for CD-ROMs. The information that diskinfo returns seems to be for SCSI only. An API to get the above would solve my problem, a command would also do, but GUI based applications won't be helpful.

Thanks and regards
SJ
12 REPLIES 12
K.Vijayaragavan.
Respected Contributor
Solution

Re: Disk information

Use commands,

diskinfo /dev/rdsk/cxtxdx
ioscan -kfnC disk
bdf
"Let us fine tune our knowledge together"
Michael Tully
Honored Contributor

Re: Disk information



# diskinfo /dev/rdsk/cxtydz (root access is required)
model size and manufacturer

# pvdisplay -v /dev/dsk/cxtydz
usage

Anyone for a Mutiny ?
T G Manikandan
Honored Contributor

Re: Disk information

#ioscan -fnC disk
#diskinfo

#bdf
Sonison James
Frequent Advisor

Re: Disk information

Hello,

Thanks for the information. However, I would like to know if the format that ioscan uses to display the information is a fixed format? For instance on the machine that I am using I get the following output in the description column for one disk:

HP 73.4GST373405LC

Can I assume that for any type of hard disk (non-HP for eg) the first four characters will be for the manufacturer, followed by size and model name?

Is there an API for the same?

Thanks and regards
Sonison James

K.Vijayaragavan.
Respected Contributor

Re: Disk information

In "HP 73.4G, ST373405LC "

HP is manufacturer.(hewlett packard)
ST is manufacturer. (segate)

73.4G is size

373405 is size

Rest all you can find from the diskinfo command only.

If you have ignite installed in your system,

print_manifest command also gives detailed information.

"Let us fine tune our knowledge together"
Zeev Schultz
Honored Contributor

Re: Disk information

Ok,as to API can use the usual /usr/include/sys/scsi.h & ioctl.h.
Do an ioctl call on disk device with SIOC_INQUIRY like in this example:

#include
#include
#include
#include
#include
#include

int main(int argc,char *argv[])
{
struct inquiry inquiry;
char *dev;
int fd;
if (argc != 2)
{
fprintf(stderr, "Usage: %s \n", argv[0]);
exit(1);
}
if (argc == 2)
dev=argv[1];
/* open the device */
if ((fd=open(dev,O_RDONLY))<0)
{
perror("open failed");
exit(errno);
}

if ((ioctl(fd,SIOC_INQUIRY,&inquiry))<0)
{
perror("ioctl(SIOC_INQUIRY) failed");
exit(errno);
}
printf("\nVendor ID = %s\n",inquiry.vendor_id);
printf("Product ID=%s\n",inquiry.product_id);
printf("Vendor Spec=%s\n",inquiry.vendor_spec);
printf("Rev Number=%s\n",inquiry.rev_num);
exit(0) ;
}

It comes from somewhere on ITRC btw,I think it was posted by Robin Wakefiled (so there goes the credit :))

So computers don't think yet. At least not chess computers. - Seymour Cray
Sonison James
Frequent Advisor

Re: Disk information

Hello,

Vijay thanks for the clarification. Zeev (Robin & Nikhil :) ) thanks for the API, it was really helpful. However, I would like to know if there is something similar for devices that are not SCSI?

Thanks and regards
SJ
Zeev Schultz
Honored Contributor

Re: Disk information

SJ,
I don't think that diskinfo on IDE devices
wouldn't return info.I remember doing it on
CDROMs in B-2000 workstations (which come with
IDE cdroms).And I think there should be /usr/include/sys/ide.h or ata.h that can be used in simmilar manner.
What other devices you mean?

Zeev
So computers don't think yet. At least not chess computers. - Seymour Cray
Caesar_3
Esteemed Contributor

Re: Disk information

Hello!

The diskinfo will return info about
the ide,
i try it on ide cdrom on b2000 and it's worked

Caesar
Sonison James
Frequent Advisor

Re: Disk information

Hello,

Unfortunately I do not have /usr/include/sys/ide.h and ata.h

The man page on diskinfo said that it would return info for SCSI devices only, so just wanted to confirm if I could use it for IDE also. Thanks for the help

Thanks and regards
Sonison James
Michael Tully
Honored Contributor

Re: Disk information

None of the series 800 systems carry any IDE type of hardware in any case. All peripherals such as internal disks, CDROMS and internal/external tape drives are on some sort of SCSI chain.

Running an 'ioscan -fn' will report *all* attached hardware.
Anyone for a Mutiny ?
twang
Honored Contributor

Re: Disk information

It is simple to use "print_manifest" to find out information of every parts such as model, hardware path, of course you can find such info regarding disk. But ignite-ux must be installed.