SCSI_INQUIRY(sg_inq) command is not working on RHEL 6.3 for partition disk
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
SCSI_INQUIRY(sg_inq) command is not working on RHEL 6.3 for partition disk
Hi,
I have presented 3Par/EVA Luns into RHEL 6.3 and partitioned(one partition) the disk. Then tried sg_inq command on whole disk as well as partition disk. The command failed for partition disk.
I tried same thing ON RHEL 6.1 and RHEL 6.2. The command worked fine for both whole disk and partition disk.
I can confirm from testing on my systems just now that on pre RHEL6.3 running sg_inq on both the disk and a partition of the disk was giving output. However it is the SAME output in both cases (that is you don't get any more from the partition than you did from the disk itself).
Starting with RHEL6.3 running the newer version of sg3_utils (1.28-4) I can also confirm it is NOT giving the output on the partition but is on the disk itself. Also there is a newer version of sg3_utils (1.28-5) in the repositories and updating to that, one still sees it no longer gives the output on the partition.
As the prior poster suggests it probably was never correct for sg_inq to give output on the partition since it is querying the disk's parameters and never giving specifics for the partition anyway. It may be that RedHat "fixed" this silently as I I couldn't find where this got changed but clearly it did get changed.
It likely wasn't RH that made the change, but the upstream project because the package "sg3_utils" runs on more than just Linux (FreeBSD, Solaris, Tru64 and Windows 2000 and later).
It is NOT a bug but is a change. The tool is to query "disks" not "partitions". As noted above it probably never should have allowed partitions as input and it appears that got silently changed. The output it gave for the "partition" was exactly the same as it gave for the entire "disk" so there is no reason to run it on "partitions" in the first place.
I don't claim that it's problem of tool, but a direct SCSI command built by a program fails as well. INQUIRY command must be supported by disk paths and partitions in order to identify that they relate to the same LUN.
e.g.
For the full disk:
brw-r----- 1 root disk 8, 0 Oct 21 12:02 /dev/sda < Major 8, Minor 0 = first disk
For the partitions:
brw-r----- 1 root disk 8, 1 Oct 21 16:03 /dev/sda1 < Same major, incremented minor 1 = first partition on first disk
brw-r----- 1 root disk 8, 2 Oct 21 12:02 /dev/sda2 < Same major, re-incremented minor 2 = second partition on first disk.
If you have a tool such as Oracle ASM that is renaming things they'll still have the same major/minor as they would before renaming.
You can also get details about paritions with fdisk or parted or by examining things in /sys/class/scsi_host.
The command this thread was started for is specifically to do get sg scsi information on whole disks - not to relate partitions to them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.