From: Phillip Susi <psusi@cfl.rr.com>
To: "Darrick J. Wong" <djwong@us.ibm.com>,
dm-devel@redhat.com, Chris McDermott <lcm@us.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Support HDIO_GETGEO on device-mapper volumes
Date: Fri, 10 Feb 2006 10:12:27 -0500 [thread overview]
Message-ID: <43ECAD5B.9070308@cfl.rr.com> (raw)
In-Reply-To: <20060210145348.GA12173@agk.surrey.redhat.com>
Alasdair G Kergon wrote:
> On Thu, Feb 09, 2006 at 05:35:12PM -0800, Darrick J. Wong wrote:
>
>> Since dm doesn't implement the HDIO_GETGEO ioctl,
>>
>
> Why should it? Device-mapper constructs a virtual device and
> I think it's completely wrong for it to 'fake' a geometry.
>
> Of course dm could recognise the ioctl - but the default response
> should be the one that indicates the geometry is unknown.
>
>
That is what it did before. By failing the ioctl, that indicates that
the geometry is unknown, and that causes problems for grub.
>> grub assumes that the CHS
>> geometry is 620/128/63, which makes it impossible to configure it to
>> boot a filesystem that lives beyond the 2GB mark, even if the system
>> BIOS supports that.
>>
>
> Surely a problem in grub, not the kernel?
>
>
Yes, I think this could also be fixed on grub's end. It seems that
fdisk assumes usable default values for the geometry but grub has
different defaults that cause it problems. I think that the defaults
could be modified in grub so that it will work when HDIO_GETGEO fails.
>> The attached patch implements a simple ioctl handler that supplies a
>> compatible geometry when HDIO_GETGEO is called against a device-mapper
>> device. Its behavior is somewhat similar to what sd_mod does if the
>> scsi controller doesn't provide its own geometry.
>>
>
> What if the dm device is a linear mapping to an sd device that *does*
> provide a different geometry? Then the 'fake' geometry dm would return
> with this patch would be wrong!
>
>
There is no 'right' or 'wrong' geometry; it is all made up anyhow.
>> this seems to be a better option than having each program make
>> up its own potentially different geometry, or making an arbitrary guess.
>>
>
> I disagree - either dm should work out the *correct* geometry to
> return for those mappings where a geometry is known and it's sensible
> to return one (e.g. linear mapping to the start of certain scsi
> devices), or else it should leave it to userspace to decide how to
> handle the situation. (And there's nothing currently stopping
> userspace seeing that a dm device is constructed out of a scsi device
> and choosing to use the geometry of that underlying device.)
Except that most user space tools are not aware of dm and shouldn't need
to be.
In this case, I think the correct solution is to patch grub so that if
there is already a valid MBR on the disk, it should take the geometry
from there. If it is creating a brand new MBR, then it should use the
geometry from HDIO_GETGEO and if that fails, make up sensible defaults
like fdisk does.
next prev parent reply other threads:[~2006-02-10 15:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-10 1:35 [PATCH] Support HDIO_GETGEO on device-mapper volumes Darrick J. Wong
2006-02-10 2:58 ` Andrew Morton
2006-02-10 5:15 ` Phillip Susi
2006-02-10 8:14 ` Darrick J. Wong
2006-02-10 15:14 ` Phillip Susi
2006-02-10 14:53 ` Alasdair G Kergon
2006-02-10 15:12 ` Phillip Susi [this message]
2006-02-10 20:27 ` Molle Bestefich
2006-02-10 21:21 ` Phillip Susi
2006-02-20 18:09 ` Molle Bestefich
2006-02-20 21:30 ` Phillip Susi
2006-02-21 13:30 ` Molle Bestefich
2006-02-21 16:02 ` Phillip Susi
2006-02-10 15:13 ` [PATCH] " Alasdair G Kergon
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=43ECAD5B.9070308@cfl.rr.com \
--to=psusi@cfl.rr.com \
--cc=djwong@us.ibm.com \
--cc=dm-devel@redhat.com \
--cc=lcm@us.ibm.com \
--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