bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hacking parted to work with BSD disklabels ...


From: Timshel Knoll
Subject: Re: Hacking parted to work with BSD disklabels ...
Date: Tue, 24 Oct 2000 22:55:10 +1100
User-agent: Mutt/1.2.5i

On Tue, Oct 24, 2000 at 06:02:14AM +1100, Andrew Clausen wrote:
> Timshel Knoll wrote:
> > Yes, I noticed that the extended/logical partition scheme is embedded
> > within a lot of code in disk.c etc ....
> > This is a problem I've come across. The method I thought of
> > is not to use a 'select' command, but to add 2 new partition types:
> > bsdlabel (or similar) and bsdpart.
> 
> Sorry, what's the difference between the two types?  Do you mean
> "add a PedDiskType called bsd, and a PedPartitionType (or
> PedFileSystemType?) called bsd"?

Yes, this is what I'm saying - a bsdlabel is a PedDiskType, and a
bsdpart is a PedPartitionType. Much like the current extended/logical
arrangement.

> > This still leaves us with a fairly
> > major problem - I believe that it is a valid configuration to have
> > 2 (or more) BSD disklabels on the one disk - since *BSD refers to
> > partitions/labels using a partition (slice, in BSD-ish) number and
> > a letter indicating the sub-partition, ie:
> > /dev/ad1s3a
> > specifies the first sub-partition (a) in the disklabel on the 3rd
> > disk slice (partition) (s3) on disk ad1 (hdb in linux-speak).
> 
> So, it is equivalent to extended partitions :-(
> With very different alignment constraints, too... not that this
> is going to be a big deal.
> 
> OK, this has Implications.  First, logical partitions
> (== sub-partitions) must have owners expressed explicitly.  i.e.
> a tree structure, with up links.

Yes, I think that this is probably the best way to do it. However,
this has other implications (ie. mkpart for logical partitions
will have to take an extra parameter than mkpart for primary partitions).

> Can sub-partitions be nested?  Can sub-partitions exist in logical
> partitions?

No, I don't believe that you can have a disklabel within a disklabel ...
The exception of course is having a disklabel within a primary DOS
partition ...

> (/me REALLY should get freebsd...)

I'll burn you a copy if you want ... and it to you whenever we get
together (BTW, monday lunch might be good ... I'm going to Adelaide
this W/E and I just have to make sure that I'll be back ... I'll
get back to you on this tho). I've also got OpenBSD and NetBSD if
you want them as well. :-)

> Also: do you have any inspiration on how to interface this stuff
> on Parted?  And libparted?  It would be nice to preserve the
> partition type (extended, logical, primary, etc.)...

I believe that it would be good to get rid of any disklabel-specific
stuff from all files other than disk_<disklabel-type>.c - ie. get
rid of all stuff regarding 'primary' partitions or 'extended/logical'
partitions from disk.c ... not that this is really possible, but
hey ...

> Another issue is: is it really worth trying to hack libparted to
> do this?  I think (in principle, although the details haven't
> even been discussed yet...) that libparted will become part of
> LVMS, or something similar, in the distant future.  Options:
> * design an elegant (i.e. bloated) API to deal with the problem
> the Right Way.

This always my preferred solution to a problem. Keeping any
program/library modular is always the best way IMHO. This way it
creates less problems in the future ... although it requires more
changes in the present :-(

> * write a minimal dodgey solution (like select), pending a better
> one in something like LVMS ++
> * ignore the problem (how important are BSD slices?  - I'm guessing
> the answer is "important", so no need to push me on this one ;-)

Well, I wouldn't be mucking around with it if I didn't think it was
somewhat 'important' ;-)

> ++ we're probably the ones who will be designing this solution,
> but it will be in a different context, so Everything might change.
> OTOH, it might not... FWICT, we know more about partition tables
> than the IBM people - I doubt they have solved this problem.
> So, it's probably best we discuss the Right Solution TM now.

Yes, I've kindof put what I'm doing on hold - since it seems that it
is going to require quite a restructure of the libparted internals :-(
> 
> Andrew Clausen
> 
> 
> 

-- 
   Timshel Knoll <address@hidden>  for Debian email: <address@hidden>
    Second year Computer Science, RMIT   |   CS108 Tutor (Semester 2, 2000)
        Debian GNU/Linux developer, see http://www.debian.org/~timshel/
   For GnuPG public key: finger address@hidden or address@hidden

Attachment: pgpueMFWyezdy.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]