sg_inq might raise:
Both SCSI INQUIRY and fetching ATA information failed on /dev/vda
and hdparm might raise:
HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
HDIO_GET_IDENTITY failed: Inappropriate ioctl for device
This is annoying when running grml-hwinfo under cron, so
let's redirect this output to their according .error files.
if exectest hdparm ; then
echo -e "hdparm -iv /dev/${disk}:\n" >> hdparm
- hdparm -iv "/dev/$disk" >> ./hdparm
+ hdparm -iv "/dev/$disk" >> ./hdparm 2>> ./hdparm.error
echo -e "\n\n" >> hdparm
fi
if exectest sg_inq ; then
echo -e "sg_inq /dev/${disk}:\n" >> sg_inq
- sg_inq "/dev/$disk" >> ./sg_inq
+ sg_inq "/dev/$disk" >> ./sg_inq 2>> ./sg_inq.error
echo -e "\n\n" >> sg_inq
fi