On Thu, Mar 30, 2017 at 10:25:18AM +0200, Bruno Flueckiger wrote:
> > how to query scsi id or wwn for a scsi disk in OpenBSD? I'd like to get this
> > info and extend installer to provide more info about disks (because 
> > currently
> > it's imposible to distinguish between scsi disks if they are same size and
> > originate from same iscsi target and passed to OpenBSD via qemu-kvm).
> > 
> > So what's OpenBSD equivalent scsi query for Linux commands?
> > 
> > # lsscsi -iws | tail -n1
> > [6:0:0:10]   disk    0x6006048c8f0ff1a5c7ef85c8d1c95  /dev/sdd   
> > 36006048c8f0ff1a5c7ef85c8d1c95481  16.1GB
> > 
> > # /usr/lib/udev/scsi_id -xg /dev/sdd
> > ID_SCSI=1
> > ID_VENDOR=EMC
> > ID_VENDOR_ENC=EMC\x20\x20\x20\x20\x20
> > ID_MODEL=Celerra
> > ID_MODEL_ENC=Celerra\x20\x20\x20\x20\x20\x20\x20\x20\x20
> > ID_REVISION=0002
> > ID_TYPE=disk
> > ID_SERIAL=36006048c8f0ff1a5c7ef85c8d1c95481
> > ID_SERIAL_SHORT=6006048c8f0ff1a5c7ef85c8d1c95481
> > ID_WWN=0x6006048c8f0ff1a5
> > ID_WWN_VENDOR_EXTENSION=0xc7ef85c8d1c95481
> > ID_WWN_WITH_EXTENSION=0x6006048c8f0ff1a5c7ef85c8d1c95481
> > ID_SCSI_SERIAL=EMC-Celerra-iSCSI-VLU-fs179_T5_LUN10_CKM00120100230
> 
> $ dmesg | grep scsi
> 
> sd1 at scsibus2 targ 0 lun 0: <SYNOLOGY, iSCSI Storage, 3.1> SCSI3
> 0/direct fixed naa.6001405635870b3d9e95d40c9d9221d1
> sd2 at scsibus2 targ 0 lun 1: <SYNOLOGY, iSCSI Storage, 3.1> SCSI3
> 0/direct fixed naa.6001405dcc70b1dd909ed44f8db0d6d6

 disklabel sd1 | grep label

For sd1 and sd2 please. This is what is printed in installer. See diskinfo()
in src/distrib/miniroot/install.sub

If it does print just 'iSCSI Storage 3.1' then this is not very
useful info in the installer (although one can break and investigate dmesg)

So maybe disklabel should have better 'label' or we could print more info
directly in the installer.

I'm also not sure sysctl hw.disknames output is best one, it does show duid
which is OpenBSD specific (compare disklabel with and without '-d').

It seems there's no good solution fitting all cases (softraid, usb disks,
both are scsi-like devices).

j.

Reply via email to