On Thu, Mar 30, 2017 at 04:04:51AM -0400, Jiri B wrote: > Hi, > > 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). > > Currently OpenBSD does show for such SCSI disk something like (taken from > disklabel): > > ... > Which disk is the root disk? ('?' for details) [sd0] ? > sd0: Celerra (20.0G) > ^^^^^^^ ^^^^^ > > # scsi -f /dev/rsd0c -c "12 0 0 0 64 0" -i 0x64 "s8 z8 z16 z4" > EMC Celerra 0002 > > 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 > > Thank you for help, it would help me playing with iscsi luns on OpenBSD. > > j.
Infos about disks are printed to the console as soon as a disk is attached. So you can use dmesg and grep for scsi to get the info you want: $ dmesg | grep scsi scsibus0 at mpath0: 256 targets scsibus1 at ahci0: 32 targets sd0 at scsibus1 targ 0 lun 0: <ATA, KingFast, KFS1> SCSI3 0/direct fixed naa.0000000000000000 vscsi0 at root scsibus2 at vscsi0: 256 targets scsibus3 at softraid0: 256 targets 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 Cheers, Bruno