NetBSD Problem Report #34807

From jam@fs.localdomain  Fri Oct 13 13:29:07 2006
Return-Path: <jam@fs.localdomain>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id D086263B84D
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 13 Oct 2006 13:29:06 +0000 (UTC)
Message-Id: <20061013132801.63AE1E4655@fs.localdomain>
Date: Fri, 13 Oct 2006 22:28:01 +0900 (JST)
From: jam@pobox.com
Reply-To: jam@pobox.com
To: gnats-bugs@NetBSD.org
Subject: fdisk displays sector wrongly
X-Send-Pr-Version: 3.95

>Number:         34807
>Category:       bin
>Synopsis:       fdisk displays sector number wrongly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 13 13:30:01 +0000 2006
>Closed-Date:    Fri Oct 09 21:16:41 +0000 2009
>Last-Modified:  Thu Dec 24 04:55:01 +0000 2009
>Originator:     Kazushi (Jam) Marukawa
>Release:        NetBSD 4.99.3
>Organization:
none
>Environment:
System: NetBSD fs 4.99.3 NetBSD 4.99.3 (XEN3_DOM0) #1: Sat Sep 30 20:35:41 JST 2006 jam@fs:/var/obj/mnt/raid/netbsd/current/src/sys/arch/i386/compile/XEN3_DOM0 i386
Architecture: i386
Machine: i386
>Description:
	I connected a 1.8G RAID5 disk (hard-ware RAID) to NetBSD.  Then,
	ran fdisk -u.  fdisk says following:

	    # fdisk ld0
	    fdisk: primary partition table invalid, no magic in sector 0
	    fdisk: Cannot determine the number of heads
	    Disk: /dev/rld0d
	    NetBSD disklabel disk geometry:
	    cylinders: 233418, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
	    total sectors: 3749867520

	    BIOS disk geometry:
	    cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
	    total sectors: 3749867520

	    Partition table:
	    0: <UNUSED>
	    1: <UNUSED>
	    2: <UNUSED>
	    3: <UNUSED>
	    Bootselector disabled.
	    root@fs(p2)# fdisk -u ld0
	    fdisk: primary partition table invalid, no magic in sector 0
	    fdisk: Cannot determine the number of heads
	    Disk: /dev/rld0d
	    NetBSD disklabel disk geometry:
	    cylinders: 233418, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
	    total sectors: 3749867520

	    BIOS disk geometry:
	    cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
	    total sectors: 3749867520

	    Do you want to change our idea of what BIOS thinks? [n]

	    Partition table:
	    0: <UNUSED>
	    1: <UNUSED>
	    2: <UNUSED>
	    3: <UNUSED>
	    Bootselector disabled.
	    Which partition do you want to change?: [none] 0
	    The data for partition 0 is:
	    <UNUSED>
	    sysid: [0..255 default: 169]
	    start: [0..233418cyl default: 63, 0cyl, 0MB]
	    size: [0..233418cyl default: -545099839, 233418cyl, 4294701135MB]
	    bootmenu: []

	    Partition table:
	    0: NetBSD (sysid 169)
		start 63, size 3749867457 (1830990 MB, Cyls 0-233418/116/43)
	    1: <UNUSED>
	    2: <UNUSED>
	    3: <UNUSED>
	    Bootselector disabled.
	    Which partition do you want to change?: [none]

	    We haven't written the MBR back to disk yet.  This is your last chance.
	    Partition table:
	    0: NetBSD (sysid 169)
		start 63, size 3749867457 (1830990 MB, Cyls 0-233418/116/43)
	    1: <UNUSED>
	    2: <UNUSED>
	    3: <UNUSED>
	    Bootselector disabled.
	    Should we write new partition table? [n] y

	fdisk said "default: -545099839, 233418cyl, 4294701135MB".
	-545099839 sectors, 233418 cylinders, 4,294TB.  I wish if
	I had such big drives.  ;-)

	Nevermind.  Anyway, a part of fdisk output was wrong.
>How-To-Repeat:
	Connect 1.8TB disk and initialize it by fdisk?
>Fix:
	fdisk source code has too many "int" although it should be
	"unsigned int" or "daddr_t".  I'm not sure how to fix all.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Wed, 05 Aug 2009 21:32:49 +0000
State-Changed-Why:
Fix applied, but I don't have a large enough disk to test this.
I presume only the output displayed was actually wrong.


From: David Laight <dsl@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/34807 CVS commit: src/sbin/fdisk
Date: Wed, 5 Aug 2009 21:31:50 +0000

 Module Name:	src
 Committed By:	dsl
 Date:		Wed Aug  5 21:31:50 UTC 2009

 Modified Files:
 	src/sbin/fdisk: fdisk.c

 Log Message:
 Change arguments to decimal() to be int64_t.
 They need to be able to hold disk sector numbers > 2^31 and also -1.
 Should fix PR/34807


 To generate a diff of this commit:
 cvs rdiff -u -r1.122 -r1.123 src/sbin/fdisk/fdisk.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Fri, 09 Oct 2009 21:16:41 +0000
State-Changed-Why:
2 months in feedback is probably enough


From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/34807 CVS commit: [netbsd-5] src/sbin/fdisk
Date: Thu, 24 Dec 2009 04:54:47 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Thu Dec 24 04:54:47 UTC 2009

 Modified Files:
 	src/sbin/fdisk [netbsd-5]: fdisk.c

 Log Message:
 Pull up following revision(s) (requested by dsl in ticket #1201):
 	sbin/fdisk/fdisk.c: revision 1.123
 Change arguments to decimal() to be int64_t.
 They need to be able to hold disk sector numbers > 2^31 and also -1.
 Should fix PR/34807


 To generate a diff of this commit:
 cvs rdiff -u -r1.116.6.1 -r1.116.6.2 src/sbin/fdisk/fdisk.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.