Hi Kelly,

> I find it hard to believe that a 3 line patch would
> be enought to enumerate the partitions inside extended partitions, must less
> with arbitrary depth. But I've been amazed before :)

 It's probably not really what you expect (or hope? for), and not that much of 
a deal (less than a mouse driver ;) ). I was just wondering where to post 
these kind of things. The only thing the patch does is make the linux extended 
partition type known and use it when available.

> >  I would like to submit a (three line) patch to enable the use of linux 
> > extended filesystem.

 I mean using as in mounting, not running from.

 The linux extended partition is just a dos extended partition with a 
different identifier (0x85 instead of 0x05). You can use it as an extra 
extended partition, without dos being upset about seeing another extended 
partition. I actually use it on a multi os machine which bios doesn't 
understand the 20G hd. (Dos, dos extended containing ia linux /boot, ufs 
44bsd, linux extended.)

 Here comes the patch (for 4.0R):

/sys/kern/subr_diskmbr.c

 Insert after line 51:

#define DOSPTYP_LINUXEXTENDED   133

 Insert at line 347 (original offset), before the closing bracket:

 || sp->ds_type == DOSPTYP_LINUXEXTENDED

 Insert at line 437, before closing bracket:

 || dp->dp_type == DOSPTYP_LINUXEXTENDED

 That's all there is to it. I'm not sure the existing code handles dos 
extended LBA partitions, or needs modification for this, so I didn't include 
it. You could try to add a DOSPTYP_EXTENDED_LBA (0x0F). Haven't tried. Might 
go seriously wrong.

 To make things comeplete you could also modify fdisk.

/usr/src/sbin/i386/fdisk/fdisk.c

 Insert after line 166:

        ,{0x85, "Extended Linux"}

 Using two extended partitions you might want to increase MAXPARTITIONS in 
/sys/i386/boot/dosboot/disklabe.h, /sys/sys/diskslice.h and 
/sys/sys/disklabel.h.

 Haven't really tested this thoroughly, but it seems to run fine.

                                Ciao,

                                Leonard.



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to