Subject: bin/26510: fdisk on blank disk fails if /usr/mdec/mbr nonexistant
To: None <gnats-bugs@gnats.netbsd.org>
From: Darrin B. Jewell <dbj@netbsd.org>
List: netbsd-bugs
Date: 08/02/2004 02:07:44
>Number:         26510
>Category:       bin
>Synopsis:       fdisk on blank disk fails if /usr/mdec/mbr nonexistant
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 02 06:10:01 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Darrin B. Jewell
>Release:        NetBSD 2.0E
>Organization:
>Environment:
>Description:
fdisk on blank disk fails if /usr/mdec/mbr nonexistant

This occurred while trying to partition a disk from a trimmed
memory disk that did not contain /usr/mdec/mbr nor needed
to install boot code.

>How-To-Repeat:

# dd if=/dev/zero of=/dev/rwd1d count=100 bs=64k
100+0 records in
100+0 records out
6553600 bytes transferred in 0.198 secs (33098989 bytes/sec)
# /tmp/fdisk -v -u wd1
fdisk: primarypartition table invalid, no magic in sector 0
fdisk: /usr/mdec/mbr: No such file or directory

>Fix:

Not sure, but code inspection reveals that init_sector0 passes 1 to
the err_exit parameter of read_boot in fdisk.c
>Release-Note:
>Audit-Trail:
>Unformatted: