NetBSD Problem Report #41127

From www@NetBSD.org  Fri Apr  3 13:05:26 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id DF95263B946
	for <gnats-bugs@gnats.netbsd.org>; Fri,  3 Apr 2009 13:05:26 +0000 (UTC)
Message-Id: <20090403130526.9A54963B8C8@www.NetBSD.org>
Date: Fri,  3 Apr 2009 13:05:26 +0000 (UTC)
From: kaph@zhaw.ch
Reply-To: kaph@zhaw.ch
To: gnats-bugs@NetBSD.org
Subject: Creating a new filesystem on usbstick fails
X-Send-Pr-Version: www-1.0

>Number:         41127
>Category:       kern
>Synopsis:       Creating a new filesystem on usbstick fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 03 13:10:00 +0000 2009
>Closed-Date:    Sun Feb 12 19:49:16 +0000 2012
>Last-Modified:  Sun Feb 12 19:49:16 +0000 2012
>Originator:     Christoph Kaegi
>Release:        5.0_RC2 20090315
>Organization:
>Environment:
NetBSD clt-mob-v-0289 5.0_RC2 NetBSD 5.0_RC2 (GENERIC) #0: Sun Mar 15 21:32:21 UTC 2009  builds@b6.netbsd.org:/home/builds/ab/netbsd-5/i386/200903150000Z-obj/home/builds/ab/netbsd-5/src/sys/arch/i386/compile/GENERIC i386
>Description:

Sticking a freshly cleaned (dd if=/dev/zero of=/dev/sd0d bs=512 count=1)
usb stick into the machine, labeling it (disklabel -re sd0) and trying to create an ufs filesystem on it (newfs /dev/sd0a) fails with:

newfs: /dev/sd0a: open for write: Device busy

Nothing obvious uses the usb stick. Rebooting changes nothing. Tested on Dell Latitude E6400 and a Dell Desktop GX280.

Accessing an usb stick which already contains an ffs filesystem works ok.
>How-To-Repeat:

- put an usb stick into your 5.0_RC2 machine
- dd if=/dev/zero of=/dev/sd?d bs=512 count=1
- disklabel -re sd?
- newfs /dev/sd??
>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->analyzed
State-Changed-By: pooka@NetBSD.org
State-Changed-When: Fri, 03 Apr 2009 16:23:17 +0300
State-Changed-Why:
creating a file system on a block device is not supported.
can you suggest documentation improvements to make this clear?


From: Antti Kantee <pooka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41127 CVS commit: src/sbin/newfs
Date: Fri, 3 Apr 2009 13:22:05 +0000

 Module Name:	src
 Committed By:	pooka
 Date:		Fri Apr  3 13:22:05 UTC 2009

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

 Log Message:
 Issue a better error message if attempting to create a file system
 on a block device.  Inspired by PR kern/41127.


 To generate a diff of this commit:
 cvs rdiff -u -r1.102 -r1.103 src/sbin/newfs/newfs.c

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

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/41127: Creating a new filesystem on usbstick fails
Date: Fri, 3 Apr 2009 09:52:25 -0400

 On Apr 3,  1:10pm, kaph@zhaw.ch (kaph@zhaw.ch) wrote:
 -- Subject: kern/41127: Creating a new filesystem on usbstick fails

 | >Number:         41127
 | >Category:       kern
 | >Synopsis:       Creating a new filesystem on usbstick fails
 | >Confidential:   no
 | >Severity:       serious
 | >Priority:       medium
 | >Responsible:    kern-bug-people
 | >State:          open
 | >Class:          sw-bug
 | >Submitter-Id:   net
 | >Arrival-Date:   Fri Apr 03 13:10:00 +0000 2009
 | >Originator:     Christoph Kaegi
 | >Release:        5.0_RC2 20090315
 | >Organization:
 | >Environment:
 | NetBSD clt-mob-v-0289 5.0_RC2 NetBSD 5.0_RC2 (GENERIC) #0: Sun Mar 15 21:32:21 UTC 2009  builds@b6.netbsd.org:/home/builds/ab/netbsd-5/i386/200903150000Z-obj/home/builds/ab/netbsd-5/src/sys/arch/i386/compile/GENERIC i386
 | >Description:
 | 
 | Sticking a freshly cleaned (dd if=/dev/zero of=/dev/sd0d bs=512 count=1)
 | usb stick into the machine, labeling it (disklabel -re sd0) and trying to create an ufs filesystem on it (newfs /dev/sd0a) fails with:
 | 
 | newfs: /dev/sd0a: open for write: Device busy
 | 
 | Nothing obvious uses the usb stick. Rebooting changes nothing. Tested on Dell Latitude E6400 and a Dell Desktop GX280.
 | 
 | Accessing an usb stick which already contains an ffs filesystem works ok.
 | >How-To-Repeat:
 | 
 | - put an usb stick into your 5.0_RC2 machine
 | - dd if=/dev/zero of=/dev/sd?d bs=512 count=1
 | - disklabel -re sd?
 | - newfs /dev/sd??
 | >Fix:


 use /dev/rsd0a ?

 christos

From: Christoph Kaegi <kaph@zhaw.ch>
To: gnats-bugs@NetBSD.org
Cc: christos@zoulas.com
Subject: Re: kern/41127 (Creating a new filesystem on usbstick fails)
Date: Fri, 3 Apr 2009 16:13:54 +0200

 On 03.04-13:23, pooka@NetBSD.org wrote:
 > Synopsis: Creating a new filesystem on usbstick fails
 > 
 > State-Changed-From-To: open->analyzed
 > State-Changed-By: pooka@NetBSD.org
 > State-Changed-When: Fri, 03 Apr 2009 16:23:17 +0300
 > State-Changed-Why:
 > creating a file system on a block device is not supported.
 > can you suggest documentation improvements to make this clear?
 > 

 I'm embarassed... I should have known this!

 Using 'newfs /dev/rsd0a' works of course!

 Regarding documentation improvements: The newfs(8) manpage
 should probably explain what it means by a 'special' device 
 and also include an example.

 The improved error message will help also, I'm sure.

 I'm very impressed by the speed my PR was addressed! I have a bug
 open in another Opensource Project which still shows state 'new'
 and it was entered in December 2007...

 Thank you very much Antti and have a nice weekend.

 Christoph

 -- 
 ----------------------------------------------------------------------
 Christoph Kaegi                                           kaph@zhaw.ch
 ----------------------------------------------------------------------

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41127 CVS commit: [netbsd-5] src/sbin/newfs
Date: Wed, 10 Jun 2009 17:16:13 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Wed Jun 10 17:16:13 UTC 2009

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

 Log Message:
 Pull up following revision(s) (requested by snj in ticket #803):
 	sbin/newfs/newfs.c: revision 1.103
 Issue a better error message if attempting to create a file system
 on a block device.  Inspired by PR kern/41127.


 To generate a diff of this commit:
 cvs rdiff -u -r1.102 -r1.102.2.1 src/sbin/newfs/newfs.c

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

From: dieter roelants <dieter.NetBSD@pandora.be>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/41127 (Creating a new filesystem on usbstick fails)
Date: Sat, 11 Feb 2012 17:26:42 +0100

 Meanwhile, a note got added to the man page explaining whatkind of
 "special" is needed:
      Unless -F is specified, special must be a raw device.  This means that
      for example wd0a or /dev/rwd0a must be specified instead of /dev/wd0a.

 So, is there a reason this PR should remain open?

 dieter

State-Changed-From-To: analyzed->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sun, 12 Feb 2012 19:49:16 +0000
State-Changed-Why:
This was a documentation bug, not a kernel one, and the documentation
has been fixed long ago.


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