2005-10-15 22:59:53

by J.A. Magallon

[permalink] [raw]
Subject: hdparm almost burned my SATA disk

Hi all...

I have seen a very strange thing.
I was trying hdparm -tT on a SATA disk, it did the buffered part OK,
and hanged my box in the non-buffered measure. After waiting some minutes,
I did a SysRQ-s-u-b, and the the disk began to give many read errors on
sectors and could not boot because journal was not present and many other
errors.

After some warm and cold boots, finally the box came up correctly.
I suspect that something that hdparm did left my disk dumb. But what ?
I will keep away from hdparm for some time...

Any idea ?

TIA

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.1 (Cooker) for i586
Linux 2.6.13-jam8 (gcc 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0))


Attachments:
(No filename) (189.00 B)

2005-10-15 23:02:58

by J.A. Magallon

[permalink] [raw]
Subject: Re: hdparm almost burned my SATA disk

On Sun, 16 Oct 2005 01:01:53 +0200, "J.A. Magallon" <[email protected]> wrote:

> Hi all...
>
> I have seen a very strange thing.
> I was trying hdparm -tT on a SATA disk, it did the buffered part OK,
> and hanged my box in the non-buffered measure. After waiting some minutes,
> I did a SysRQ-s-u-b, and the the disk began to give many read errors on
> sectors and could not boot because journal was not present and many other
> errors.
>
> After some warm and cold boots, finally the box came up correctly.
> I suspect that something that hdparm did left my disk dumb. But what ?
> I will keep away from hdparm for some time...
>
> Any idea ?
>

Oops I forgot.
Kernel is 2.6.14-rc2-mm2.
hdparm is v6.1
Filesystem is ext3 on a

werewolf:~/soft/kernel/patches/2.6.13-jam8# hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
Model Number: Maxtor 6L160M0
Serial Number: L40MRV4G
Firmware Revision: BANC1G10



--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.1 (Cooker) for i586
Linux 2.6.13-jam8 (gcc 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0))


Attachments:
(No filename) (189.00 B)

2005-10-16 00:05:41

by Michal Piotrowski

[permalink] [raw]
Subject: Re: hdparm almost burned my SATA disk

Hi,

On 15/10/05, J.A. Magallon <[email protected]> wrote:
> On Sun, 16 Oct 2005 01:01:53 +0200, "J.A. Magallon" <[email protected]> wrote:
>
> > Hi all...
> >
> > I have seen a very strange thing.
> > I was trying hdparm -tT on a SATA disk, it did the buffered part OK,
> > and hanged my box in the non-buffered measure. After waiting some minutes,
> > I did a SysRQ-s-u-b, and the the disk began to give many read errors on
> > sectors and could not boot because journal was not present and many other
> > errors.
> >
> > After some warm and cold boots, finally the box came up correctly.
> > I suspect that something that hdparm did left my disk dumb. But what ?
> > I will keep away from hdparm for some time...
> >
> > Any idea ?
> >
>
> Oops I forgot.
> Kernel is 2.6.14-rc2-mm2.
> hdparm is v6.1
> Filesystem is ext3 on a
>
> werewolf:~/soft/kernel/patches/2.6.13-jam8# hdparm -I /dev/sda
>
> /dev/sda:
>
> ATA device, with non-removable media
> Model Number: Maxtor 6L160M0
> Serial Number: L40MRV4G
> Firmware Revision: BANC1G10

debian:/home/michal# hdparm -tT /dev/sda

/dev/sda:
Timing cached reads: 3652 MB in 2.00 seconds = 1823.54 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate
ioctl for device
Timing buffered disk reads: 174 MB in 3.01 seconds = 57.72 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate
ioctl for device
debian:/home/michal# hdparm -V
hdparm v6.1
debian:/home/michal# hdparm -I /dev/sda

/dev/sda:
HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device

debian:/home/michal# uname -r
2.6.14-rc4-g7a3ca7d2

CONFIG_SCSI_SATA=y
# CONFIG_SCSI_SATA_AHCI is not set
# CONFIG_SCSI_SATA_SVW is not set
CONFIG_SCSI_ATA_PIIX=y

I have noticed the same behavior on 2.6.12.

Regards,
Michal Piotrowski

2005-10-17 20:48:58

by Mark Lord

[permalink] [raw]
Subject: Re: hdparm almost burned my SATA disk

J.A. Magallon wrote:
>
> I was trying hdparm -tT on a SATA disk, it did the buffered part OK,
> and hanged my box in the non-buffered measure. After waiting some minutes,
> I did a SysRQ-s-u-b, and the the disk began to give many read errors on
> sectors and could not boot because journal was not present and many other
> errors.
>
> After some warm and cold boots, finally the box came up correctly.
> I suspect that something that hdparm did left my disk dumb. But what ?

Nope. hdparm simply does a bunch of read() system calls to fetch
data from the drive, same as any other code might do it.

I think you should use the smartmontools to check the drive error logs
and find out what REALLY happened there.

-ml

2005-10-17 20:50:39

by Mark Lord

[permalink] [raw]
Subject: Re: hdparm almost burned my SATA disk

Michal Piotrowski wrote:
>
> debian:/home/michal# hdparm -tT /dev/sda
>
> /dev/sda:
> Timing cached reads: 3652 MB in 2.00 seconds = 1823.54 MB/sec
> HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate
> ioctl for device
> Timing buffered disk reads: 174 MB in 3.01 seconds = 57.72 MB/sec
> HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate
> ioctl for device
> debian:/home/michal# hdparm -V
> hdparm v6.1
> debian:/home/michal# hdparm -I /dev/sda
>
> /dev/sda:
> HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
>

Harmless. 100% harmless.

The "Inappropriate ioctl for device" messages are due to the incomplete
implementation of HDIO_DRIVE_CMD in libata. No big deal. Once the
passthru patches finally get released for real, I'll update hdparm to
not use the missing ioctl.

Cheers