NetBSD Problem Report #37846

From root@garbled.net  Wed Jan 23 06:43:34 2008
Return-Path: <root@garbled.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id DCB3463B938
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 23 Jan 2008 06:43:33 +0000 (UTC)
Message-Id: <20080123064504.2269A5B20F@polaris.garbled.net>
Date: Tue, 22 Jan 2008 23:45:04 -0700 (MST)
From: root@garbled.net
Reply-To: root@garbled.net
To: gnats-bugs@gnats.NetBSD.org
Subject: fdisk default argument is sometimes wrong
X-Send-Pr-Version: 3.95

>Number:         37846
>Category:       bin
>Synopsis:       fdisk default argument is sometimes wrong
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 23 06:45:00 +0000 2008
>Last-Modified:  Wed Jan 23 17:25:00 +0000 2008
>Originator:     Tim Rightnour
>Release:        NetBSD 4.99.49
>Organization:

>Environment:


System: NetBSD polaris.garbled.net 4.0_BETA2 NetBSD 4.0_BETA2 (GENERIC) #14: Sun Mar 25 01:26:44 MST 2007 root@polaris.garbled.net:/usr/src/obj/i386/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

While netbooting my ofppc machine on NetBSD 4.99.49, I accidentally ran
fdisk -u and forgot the disk argument, and was presented with this little gem:

# fdisk -u
fdisk: /dev/rpcn0c: No such file or directory

my network device is a pcn0, and thats what I've mounted root via.

>How-To-Repeat:

boot with NFS root, run fdisk.

>Fix:
Dunno.


>Audit-Trail:
From: Antti Kantee <pooka@cs.hut.fi>
To: root@garbled.net
Cc: gnats-bugs@NetBSD.org
Subject: Re: bin/37846: fdisk default argument is sometimes wrong
Date: Wed, 23 Jan 2008 12:23:22 +0200

 On Wed Jan 23 2008 at 06:45:00 +0000, Tim Rightnour wrote:
 > >Description:
 > 
 > While netbooting my ofppc machine on NetBSD 4.99.49, I accidentally ran
 > fdisk -u and forgot the disk argument, and was presented with this little gem:
 > 
 > # fdisk -u
 > fdisk: /dev/rpcn0c: No such file or directory
 > 
 > my network device is a pcn0, and thats what I've mounted root via.
 > 	
 > >How-To-Repeat:
 > 
 > boot with NFS root, run fdisk.
 > 	
 > >Fix:
 > Dunno.

 What would you want it to do?  Fail with usage if the default can't be
 opened?  Present different usage if the default device is there or not?
 Remove the default disk functionality completely?  Scan for the "first"
 disktype device?  ... read your mind to guess the device you wanted to
 operate on?

 Apart from maybe the last one (which is slightly difficult to implement),
 I don't see anything to do to improve the situation in a way which
 wouldn't be confusing from some aspect.  It would nice to always require
 the device argument, but that would doubtless break someone's scripts.

 -- 
 Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
 http://www.iki.fi/pooka/                          http://www.NetBSD.org/
     "la qualité la plus indispensable du cuisinier est l'exactitude"

From: Juan RP <juan@xtrarom.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/37846: fdisk default argument is sometimes wrong
Date: Wed, 23 Jan 2008 11:28:37 +0100

 On Wed, 23 Jan 2008 10:25:02 +0000 (UTC)
 Antti Kantee <pooka@cs.hut.fi> wrote:

 >  Apart from maybe the last one (which is slightly difficult to implement),
 >  I don't see anything to do to improve the situation in a way which
 >  wouldn't be confusing from some aspect.  It would nice to always require
 >  the device argument, but that would doubtless break someone's scripts.

 That's what I wanted to suggest... but perhaps nobody agrees.

 -- 
 Juan Romero Pardines       - The NetBSD Project
 http://plog.xtrarom.org    - NetBSD/pkgsrc news in Spanish

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: bin/37846: fdisk default argument is sometimes wrong
Date: Wed, 23 Jan 2008 21:12:48 +0900

 root@garbled.net wrote:

 > # fdisk -u
 > fdisk: /dev/rpcn0c: No such file or directory

 IMHO fdisk(8) should not expect a default disk.
 If a user omits to specify his disk on fdisk command,
 boot disk could easily be mangled.
 ---
 Izumi Tsutsui

From: Tim Rightnour <root@garbled.net>
To: Antti Kantee <pooka@cs.hut.fi>
Cc: gnats-bugs@NetBSD.org
Subject: Re: bin/37846: fdisk default argument is sometimes wrong
Date: Wed, 23 Jan 2008 10:24:39 -0700 (MST)

 On 23-Jan-2008 Antti Kantee wrote:
 > What would you want it to do?

 Actually.. I think the easiest solution, that would keep the current
 functionality of assuming you want to operate on your boot disk, would be to
 embed a short list of disk drivers into the utility, and if bootdev isn't one of
 those, just drop usage.  (we only have like 5 or 6 disk drivers in the tree,
 and it hardly has to be kept up to date, as in reality, you probably only care
 about fd, sd and wd)

 However, short of that, I think its much much more rediculous to attempt to
 open my network device's raw partition.  The error it spits out is completely
 nonsensical.

 I could also see it's guessing be rather dangerous, if your root disk is a
 raid, it defaults to that:

 polaris# fdisk
 fdisk: primary partition table invalid, no magic in sector 0
 fdisk: Cannot determine the number of heads
 Disk: /dev/rraid0d

 ---
 Tim Rightnour <root@garbled.net>
 NetBSD: Free multi-architecture OS http://www.netbsd.org/
 Genecys: Open Source 3D MMORPG: http://www.genecys.org/

>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.