How to get the SCSI identifier by scsi_id command?

1

I never want to change the SCSI disk's name(/dev/sd*) even if the one of disks has been removed.
Good article I found on Internet says that "Use the scsi_id command to get the unique SCSI identifier,then make a udev_rule file"

but scsi_id returns no answer in our all redhat5.3 boxes.

--Reproduce--

# ls -l /dev/disk/by-id  | grep sdf
lrwxrwxrwx 1 root root  9 Aug 17 14:44 scsi-36000c291b99c1fbbf4dfadd25b36644b -> ../../sdf

#/sbin/scsi_id -g /dev/sdf   --> NO answer
#/lib/udev/scsi_id -g /dev/sdf --> NO answer

--Put disk.enableUUID parameter to the VMware vmx file, then reboot.
Nothing changed.

--Added options=-g parameter to /etc/scsi_id.config, then reboot.
Nothing changed.

--Our context
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
kernel 2.6.18-128.el5
iscsi-initiator-utils-6.2.0.872-16.el5

How can I get the SCSI identifier by scsi_id command?

delorean924

Posted 2017-09-01T00:30:07.033

Reputation: 23

Answers

1

FYI
Resolved by myself as following.

#/sbin/scsi_id -g -s /block/sdf
36000c291b99c1fbbf4dfadd25b36644b

-s option means:
Device files are put on under /sys virtual filesystem since kernel 2.6.
'-s' option force the scici_id to search under /sys directory.

-g :
Perhaps security reason, NO output allowed without this option.

delorean924

Posted 2017-09-01T00:30:07.033

Reputation: 23

1Can you explain what the options mean? Do not respond in comments; [edit] your answer to make it clearer and more complete. – Scott – 2017-09-01T05:18:21.717