From owner-freebsd-current@FreeBSD.ORG Tue Mar 30 04:29:00 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ABD0D16A4CE; Tue, 30 Mar 2004 04:29:00 -0800 (PST) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0132643D41; Tue, 30 Mar 2004 04:29:00 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i2UCSw5v011468; Tue, 30 Mar 2004 22:28:58 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i2UCSuGQ019677; Tue, 30 Mar 2004 22:28:57 +1000 Date: Tue, 30 Mar 2004 22:28:55 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Ruslan Ermilov In-Reply-To: <20040330105705.GB92824@ip.net.ua> Message-ID: <20040330214400.X10192@gamplex.bde.org> References: <20040329163926.A38109@xorpc.icir.org> <20040330005013.GA53546@ns1.xcllnt.net> <20040329234212.A72990@xorpc.icir.org><40692D02.5090700@freebsd.org> <20040330003408.A75276@xorpc.icir.org> <406938A1.9030507@freebsd.org> <20040330105705.GB92824@ip.net.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Luigi Rizzo cc: Hartmut Brandt cc: current@FreeBSD.org cc: Marcel Moolenaar Subject: Re: proposed bsdlabel patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2004 12:29:00 -0000 On Tue, 30 Mar 2004, Ruslan Ermilov wrote: > On Tue, Mar 30, 2004 at 11:06:41AM +0200, Hartmut Brandt wrote: > > Not really. rm has no magic that interpretes da0 as /dev/da0. If you > > happen to have a file da0 in your current directory (let's say the saved > > disklabel or so) and specify just da0 to disklabel expecting that it > > will work on /dev/da0 it will unexpecedly clobber your file. Such > > automatisms make things not easier, but more complex - you have to > > remember them. You need to get the habit to do ls -l before you do > > disklabel da0. I'd say keep the '-f' option, that'll make things clearer. I agree. The conversions are hard to remember and different for almost every utility that perpetrates them. I never have problems with this though. Clobbering real disks is easy enough that I usually do much more than ls to check that I'm writing to the disk that I want. > FWIW, fdisk(8), diskinfo(8), fsck_ffs(8) (and probably others) > prefer the file in the current directory to a /dev entry. The misbehaviour of fsck_ffs is actually more complicated: - In 4.4BSD (where fsck_ffs was plain fsck), fsck actually operated on the specified pathname. - Merging NetBSD's fsck driver gave some or all of the following conversions: --- The driver part (fsck) adds a /dev prefix if the specified pathname doesn't contain _any_ slashes, so ./foo works right, unlike for bsdlabel. --- The fsck_ffs part starts by adding a /dev prefix under the same condition as fsck, so ./foo (almost) works right. --- If fsck_fsck can't stat the file under its (possibly) converted pathname, then it (fsck_ffs) prints a message and continues with the specified pathname. This causes various misbehaviours, e.g., duplicate error messages. Bruce