NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/37656: fdisk segfault on invalid MBR entries on non-x86 geometry detection



Martin Husemann wrote:
> The following reply was made to PR bin/37656; it has been noted by GNATS.
> 
> From: Martin Husemann <martin%duskware.de@localhost>
> To: John Nemeth <jnemeth%victoria.tc.ca@localhost>
> Cc: Eric Auge <eau%phear.org@localhost>, gnats-bugs%NetBSD.org@localhost
> Subject: Re: bin/37656: fdisk segfault on invalid MBR entries on non-x86 
> geometry detection
> Date: Wed, 2 Jan 2008 11:21:24 +0100
> 
>  On Wed, Jan 02, 2008 at 02:13:59AM -0800, John Nemeth wrote:
>  >      Not sure how this is handled, but yes the MBR would be all 0s.
>  
>  The MBR has a magic number at the end (see MBR_MAGIC_OFFSET and MBR_MAGIC
>  in bootblock.h).
>  
>  Martin

Can fdisk fail in writing this magic number ?
This is an fdisk generated MBR partitioning on the cobalt, all tests
I've done were reporting this bad magic number.

But it now successfully boot, what the purpose of this "magic number" ?

# fdisk
Disk: wd0d
NetBSD disklabel disk geometry:
cylinders: 387621, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 390721968

BIOS disk geometry:
cylinders: 1024, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 390721968

Partition table:
0: Linux native (sysid 131)
    start 63, size 21105 (10 MB, Cyls 0-20)
        PBR is not bootable: All bytes are identical (0x00)
1: Linux swap or Prime or Solaris (sysid 130)
    start 21168, size 1180368 (576 MB, Cyls 21-1191)
        PBR is not bootable: Bad magic number (0x5f6c)>
2: NetBSD (sysid 169)
    start 1201536, size 389520432 (190196 MB, Cyls 1192-387620)
        PBR is not bootable: Bad magic number (0x0000)>
3: <UNUSED>
# uname -a
NetBSD goodvibes 4.0_STABLE NetBSD 4.0_STABLE (GENERIC) #0: Fri Dec 28
13:23:05 CET 2007
root%bearcave.no.phear.org@localhost:/usr/obj/sys/arch/cobalt/compile/GENERIC 
cobalt
#

Thanks,
Regards,
Eric.

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index