Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 28890 - hdparm exits with 0 status if drive is not responding
hdparm exits with 0 status if drive is not responding
Product: Red Hat Linux
Classification: Retired
Component: hdparm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
Aaron Brown
Depends On:
  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:
Last Closed: 2001-02-22 13:12:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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

 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 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.