Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2002 23:00:29 +0100 (CET)
From:      Riccardo Torrini <riccardo@torrini.org>
To:        freebsd-current@FreeBSD.ORG
Subject:   Trivial patch: fdisk doesn't recognize my partitions
Message-ID:  <XFMail.20021128230029.riccardo@torrini.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20021128230029.riccardo>