Subject: Re: finding the "raw" partition on portable disks
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 04/18/2007 22:01:49
On Wed, Apr 18, 2007 at 03:51:13PM -0500, David Young wrote:
> I am working to support portability of disks from one architecture to
> another---for example, i386 to evbmips.
> 
> Here is a routine that I wrote to hunt a disk's partition table for the
> "raw" partition.  The routine prefers the architecture's raw partition
> (RAW_PART'th partition) but, allowing for the possibility that the
> RAW_PART'th partition does not span the disk, searches for a partition
> that does.  What do you think, do I select the raw partition using the
> right criteria?


Hmmm fix the kernels?
The i386 (at least) kernel will always set the RAW_PART to match the
entire disk, regardless as to what was read from the disk itself.

Actually i386 (etc) could make the 'c' partition (which is set to the
mbr partition from which the system booted, and is only used in one
place [1]) avaiavle for a 'user' partition. It could then contain
information from the 'd' partition of disks that have come from a
system where RAW_PART is 'c'.

	David

[1] The check for overwriting the disklabel.

-- 
David Laight: david@l8s.co.uk