Bug 28890 - hdparm exits with 0 status if drive is not responding
Summary: hdparm exits with 0 status if drive is not responding
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: hdparm
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-02-22 18:12 UTC by Landon Curt Noll
Modified: 2007-04-18 16:31 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-02-22 18:12:49 UTC
Embargoed:


Attachments (Terms of Use)

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

/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 13:26:26 UTC
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.