From owner-freebsd-bugs@FreeBSD.ORG Fri Jul 9 15:50:03 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 571D71065675 for ; Fri, 9 Jul 2010 15:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3492F8FC1F for ; Fri, 9 Jul 2010 15:50:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o69Fo2IJ023441 for ; Fri, 9 Jul 2010 15:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o69Fo2X6023440; Fri, 9 Jul 2010 15:50:02 GMT (envelope-from gnats) Resent-Date: Fri, 9 Jul 2010 15:50:02 GMT Resent-Message-Id: <201007091550.o69Fo2X6023440@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Daniel Feenberg Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BF9D106564A for ; Fri, 9 Jul 2010 15:40:49 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 123D38FC12 for ; Fri, 9 Jul 2010 15:40:49 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o69FelKq080965 for ; Fri, 9 Jul 2010 15:40:47 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o69FelM9080964; Fri, 9 Jul 2010 15:40:47 GMT (envelope-from nobody) Message-Id: <201007091540.o69FelM9080964@www.freebsd.org> Date: Fri, 9 Jul 2010 15:40:47 GMT From: Daniel Feenberg To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/148471: fdisk prompts with negative partition size X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 15:50:03 -0000 >Number: 148471 >Category: misc >Synopsis: fdisk prompts with negative partition size >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jul 09 15:50:02 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Daniel Feenberg >Release: 8.0-Release p2 >Organization: National Bureau of Economic Research >Environment: FreeBSD bulk4 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5 16:02:27 UTC 2010 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386 >Description: With one of the new 2TB Samsung SATA drives with a 3ware controller (in single drive mode), fdisk reacts in a bizarre manner. Although it seems to extract the proper drive characteristics: > parameters extracted from in-core disklabel are: > cylinders=243151 heads=255 sectors/track=63 (16065 blks/cyl) When I modify parition 1 and accept all defaults, it suggests a negative value for size: > Do you want to change it? [n] y > > The static data for the slice 1 has been reinitialized to: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 63, size 3906220752 (1907334 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 462/ head 254/ sector 63 > Supply a decimal value for "sysid (165=FreeBSD)" [165] > Supply a decimal value for "start" [63] > Supply a decimal value for "size" [-388746544] > Explicitly specify beg/end address ? [n] > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 63, size 3906220752 (1907334 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 462/ head 254/ sector 63 > Are we happy with this entry? [n] y Notice that the suggested value for size is -388746544 and the suggested end cylinder is 462 - both of which are implausible and inconsistent. Here is the info from dmesg about the drive: >How-To-Repeat: Obtain 2TB Samsung drive (and possibly 3Ware controller) and run fdisk -i /dev/... accepting all defaults as one defines a new partion. Note that this problem did not arise with 300GB drives on the same controller and an earlier version of FreeBSD. >Fix: Beyond my knowledge, but I can guess the problem comes from 32 bit integers, and perhaps upgrading to 64 bit FreeBSD would solve the problem for me. However, the bizarre behavior is a bug - if fdisk can't deal with the disk or controller it could say so explicitly. >Release-Note: >Audit-Trail: >Unformatted: >a2 at twa0 bus 0 target 2 lun 0 da2: Fixed Direct Access SCSI-3 device