Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

Ioctls

Veena_mp
Occasional Contributor

Ioctls

I need to implement getting some of the device(sg/sd/ide/cciss) information in 2 methods. One using passthrough and an other using OS given info using the ioctls. In this regard I need the following info,

1. How do I issue a passthrough to a IDE/SATA device?

2. What ioctls can be used to get the WWID, serial no, capacity of devices not using the passthrough.
1 REPLY
Matti_Kurkela
Honored Contributor

Re: Ioctls

1.)
In Linux 2.6 kernel series, the current recommended way to get passthrough access for *any* SCSI-like device (including IDE ATAPI) is to use the SG_IO ioctl.

For more information, see:
http://sg.torque.net/sg/sg_io.html

When using a passthrough, you must be able to use & understand the "raw" protocol used by the device, so it would be necessary to read the relevant SCSI and IDE ATAPI standards documents too.

With hardware RAID devices it's probably RAID controller-specific. Besides, when a hardware RAID is involved, something that looks like a single disk might actually be a collection of several physical disks - so a "serial number" of such a disk is likely to be generated by the RAID controller, and not necessarily related to the real serial number of any piece of hardware.

2.)
If the device is not a FibreChannel device or a modern SCSI device, the WWID may simply not exist.

The HDIO_ ioctls might be useful. For more documentation, get a copy of Linux kernel sources, then read linux-/Documentation/ioctl/hdio.txt file in the source package.

MK
MK