Projects / hdparm / Comments

Comments for hdparm

30 Sep 2012 07:56 ErwanVelu

Obviously, THE reference tool under Linux to manage ATA storage devices.

14 Jul 2009 06:06 AKS91

Hi Guys
I am trying to use hdparam9.9 on kernel 2.6.26 and i am getting folllowing error message, I am trying to update SSD firmware. please provide support.
/*========================================*/
[root@localhost hdparm-9.9]# ./hdparm --fwdownload --yes-i_know_what_i_am_doing ../if4.bin /dev/sdb

../if4.bin:
HDIO_GETGEO failed: Inappropriate ioctl for device


Thanks
Aks

14 Jul 2009 04:15 AKS91

HI Guys,

I want to implement firmware download support for SSD device.
I added some changes in libata-scsi.c ata_cmd_ioctl. but I am getting time out error when i try to download initial firmware , firmware size is 64k.

I checked in old version of hdparam also support --firmware download.

I need help to solve time out error message, please provides some inputs or i can use any specific version of hdparam for firmware download.

Thanks
AKS

22 Jun 2009 04:05 rkononov

I'm not sure where you want the bugs submitted...

Compiled from v9.15 sources, hdparm crashes at hdparm.c, line 1826, when get_identify_data() returns NULL. Checking that id!=NULL is needed.

26 Dec 2008 04:29 ideguy

Re: Inappropriate ioctl for device


..

> $ sudo /sbin/hdparm -c1 -d1 /dev/sda

>

> /dev/sda:

> setting 32-bit IO_support flag to 1

> HDIO_SET_32BIT failed: Invalid argument

>

> setting using_dma to 1 (on)

> HDIO_SET_DMA failed: Inappropriate ioctl

> for device

> IO_support = 0 (default)

> HDIO_GET_DMA failed: Inappropriate ioctl

> for device

..

libata does not have a way to control DMA or 32bit PIO settings. So the command will fail. Normal. Ignore it.

Libata will always use DMA if possible, so no need for either setting.

-ml

26 Dec 2008 02:23 shirishag75

Inappropriate ioctl for device
Hi all,

I get the above error.

This is on ubuntu 8.10 2.6.27-9-generic

$ uname -a

Linux shirish-desktop 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686 GNU/Linux

$ sudo /sbin/hdparm -c1 -d1 /dev/sda

/dev/sda:

setting 32-bit IO_support flag to 1

HDIO_SET_32BIT failed: Invalid argument

setting using_dma to 1 (on)

HDIO_SET_DMA failed: Inappropriate ioctl for device

IO_support = 0 (default)

HDIO_GET_DMA failed: Inappropriate ioctl for device

The disk in question is an IDE drive in emulated SCSI mode due to ubuntu moving to the new 'libata' library.

$ sudo hdparm -I /dev/sda

[sudo] password for shirish:

/dev/sda:

ATA device, with non-removable media

Model Number: ST3160021A

Serial Number: 4JS26D4P

Firmware Revision: 8.01

Standards:

Used: ATA/ATAPI-6 T13 1410D revision 2

Supported: 6 5 4

Configuration:

Logical max current

cylinders 16383 4047

heads 16 16

sectors/track 63 255

--

CHS current addressable sectors: 16511760

LBA user addressable sectors: 268435455

LBA48 user addressable sectors: 312581808

device size with M = 1024*1024: 152627 MBytes

device size with M = 1000*1000: 160041 MBytes (160 GB)

Capabilities:

LBA, IORDY(can be disabled)

Standby timer values: spec'd by Standard, no device specific minimum

R/W multiple sector transfer: Max = 16 Current = 16

Recommended acoustic management value: 128, current value: 0

DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5

Cycle time: min=120ns recommended=120ns

PIO: pio0 pio1 pio2 pio3 pio4

Cycle time: no flow control=240ns IORDY flow control=120ns

Commands/features:

Enabled Supported:

* SMART feature set

Security Mode feature set

* Power Management feature set

* Write cache

* Look-ahead

* Host Protected Area feature set

* WRITE_BUFFER command

* READ_BUFFER command

* DOWNLOAD_MICROCODE

SET_MAX security extension

* 48-bit Address feature set

* Device Configuration Overlay feature set

* Mandatory FLUSH_CACHE

* FLUSH_CACHE_EXT

* SMART error logging

* SMART self-test

* General Purpose Logging feature set

Time Limited Commands (TLC) feature set

Command Completion Time Limit (CCTL)

Security:

Master password revision code = 65534

supported

not enabled

not locked

not frozen

not expired: security count

not supported: enhanced erase

HW reset results:

CBLID- above Vih

Device num = 1 determined by the jumper

Checksum: correct

Please lemme know if there is anyway to set the same.

28 Jul 2008 20:46 ideguy

Re: How to erase the whole disk ?
I believe you are doing the right sequence of steps, so the problem is likely a broken kernel call in the old IDE drivers.

I do know that there are bugs in the kernel ioctls() HDIO_DRIVE_TASK and HDIO_DRIVE_TASKFILE have bugs in some scenarios, with the old IDE drivers. So that is what is probably causing it not to work for you.

If you need this kind of functionality, your best bet is to switch over to the modern libata kernel drivers, which are replacing the old IDE ones. The libata kernel drivers fully support hdparm and the SECURITY_ERASE functionality.

Cheers

16 Jul 2008 10:55 Lotje

How to erase the whole disk ?
Hi all,

Since quite a while I want to erase my harddisk on the secure erase method. hdparm supports

this, but I always get the same error 5.

I use version 6.9

root@Knoppix:/media/hda1# hdparm -V

hdparm v6.9

The first thing I do is ask some info about the disk:

root@Knoppix:/media/hda1# hdparm -I /dev/hda

/dev/hda:

ATA device, with non-removable media

Model Number: SAMSUNG SP0411N

Serial Number: S01JJ50X351236

Firmware Revision: TW100-11

Standards:

Used: ATA/ATAPI-7 T13 1532D revision 0

Supported: 7 6 5 4

Configuration:

Logical max current

cylinders 16383 16383

heads 16 16

sectors/track 63 63

--

CHS current addressable sectors: 16514064

LBA user addressable sectors: 78165360

device size with M = 1024*1024: 38166 MBytes

device size with M = 1000*1000: 40020 MBytes (40 GB)

Capabilities:

LBA, IORDY(can be disabled)

Standby timer values: spec'd by Standard, no device specific minimum

R/W multiple sector transfer: Max = 16 Current = 16

DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5

Cycle time: min=120ns recommended=120ns

PIO: pio0 pio1 pio2 pio3 pio4

Cycle time: no flow control=120ns IORDY flow control=120ns

Commands/features:

Enabled Supported:

* SMART feature set

* Power Management feature set

* Write cache

* Look-ahead

* WRITE_BUFFER command

* READ_BUFFER command

* DOWNLOAD_MICROCODE

* Device Configuration Overlay feature set

* Mandatory FLUSH_CACHE

* SMART error logging

* SMART self-test

Security:

Master password revision code = 65534

16min for SECURITY ERASE UNIT. 16min for ENHANCED SECURITY ERASE UNIT.

HW reset results:

CBLID- above Vih

Device num = 0 determined by CSEL

Checksum: correct

It looks that my disk supports enhanced security erase. Now I set the password, but

this already fail:

root@Knoppix:/media/hda1# hdparm --security-set-pass test /dev/hda

/dev/hda:

Issuing SECURITY_SET_PASS command, password="test", user=master, mode=high

Problem issuing security command: Input/output error

Error: 5

Then I tried to unlock, but because the password setting failed, this doesn't work either.

root@Knoppix:/media/hda1# hdparm --security-unlock test /dev/hda

/dev/hda:

Issuing SECURITY_UNLOCK command, password="test", user=master

Problem issuing security command: Input/output error

Error: 5

And the erase also give an error:

root@Knoppix:/media/hda1# hdparm --security-erase test /dev/hda

/dev/hda:

Issuing SECURITY_ERASE command, password="test", user=master

HDIO_DRIVE_CMD(erase prepare) failed: Input/output error

Can somebody help me to work this out ?

Thanks a lot,

Lotje

03 Mar 2008 10:17 gt3389b

Re: does anyone know how to unlock a hdd via ide-over-usb?
I have confirmed that I see identical behavior with hdparm. If anyone has any information please post. Until then I'll investigate . . .

> see the following command, the kernel

> flag is definitely compiled in, but

> hdparm seems to not recognize. Probably

> this is related to the fact that the HDD

> is connected via a USB case and

> therefore is a scsi disk for the OS - is

> this correct? Any workarround? I already

> tried blktool out of the gkernel project

> or sdparm but both seem to lack the

> ability of sending ATA security commands

> (e.g. --security-unlock)

>

>

>

>

> gbox / # gunzip </proc/config.gz

> |grep -i task_ioctl;hdparm

> --security-unlock pass /dev/sdb

> CONFIG_IDE_TASK_IOCTL=y

> security_password="pass"

>

> /dev/sdb:

> Issuing SECURITY_UNLOCK command,

> password="pass", user=master

> The running kernel lacks

> CONFIG_IDE_TASK_IOCTL support

> SECURITY_UNLOCK: Invalid argument

>

>

>

09 Feb 2008 11:54 rkaestner

does anyone know how to unlock a hdd via ide-over-usb?
see the following command, the kernel flag is definitely compiled in, but hdparm seems to not recognize. Probably this is related to the fact that the HDD is connected via a USB case and therefore is a scsi disk for the OS - is this correct? Any workarround? I already tried blktool out of the gkernel project or sdparm but both seem to lack the ability of sending ATA security commands (e.g. --security-unlock)


gbox / # gunzip </proc/config.gz |grep -i task_ioctl;hdparm --security-unlock pass /dev/sdb

CONFIG_IDE_TASK_IOCTL=y

security_password="pass"

/dev/sdb:

Issuing SECURITY_UNLOCK command, password="pass", user=master

The running kernel lacks CONFIG_IDE_TASK_IOCTL support

SECURITY_UNLOCK: Invalid argument


Screenshot

Project Spotlight

ReciJournal

An open, cross-platform journaling program.

Screenshot

Project Spotlight

Veusz

A scientific plotting package.