Hello,
>This version adds sg_rmsn to read media serial number(s).
It appears that this doesn't quite work as I had hoped.
Ideally, should it not work upon every drive in which sq_inq reads the serial
number?
SUSE 9.2, vendor kernel:
root@emitestmachine 09:22:57 ~ # gcc -v; echo "----------------------"; sg_inq \
-v /dev/sg0; echo "-------------------------"; sg_rmsn -v /dev/sg0
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.4/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr \
--with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man\
--enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib \
--enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib \
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.4 (pre 3.3.5 20040809)
----------------------
inquiry cdb: 12 00 00 00 24 00
standard INQUIRY:
inquiry cdb: 12 00 00 00 60 00
PQual=0 Device_type=0 RMB=0 version=0x03 [SPC]
[AERC=0] [TrmTsk=0] NormACA=0 HiSUP=0 Resp_data_format=2
SCCS=0 ACC=0 TGPS=0 3PC=0 Protect=0 BQue=0
EncServ=0 MultiP=0 MChngr=0 [ACKREQQ=0] Addr16=0
[RelAdr=0] WBus16=1 Sync=1 Linked=1 [TranDis=1] CmdQue=1
Clocking=0x3 QAS=0 IUS=0
length=96 (0x60) Peripheral device type: disk
Vendor identification: QUANTUM
Product identification: ATLAS_V_36_WLS
Product revision level: 0230
inquiry cdb: 12 01 00 00 fc 00
inquiry: resid=240
inquiry cdb: 12 01 80 00 fc 00
inquiry: resid=236
Unit serial number: 143110652885
-------------------------
read media serial number cdb: ab 01 00 00 00 00 00 00 00 04 00 00
Read Media Serial Number command not supported
Using RHEL3, vanilla 2.6.7 kernel:
[root@localhost root]# gcc -v; for drive in sg0 sg1 sg2; do sg_inq -v /dev/sg2;\
echo "---- begin rmsn on sg2 ----" ; sg_rmsn -v /dev/sg2; echo "---- end rmsn \
on sg2 ----"; done
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man \
--infodir=/usr/share/info --enable-shared --enable-threads=posix \
--disable-checking --with-system-zlib --enable-__cxa_atexit \
--host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)
inquiry cdb: 12 00 00 00 24 00
standard INQUIRY:
inquiry cdb: 12 00 00 00 90 00
PQual=0 Device_type=0 RMB=0 version=0x03 [SPC]
[AERC=0] [TrmTsk=0] NormACA=0 HiSUP=1 Resp_data_format=2
SCCS=0 ACC=0 TGPS=0 3PC=0 Protect=0 BQue=0
EncServ=0 MultiP=0 MChngr=0 [ACKREQQ=0] Addr16=1
[RelAdr=0] WBus16=1 Sync=1 Linked=1 [TranDis=1] CmdQue=1
Clocking=0x3 QAS=1 IUS=1
length=144 (0x90) Peripheral device type: disk
Vendor identification: SEAGATE
Product identification: ST973401LC
Product revision level: F402
inquiry cdb: 12 01 00 00 fc 00
inquiry: resid=239
inquiry cdb: 12 01 80 00 fc 00
inquiry: resid=228
Unit serial number: 3LB00XQ900008443EEU1
---- begin rmsn on sg0 ----
read media serial number cdb: ab 01 00 00 00 00 00 00 00 04 00 00
Read Media Serial Number command not supported
---- end rmsn on sg0 ----
inquiry cdb: 12 00 00 00 24 00
standard INQUIRY:
PQual=0 Device_type=5 RMB=1 version=0x02 [SCSI-2]
[AERC=0] [TrmTsk=0] NormACA=1 HiSUP=1 Resp_data_format=2
SCCS=0 ACC=0 TGPS=0 3PC=0 Protect=0 BQue=0
EncServ=0 MultiP=0 MChngr=0 [ACKREQQ=0] Addr16=0
[RelAdr=0] WBus16=0 Sync=0 Linked=0 [TranDis=0] CmdQue=0
length=36 (0x24) Peripheral device type: cd/dvd
Vendor identification: SONY
Product identification: DVD-ROM DDU1621
Product revision level: S4.0
inquiry cdb: 12 01 00 00 fc 00
Inquiry error, VPD page=0x0: SCSI status: Check Condition
Fixed format, current; Sense key: Illegal Request
Additional sense: Invalid field in cdb
Raw sense data (in hex):
70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00
00 00
plus...: Driver_status=0x08 [DRIVER_SENSE, SUGGEST_OK]
---- begin rmsn on sg1 ----
read media serial number cdb: ab 01 00 00 00 00 00 00 00 04 00 00
Read Media Serial Number command not supported
---- end rmsn on sg1 ----
inquiry cdb: 12 00 00 00 24 00
standard INQUIRY:
inquiry cdb: 12 00 00 00 61 00
PQual=0 Device_type=0 RMB=0 version=0x05 [SPC-3]
[AERC=0] [TrmTsk=0] NormACA=0 HiSUP=0 Resp_data_format=2
SCCS=0 ACC=0 TGPS=0 3PC=0 Protect=0 BQue=0
EncServ=0 MultiP=0 MChngr=0 [ACKREQQ=0] Addr16=0
[RelAdr=0] WBus16=0 Sync=0 Linked=0 [TranDis=0] CmdQue=0
Clocking=0x0 QAS=0 IUS=0
length=97 (0x61) Peripheral device type: disk
Vendor identification: ATA
Product identification: FUJITSU MHT2080B
Product revision level: 0000
inquiry cdb: 12 01 00 00 fc 00
inquiry cdb: 12 01 80 00 fc 00
Unit serial number: NR00T45254L5
---- begin rmsn on sg2 ----
read media serial number cdb: ab 01 00 00 00 00 00 00 00 04 00 00
Read Media Serial Number command not supported
If I'm misunderstanding something, please let me know.
Thanks,
Drew
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]