From owner-freebsd-fs Tue Jun 20 11:31:40 2000 Delivered-To: freebsd-fs@freebsd.org Received: from hetnet.nl (net090s.hetnet.nl [194.151.104.183]) by hub.freebsd.org (Postfix) with ESMTP id 6B5B137B89F; Tue, 20 Jun 2000 11:31:29 -0700 (PDT) (envelope-from leonardjo@hetnet.nl) Received: from potkoffie ([195.121.128.87]) by hetnet.nl with Microsoft SMTPSVC(5.5.1877.387.38); Tue, 20 Jun 2000 20:27:52 +0200 From: "Leonard den Ottolander" To: freebsd-fs@freebsd.org, freebsd-hackers@freebsd.org Date: Tue, 20 Jun 2000 20:29:57 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Patch concerning linux extended fs References: <018fb0509141260NET014S@hetnet.nl> In-reply-to: X-mailer: Pegasus Mail for Win32 (v3.01d) Message-ID: <0f9885227181460NET090S@hetnet.nl> Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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