From owner-freebsd-current Thu Nov 28 14: 1: 2 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8405537B401 for ; Thu, 28 Nov 2002 14:00:59 -0800 (PST) Received: from mail.dada.it (mail3.dada.it [195.110.100.3]) by mx1.FreeBSD.org (Postfix) with SMTP id 54C1F43EAF for ; Thu, 28 Nov 2002 14:00:46 -0800 (PST) (envelope-from riccardo@torrini.org) Received: (qmail 16811 invoked from network); 28 Nov 2002 22:00:31 -0000 Received: from unknown (HELO torrini.org) (195.110.114.101) by mail.dada.it with SMTP; 28 Nov 2002 22:00:31 -0000 Received: from trudy.torrini.home (localhost.torrini.home [127.0.0.1]) by torrini.org (8.12.6/8.12.6) with ESMTP id gASM0XAD001026 for ; Thu, 28 Nov 2002 23:00:33 +0100 (CET) (envelope-from riccardo@trudy.torrini.home) Received: (from riccardo@localhost) by trudy.torrini.home (8.12.6/8.12.6/Submit) id gASM0TCU001025 for freebsd-current@FreeBSD.ORG; Thu, 28 Nov 2002 23:00:29 +0100 (CET) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Thu, 28 Nov 2002 23:00:29 +0100 (CET) From: Riccardo Torrini To: freebsd-current@FreeBSD.ORG Subject: Trivial patch: fdisk doesn't recognize my partitions Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I have 4 primary partitions and I use a boot manager (magic.com) that install some black magic that hide unused partition, this permit to have multiple 'other-OS' partition that don't know of each other (but, obviously, FreeBSD can see and mount all of them). As far as I know it use an EXOR 0x10 to hide/unhide but fdisk doesn't recognize 0x0B/0x0C fat32 when hidden (0x1B/0x1C) This is the patch, that can be extended easily to cover the range 0x1A-0x1F (0x0A-0x0F when hidden). I simply copied strings from 0x0B/0x0C and added Hidden in front of them :-) Any comment? (I don't know if 0x1B/0x1C are registered as used) # cd /usr/src/sbin/fdisk # diff -u3 fdisk.c.orig fdisk.c --- fdisk.c.orig Mon Oct 28 14:31:04 2002 +++ fdisk.c Thu Nov 28 22:42:05 2002 @@ -151,6 +151,8 @@ ,{0x16, "OS/2 BM: hidden DOS with 16-bit FAT (>= 32MB)"} ,{0x17, "OS/2 BM: hidden IFS (e.g. HPFS)"} ,{0x18, "AST Windows swapfile"} + ,{0x1B, "Hidden DOS or Windows 95 with 32 bit FAT"} + ,{0x1C, "Hidden DOS or Windows 95 with 32 bit FAT (LBA)"} ,{0x24, "NEC DOS"} ,{0x3C, "PartitionMagic recovery"} ,{0x39, "plan9"} And yes, when FreeBSD is hidden it become 0xB5, so if you have multiple FreeBSDprimary partition I think we must add also this: @@ -195,6 +197,7 @@ ,{0xA7, "NeXTSTEP"} ,{0xA9, "NetBSD"} ,{0xAC, "IBM JFS"} + ,{0xB5, "Hidden FreeBSD/NetBSD/386BSD"} ,{0xB7, "BSDI BSD/386 file system"} ,{0xB8, "BSDI BSD/386 swap"} ,{0xC1, "DRDOS/sec with 12-bit FAT"} # fdisk.orig ******* Working on device /dev/ad0 ******* parameters extracted from in-core disklabel are: cylinders=12592 heads=16 sectors/track=63 (1008 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=12592 heads=16 sectors/track=63 (1008 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 27 (0x1b),(unknown) start 63, size 1638567 (800 Meg), flag 0 beg: cyl 0/ head 1/ sector 1; end: cyl 101/ head 254/ sector 63 The data for partition 2 is: sysid 22 (0x16),(OS/2 BM: hidden DOS with 16-bit FAT (>= 32MB)) start 1638630, size 208845 (101 Meg), flag 0 beg: cyl 102/ head 0/ sector 1; end: cyl 114/ head 254/ sector 63 The data for partition 3 is: sysid 27 (0x1b),(unknown) start 1847475, size 3068415 (1498 Meg), flag 0 beg: cyl 115/ head 0/ sector 1; end: cyl 305/ head 254/ sector 63 The data for partition 4 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 4915890, size 7775460 (3796 Meg), flag 80 (active) beg: cyl 306/ head 0/ sector 1; end: cyl 789/ head 254/ sector 63 # ./fdisk ******* Working on device /dev/ad0 ******* parameters extracted from in-core disklabel are: cylinders=12592 heads=16 sectors/track=63 (1008 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=12592 heads=16 sectors/track=63 (1008 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 27 (0x1b),(Hidden DOS or Windows 95 with 32 bit FAT) start 63, size 1638567 (800 Meg), flag 0 beg: cyl 0/ head 1/ sector 1; end: cyl 101/ head 254/ sector 63 The data for partition 2 is: sysid 22 (0x16),(OS/2 BM: hidden DOS with 16-bit FAT (>= 32MB)) start 1638630, size 208845 (101 Meg), flag 0 beg: cyl 102/ head 0/ sector 1; end: cyl 114/ head 254/ sector 63 The data for partition 3 is: sysid 27 (0x1b),(Hidden DOS or Windows 95 with 32 bit FAT) start 1847475, size 3068415 (1498 Meg), flag 0 beg: cyl 115/ head 0/ sector 1; end: cyl 305/ head 254/ sector 63 The data for partition 4 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 4915890, size 7775460 (3796 Meg), flag 80 (active) beg: cyl 306/ head 0/ sector 1; end: cyl 789/ head 254/ sector 63 Riccardo. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message