From: "Eduardo Trápani" <etrapani@unesco.org.uy>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] clipped disk reports clipped lba size
Date: Wed, 30 Jan 2002 12:02:14 -0300 [thread overview]
Message-ID: <3C580AF6.90EF7086@unesco.org.uy> (raw)
[-- Attachment #1: Type: text/plain, Size: 681 bytes --]
Since my BIOS does not support my disk (WD400) I had to clip to 33.8G. At boot time Linux (2.4.17) uses the lba size reported by the disk, that is 33.8 and does not allow me to access the rest of the disk.
The problem is that even though the whole disk can be used after clipping, Linux uses only the reported lba size even if I force the geometry.
Here is a patch to solve that. I am sure there is a more elegant solution, I guess we could add a "lba_size=" or something like that as a boot parameter.
The patch against 2.4.17 does this: if the geometry has been forced then use it to calculate the lba size and ignore the (possibly clipped) answer from the disk.
Eduardo.
[-- Attachment #2: patch-clipped-ide.txt --]
[-- Type: text/plain, Size: 552 bytes --]
--- drivers/ide/ide-disk.c.orig Wed Jan 30 11:26:51 2002
+++ drivers/ide/ide-disk.c Wed Jan 30 11:30:26 2002
@@ -511,6 +511,12 @@
drive->select.b.lba = 0;
+ /* If the geometry has been forced recalculate lba_capacity */
+ if ((id->capability & 2) && lba_capacity_is_ok(id) &&
+ drive->forced_geom)
+ {
+ id->lba_capacity = drive->bios_head * drive->bios_sect * drive->bios_cyl;
+ }
/* Determine capacity, and use LBA if the drive properly supports it */
if ((id->capability & 2) && lba_capacity_is_ok(id)) {
capacity = id->lba_capacity;
next reply other threads:[~2002-01-30 14:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-30 15:02 Eduardo Trápani [this message]
2002-01-30 15:34 ` [PATCH] clipped disk reports clipped lba size Alan Cox
2002-01-30 17:04 ` Andre Hedrick
-- strict thread matches above, loose matches on Subject: below --
2002-01-30 20:12 Andries.Brouwer
2002-02-01 12:10 ` Paul Gortmaker
2002-02-01 21:55 Andries.Brouwer
2002-02-02 0:20 ` Andre Hedrick
2002-02-02 11:11 ` Paul Gortmaker
2002-02-02 13:38 Andries.Brouwer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C580AF6.90EF7086@unesco.org.uy \
--to=etrapani@unesco.org.uy \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox