Bug 28890

Summary: hdparm exits with 0 status if drive is not responding
Product: [Retired] Red Hat Linux Reporter: Landon Curt Noll <redhat-mail>
Component: hdparmAssignee: Karsten Hopp <karsten>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-22 18:12:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Landon Curt Noll 2001-02-22 18:12:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.17-14 i686)

The hdparm command, using options to probe a drive, will exit 0 as if the
probe was successful but the output says otherwise.

Reproducible: Always
Steps to Reproduce:
1.hdparm -C /dev/hdc
	where /dev/hdc is a drive that is working that you
	want to obtain the status
2.put the drive to sleep:
	hdparm -Y /dev/hdc
3.pull the power plug on /dev/hdc
4.hdparm -C /dev/hdc
5.echo $?

Actual Results:  # hdparm -C /dev/hdd

 drive state is:  unknown
# echo $?

Expected Results:  # hdparm -C /dev/hdd

 drive state is:  unknown
# echo $?
1			(or some other non-zero exit code)

Other hdparm commands such as:

# hdparm -Y /dev/hdd

 issuing sleep command
 HDIO_DRIVE_CMD(sleep) failed: Input/output error
# echo $?

also exit 0 when an error occurs.

Comment 1 Karsten Hopp 2001-03-05 13:26:26 UTC
Most of these are warnings. The exit status is only set if hdparm can't
proceed because of invalid input.