Bug 28890 - hdparm exits with 0 status if drive is not responding
hdparm exits with 0 status if drive is not responding
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: hdparm (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-02-22 13:12 EST by Landon Curt Noll
Modified: 2007-04-18 12:31 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-02-22 13:12:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Landon Curt Noll 2001-02-22 13:12:46 EST
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

/dev/hdd:
 drive state is:  unknown
# echo $?
0

Expected Results:  # hdparm -C /dev/hdd

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

Other hdparm commands such as:

# hdparm -Y /dev/hdd

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

also exit 0 when an error occurs.
Comment 1 Karsten Hopp 2001-03-05 08:26:26 EST
Most of these are warnings. The exit status is only set if hdparm can't
proceed because of invalid input.

Note You need to log in before you can comment on or make changes to this bug.