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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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 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.
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.