Bug 78758 - [ata] [patch] Add support for re-sizing ATA disks
Summary: [ata] [patch] Add support for re-sizing ATA disks
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 5.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-13 00:00 UTC by Peter Jeremy
Modified: 2012-03-25 04:31 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (6.70 KB, patch)
2005-03-13 00:00 UTC, Peter Jeremy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Jeremy 2005-03-13 00:00:13 UTC
	Older PC BIOSes have various limits on disk sizes - 8GB and 33GB are
	common ones.  Some disk manufacturers provide tricks to get around
	these limits - typically a jumper that restricts capacity to either
	8GB or 33GB and then allows software to recover the capacity by
	issuing ATA READ NATIVE MAX and ATA SET MAX ADDRESS commands.

	The attached patch adds a new boolean boot-time tunable
	"hw.ata.reset_capacity".  If this tunable is true, then the kernel
	will issue an ATA READ NATIVE MAX during the disk attach.  If the
	returned size is greater than the size previously reported by
	the ATA IDENTIFY issued during the probe then an ATA SET MAX ADDRESS
	is issued with the updated size and the ATA IDENTIFY repeated.

	Note that this code does not handle the 48-bit extended command
	version and so only handles disks up to 137GB.  This is because
	neither the existing ATAng nor the new ATAmkIII code includes
	provision for reading the 48-bit LBA result from an extended command.
	By ensuring that the LBA returned by the READ NATIVE result is
	greater than the existing LBA, the code avoids truncating a correctly
	probed large disk down to 137GB.

Fix: Notes:
	1) The patch to ata-lowlevel.c is only needed on 5.x.  This fix has
	   been implemented in 6.x but not MFC'd.
	2) This patch matches the existing coding style in dev/ata rather than
	   style(9).
How-To-Repeat: 	I did my testing using a Seagate ST380011A disk on a Asus P5A-B
	motherboard.  This combination will hang during the BIOS probe
	unless the disk is jumpered down to 33GB.

	1) With the disk in 'native' mode, demonstrate that the BIOS will
	   hang during the BIOS probe.
	2) Install the "alternate capacity jumper".  Verify that both the
	   BIOS and FreeBSD report a capacity of less than 33GB (66,055,248
	   sectors in my case).
	3) Add the line 'hw.ata.reset_capacity="1"' to /boot/loader.conf and
	   reboot with the below patch installed.
	4) Verify that the BIOS reports a capacity of less than 33GB whilst
	   FreeBSD reports the full disk capacity (156,301,488 sectors for
	   the above disk).
	5) Using dd(1), newfs or fdisk, verify that the full disk capacity
	   is accessible.  [My first fix failed this step]
	6) Verify that the system reboots correctly using reboot(8) or
	   similar (ie resetting the system restores the limited capacity).
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2005-04-03 09:32:06 UTC
Responsible Changed
From-To: freebsd-bugs->sos

Over to maintainer.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2009-05-12 05:31:56 UTC
Responsible Changed
From-To: sos->freebsd-bugs

sos@ is not actively working on ATA-related PRs.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2012-03-25 04:31:23 UTC
State Changed
From-To: open->closed

seems to have been fixed a looooong time ago. Sorry for taking so long 
to get to this PR.