NetBSD Problem Report #42091
From john@reva.xtremeunix.com Fri Sep 18 21:57:24 2009
Return-Path: <john@reva.xtremeunix.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id 6A45863BC1D
for <gnats-bugs@gnats.NetBSD.org>; Fri, 18 Sep 2009 21:57:24 +0000 (UTC)
Message-Id: <200909182156.n8ILuvCX025277@reva.xtremeunix.com>
Date: Fri, 18 Sep 2009 21:56:57 GMT
From: john@ziaspace.com
Reply-To: john@ziaspace.com
To: gnats-bugs@gnats.NetBSD.org
Subject: ld devices can't be set up with more than 2^31 sectors
X-Send-Pr-Version: 3.95
>Number: 42091
>Category: port-amd64
>Synopsis: ld devices can't be set up with more than 2^31 sectors
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: port-amd64-maintainer
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Sep 18 22:00:00 +0000 2009
>Closed-Date: Mon May 27 04:46:58 +0000 2019
>Last-Modified: Mon May 27 04:46:58 +0000 2019
>Originator: John Klos
>Release: NetBSD 5.0_STABLE (tested with current, too)
>Organization:
>Environment:
System: NetBSD reva.xtremeunix.com 5.0_STABLE NetBSD 5.0_STABLE (REVA-$Revision: 5.323 $) #0: Tue Sep 8 06:27:49 UTC 2009 john@sage.klos.com:/usr/obj/sys/arch/amiga/compile/REVA amiga
Architecture: m68k
Machine: amiga
>Description:
>How-To-Repeat:
Set up some sort of hardware RAID:
siisata0 at pci6 dev 0 function 0: vendor 0x1095 product 0x3132 (RAID mass storage, revision 0x01)
ataraid0: found 1 RAID volume
ld0 at ataraid0 vendtype 3 unit 0: nVidia ATA RAID-1 array
ld0: 1397 GB, 182401 cyl, 255 head, 63 sec, 512 bytes/sect x 2930277120 sectors
Then try to install NetBSD or to create a disklabel partition greater than
2^31 sectors:
partition> P
4 partitions:
# size offset fstype [fsize bsize cpg/sgs]
d: 2930277120 0 unused 0 0 # (Cyl. 0 - 182401*)
partition> a
Filesystem type [?] [unused]: 4.2BSD
Start offset ('x' to start after partition 'x') [0c, 0s, 0M]: 64
Partition size ('$' for all remaining) [0c, 0s, 0M]: 2913499840
a: 2147483648 64 4.2BSD 0 0 0 # (Cyl. 0*- 133674*)
>Fix:
>Release-Note:
>Audit-Trail:
From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: port-amd64/42091: ld devices can't be set up with more than
2^31 sectors
Date: Wed, 18 Nov 2009 19:52:55 +0000
This looks like it could be caused by disklabel(8)'s getnum() returning
'int'. This function seems to only be used in interactive (-i) mode,
so maybe -e mode would work.
In any case, the disklabel can only hold 32-bit sector counts and offsets.
So, until 2TiB+ disks come about (IOW the next generation of disks),
we're mostly fine.
State-Changed-From-To: open->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Sun, 22 Nov 2009 17:44:10 +0000
State-Changed-Why:
I think all the issues with disklabels between 2^31 and 2^32 sectors
have been fixed. If not there will be duplicate PRs elsewhere.
Disks larger than 2^32 sectors are a bigger problem.
From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: port-amd64/42091: ld devices can't be set up with more than
2^31 sectors
Date: Wed, 25 Nov 2009 02:13:36 +0000
Changing the "rv = (int) ..." lines in interact.c:getnum() to "rv =
(uint32_t) ..." fixes the problem on a (virtual) 1.5TB drive for me.
But it looks like much of that file isn't perfectly unsigned-safe.
State-Changed-From-To: closed->analyzed
State-Changed-By: jakllsch@NetBSD.org
State-Changed-When: Wed, 25 Nov 2009 02:23:50 +0000
State-Changed-Why:
A fix is possible, and the problem hasn't gone away.
From: Stephen Borrill <netbsd@precedence.co.uk>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-amd64/42091: ld devices can't be set up with more than 2^31
sectors
Date: Wed, 25 Nov 2009 10:22:01 +0000 (GMT)
This is only a problem in the interactive part of disklabel(8)
(as shown by the fact that jakllsch's patch is for interact.c). It's not a
problem with the disklabel itself (which was dsl's reason for closing).
If you hand-edit a disklabel and restore with disklabel -R it works fine.
I'd be tempted to use daddr_t throughout and then check against UINT32_MAX
when coming to write out the label (or at various other times when a
warning would be appropriate).
From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-amd64/42091: ld devices can't be set up with more than 2^31
sectors
Date: Mon, 27 May 2019 02:37:46 +0000
Is this an issue with GPT instead of disklabel?
I think we were abandoning disklabel in favour of other formats instead
of extending it to 64bit.
State-Changed-From-To: analyzed->closed
State-Changed-By: mlelstv@NetBSD.org
State-Changed-When: Mon, 27 May 2019 04:46:58 +0000
State-Changed-Why:
This is about a limitation in the disklabel tool, it was fixed with PR bin/43354.
>Unformatted:
When using drives larger than 1TB in a hardware mirror, partitions can't have more than 2^31 sectors.
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.