Date: Tue, 20 Jun 2000 20:29:57 +0200 From: "Leonard den Ottolander" <leonardjo@hetnet.nl> To: freebsd-fs@freebsd.org, freebsd-hackers@freebsd.org Subject: Patch concerning linux extended fs Message-ID: <0f9885227181460NET090S@hetnet.nl> In-Reply-To: <Pine.BSF.4.21.0006181430510.9394-100000@gateway.posi.net> References: <018fb0509141260NET014S@hetnet.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0f9885227181460NET090S>
