7 Replies Latest reply: Oct 17, 2012 3:47 PM by michael.stone RSS

    scsi_id is not returning ID

    783262
      Hello,
      I try to configure some persistent storage using a tutorial. In this tutorial I am instructed to get an ID for a partition like this:
      *#scsi_id -g -s /block/sdg/sdg1*
      The command above doesn't return anything, but
      *#scsi_id -g -s /block/sdg*
      does (so I can obtain an ID fo the disk but not for the partition).

      Now I have to create a rule in /etc/udev/rules.d/ using the id using the ID:
      KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -s %p", RESULT=="14f504e46494c450073564b3158472d7943766d2d4c736459" , NAME="ocrdisk01", OWNER="root", GROUP="oinstall", MODE="0640"
      but I don't know what to do. I'm only having the disk ID but the tutorial refers to a partition on that disk.

      What should I do?
      Thanks

      P.S.
      I use OpenFiler and iSCSI.
      I've added options=-g in */etc/scsi_id.config*.
      The system is OEL5
      /block/sdg/sdg1 exists

      Edited by: Adrian P on May 4, 2012 5:08 AM
        • 1. Re: scsi_id is not returning ID
          Catch-22
          1. Find the device name:

          <pre>
          fdisk -l

          Determine the disk name, which probably doesn't have a valid partition table
          e.g. /dev/sdb
          </pre>

          </pre>

          2. Create a partition:

          <pre>
          fdisk /dev/sdb

          Press n Return, e Return, 1 Return, Return, Return, w Return
          to create a new primary partition

          Verify:
          fdisk /dev/sdb
          </pre>

          3. Create a filesystem on the new partition:

          <pre>
          mke2fs -j /dev/sdb1
          </pre>

          4. Get the UUID:

          <pre>
          blkid
          </pre>
          • 2. Re: scsi_id is not returning ID
            783262
            It looks a little different from what I've expected.

            Forgot to say, but the partition is already made.
            I don't need an ext2 filesystem on that partition. Probably it will be OCFS later in the tutorial.
            I can't use the method described in tutorial since +/sbin/scsi_id -g -s+ doesn't return anything for +/block/sdg/sdg1+:
            KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -s %p", RESULT=="14f504e46494c450073564b3158472d7943766d2d4c736459" , NAME="ocrdisk01", OWNER="root", GROUP="oinstall", MODE="0640"

            Edited by: Adrian P on May 4, 2012 5:09 AM
            • 3. Re: scsi_id is not returning ID
              Catch-22
              Is the disk a real disk or a virtual disk?
              • 4. Re: scsi_id is not returning ID
                783262
                All the system is created using VirtualBox, including OpenFiler, so all the disks are virtual.
                • 5. Re: scsi_id is not returning ID
                  Catch-22
                  That might be the issue. What is the reason for OpenFiler and iSCSI in Virtualbox? Is VirtualBox part of the tutorial?

                  Are the virtual disks connected to a SATA or SCSI controller? For what it's worth, under Virtualbox, scsi_id does not provide information if you query a disk connected to a virtual SCSI controller, but it does when using a SATA controller:

                  # scsi_id -g -s /block/sdb/sdb1
                  SATA VBOX HARDDISK VB1ad3d086-22cda9aa
                  • 6. Re: scsi_id is not returning ID
                    783262
                    The controller is SATA. Anyway, I was expecting an ID like:
                    14f504e46494c450073564b3158472d7943766d2d4c736459
                    not like:
                    SATA VBOX HARDDISK VB1ad3d086-22cda9aa

                    I used another method to make the iSCSI drives persistent.

                    #iscsiadm -m discovery -t sendtargets -p 192.168.22.21
                    192.168.22.21:3260,1 iqn.2006-01.com.openfiler:gridvolumes

                    #iscsiadm -m node -T iqn.2006-01.com.openfiler:gridvolumes -p 192.168.22.21 --login
                    Logging in to [iface: default, target: iqn.2006-01.com.openfiler:gridvolumes, portal: 192.168.22.21,3260] (multiple)
                    Login to [iface: default, target: iqn.2006-01.com.openfiler:gridvolumes, portal: 192.168.22.21,3260] successful.

                    #iscsiadm -m node -T iqn.2006-01.com.openfiler:gridvolumes -p 192.168.22.21 --op update -n node.startup -v automatic

                    #vi /etc/udev/rules.d/55-openiscsi.rules
                    KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"

                    By default iscsidev.sh doesn't exist but you can find it with google.

                    #service iscsi stop

                    #service iscsi start

                    #[root@node1 scripts]# ls -l /dev/iscsi/
                    total 0
                    drwxr-xr-x 2 root root 60 May 14 06:27 openfiler:gridvolumes

                    #fdisk /dev/iscsi/openfiler\:gridvolumes/part

                    #mkfs.ext3 -b 4096 /dev/iscsi/openfiler\:gridvolumes/part1

                    #mount /dev/iscsi/openfiler\:gridvolumes/part1 /adi/test
                    • 7. Re: scsi_id is not returning ID
                      michael.stone
                      This is a little late, but I ran across this note when I encountered the same issue on RHEL5. I discovered the answer is that the rule needs to be changed from this:

                      KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29ad7fde4baa7b69a723c14447a", NAME="oracle/ASM_DATA01", OWNER="oracle", GROUP="dba", MODE="0660"

                      To this:

                      KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$parent", RESULT=="36000c29ad7fde4baa7b69a723c14447a", NAME="oracle/ASM_DATA01", OWNER="oracle", GROUP="dba", MODE="0660"