NetBSD Problem Report #49217

From tron@zhadum.org.uk  Fri Sep 19 08:58:59 2014
Return-Path: <tron@zhadum.org.uk>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8E4E1A65EB
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 19 Sep 2014 08:58:59 +0000 (UTC)
Message-Id: <20140919085855.3490BF8ECA@lyssa.zhadum.org.uk>
Date: Fri, 19 Sep 2014 09:58:55 +0100 (BST)
From: tron@zhadum.org.uk
Reply-To: tron@zhadum.org.uk
To: gnats-bugs@NetBSD.org
Subject: "installboot" fails under NetBSD/amd64
X-Send-Pr-Version: 3.95

>Number:         49217
>Category:       kern
>Synopsis:       "installboot" fails under NetBSD/amd64
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 19 09:00:01 +0000 2014
>Last-Modified:  Fri Sep 19 18:45:00 +0000 2014
>Originator:     tron@zhadum.org.uk
>Release:        NetBSD 7.99.1 sources from HEAD from 2014-09-19 ~06:30 UTC
>Organization:
Matthias Scheler                                 https://zhadum.org.uk/
>Environment:
System: NetBSD lyssa.zhadum.org.uk 7.99.1 NetBSD 7.99.1 (GENERIC) #0: Fri Sep 19 09:13:02 BST 2014 tron@lyssa.zhadum.org.uk:/src/sys/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
It seems that "installboot" can no longer update bootblocks under
NetBSD/amd64 current:

	tron@lyssa:~#installboot -v /dev/rwd0a /usr/mdec/bootxx_ffsv1
	installboot: Opening file system `/dev/rwd0a' read-write: Device busy

Martin Husemann suggested that this problem is a result of the
wedges auto-configuration changes. I'm therefore submitting this in
category "kern" rather than "amd64".

>How-To-Repeat:
Read installboot(1) and follow the instructions for installing the bootblock.

>Fix:
Not known.

>Audit-Trail:
From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/49217: "installboot" fails under NetBSD/amd64
Date: Fri, 19 Sep 2014 16:25:14 +0700

     Date:        Fri, 19 Sep 2014 09:00:01 +0000 (UTC)
     From:        tron@zhadum.org.uk
     Message-ID:  <20140919090001.22862A65EE@mollari.NetBSD.org>

   | 	tron@lyssa:~#installboot -v /dev/rwd0a /usr/mdec/bootxx_ffsv1
   | 	installboot: Opening file system `/dev/rwd0a' read-write: Device busy

   | >How-To-Repeat:
   | Read installboot(1) and follow the instructions for installing the bootblock

 When you read the instructions you're supposed to recognise that the
 examples are just that, examples, and not intended to be taken literally
 in all circumstances.   In current (for now anyway, it is likely to
 change back soon, it seems) as Martin told you, the old device names no
 longer work, anywhere, as part of the user interface - you need to use the
 appropriate wedge name instead.  Everywhere.  Installboot is just one
 place where that is true.

 Perhaps installboot(8) could have an extra example added to show how
 to installboot onto a wedge, but since the difference is just to replace
 wd0a with dkN (for some integer N) (just as you would have to replace wd0a
 with wd1a, or sd0a, or something else in appropriate circumstances) I'm
 not sure even that is required.

 This PR should close, there is no installboot or kernel bug here.

 kre

From: Matthias Scheler <tron@zhadum.org.uk>
To: Robert Elz <kre@munnari.OZ.AU>
Cc: NetBSD GNATS <gnats-bugs@NetBSD.org>
Subject: Re: kern/49217: "installboot" fails under NetBSD/amd64
Date: Fri, 19 Sep 2014 13:30:39 +0100

 On Fri, Sep 19, 2014 at 09:30:01AM +0000, Robert Elz wrote:
 >    | 	tron@lyssa:~#installboot -v /dev/rwd0a /usr/mdec/bootxx_ffsv1
 >    | 	installboot: Opening file system `/dev/rwd0a' read-write: Device busy
 >  
 >    | >How-To-Repeat:
 >    | Read installboot(1) and follow the instructions for installing the bootblock
 >  
 >  When you read the instructions you're supposed to recognise that the
 >  examples are just that, examples, and not intended to be taken literally
 >  in all circumstances.

 If I'm not mistaken the current example *will not work on any system*.
 It will definitely not work on system with SATA or IDE disks (my use case).
 And it will also mislead people who use SCSI or hardware RAID drives to
 use "sd0a" or "ld0a". And neither of those will work.

 So unless we fix the behaviour (see below) there is at least a
 documentation bug.

 >  Perhaps installboot(8) could have an extra example added to show how
 >  to installboot onto a wedge, but since the difference is just to replace
 >  wd0a with dkN (for some integer N) (just as you would have to replace wd0a
 >  with wd1a, or sd0a, or something else in appropriate circumstances) I'm
 >  not sure even that is required.

 It seems that "mount" understand wedges. Because without changing my
 "fstab" from "wd0*" to "dk*" mount(8) just worked. The file systems
 got mounted and df(1) reports "dk0" and "dk2" as the devices afterwards.

 So there is clearly a user friendly way to handle this problem.

 >  This PR should close, there is no installboot or kernel bug here.

 Well, I happen to disagree.

 	Kind regards

 -- 
 Matthias Scheler                                 https://zhadum.org.uk/

From: Robert Elz <kre@munnari.OZ.AU>
To: Matthias Scheler <tron@zhadum.org.uk>
Cc: NetBSD GNATS <gnats-bugs@NetBSD.org>
Subject: Re: kern/49217: "installboot" fails under NetBSD/amd64
Date: Sat, 20 Sep 2014 01:37:15 +0700

     Date:        Fri, 19 Sep 2014 13:30:39 +0100
     From:        Matthias Scheler <tron@zhadum.org.uk>
     Message-ID:  <20140919123039.GB27963@colwyn.zhadum.org.uk>

   | If I'm not mistaken the current example *will not work on any system*.

 No, wedge autodiscovery is a kernel compile option (which has now been
 turned off for the distributed binary kernels .. and when it comes back
 could perhaps be settable via sysctl) - the example would have worked
 fine for some of my kernels, as I build my own with my own kernel config
 files, in which the auto-discovery option was never enabled.   (Only some
 of mine, on other I use GPT partitioning, and wd0a never works, for anything.)

   | It seems that "mount" understand wedges.

 Yes, mount does, as do a few other commands - but certainly not all.
 One time use commands (like installboot) probably never really need to,
 they're essentially only ever run by humans, or just possibly by software
 that looks to see wat devices are available, and offers a human a menu
 of choices.   But there are a whole bunch of other places where knowledge
 of wedge names really is either necessary, or at least, difficult to
 survive without it.

   | >  This PR should close, there is no installboot or kernel bug here.

 The wedge autodiscovery option has been turned off again now, so
 future kernel builds will get wd0a back again...  So, even if therfe
 were a doc "bug" (if I were fixing it, I'd get rid of specific plausible
 device names in all examples - they're correct for some people, incorrect
 for others, which is a state that always leads to confusion ... "It works
 for me" "It fails every time I try it"...) and replace them with meaningless
 tokens that work for no-one, but which obviously need to be replaced.

 kre

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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.