Subject: Re: Fewer cylinders for a hd after using a ACPI kernel
To: Bernd Ernesti <netbsd@lists.veego.de>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: current-users
Date: 04/18/2006 22:05:22
On Tue, Apr 18, 2006 at 03:59:05PM +0200, Bernd Ernesti wrote:
> Hi,
> 
> the number of cylinders for one hd changed after I booted a kernel with ACPI support.
> 
> I got a new motherboard and had a problem with a normal kernel when i did a
> shutdown -p, which caused a kernel panic after the sync step, so I tried
> to use a ACPI kernel and thats where my problem with the hd started.
> 
> This is a part of the dmesg output for a non ACPI kernel of the new mb and
> the disk. There is only one disk connected:
> 
> [...]
> wd0: 232 GB, 484521 cyl, 16 head, 63 sec, 512 bytes/sect x 488397168 sectors
> 
> And here is the same part after i booted with the new ACPI kernel:
> 
> [...]
> wd0: 232 GB, 484518 cyl, 16 head, 63 sec, 512 bytes/sect x 488395055 sectors
> 
> As you can see, the number of cylinders changed from 484521 to 484518 and
> the following errors occurred, because the rc script tried to mount a
> partition which was at the end of this disk:
> 
> wd0i: error reading fsbn 20971436 of 20971436-20971439 (wd0 bn 488396156; cn 484519 tn 15 sn 59), retrying
> wd0: (id not found)
> [same error repeated 6 times]
> 
> The number of sectors before I booted with the ACPI kernel matches the
> manufactor spec: http://www.wdc.com/en/products/Products.asp?DriveID=42
> 
> I reduced the total size in the disklabel, changed the parition, did a newfs
> and everything is working again.
> Except that I lost my data on that partition and 3 cylinders.
> 
> How can a ACPI kernel change the number of cylinders for a disk?
> I tried to boot with the old kernel and even switching back to the old mb, but
> nothing gave the 3 cyl back.

There is an ATA command to reserve some disk space for firmware use and hide
it from the OS. I'd expect a power cycle to reset this, though.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--