I'm trying to read the model and serial number from a drive using "hdparm -I /dev/sda" and I find on some systems (eg: VMware virtual machines) the serial number and model often return garbage (see below). And the garbage seems to change over time when I repeat the command. Is there a way to tell hdparm to not output this garbage? (i.e. show nothing if it can't read the data)
/dev/sda:
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ATA device, with non-removable media
�������@�����@�����@: ����
Serial Number: ����@�����@����
Firmware Revision: ��O��
Standards:
Likely used: 2
Configuration:
CHS addressing not supported
LBA user addressable sectors: 116676416
Logical/Physical Sector size: 512 bytes
device size with M = 1024*1024: 56970 MBytes
device size with M = 1000*1000: 59738 MBytes (59 GB)
cache/buffer size = unknown