From owner-freebsd-current@FreeBSD.ORG Thu Feb 19 13:11:29 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 E331716A4CE for ; Thu, 19 Feb 2004 13:11:29 -0800 (PST) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEAA243D1D for ; Thu, 19 Feb 2004 13:11:29 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) i1JLBQTA034155; Thu, 19 Feb 2004 13:11:26 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost)i1JLBQVg034154; Thu, 19 Feb 2004 13:11:26 -0800 (PST) (envelope-from sgk) Date: Thu, 19 Feb 2004 13:11:25 -0800 From: Steve Kargl To: Aaron Peterson Message-ID: <20040219211125.GA34078@troutmask.apl.washington.edu> References: <9615.162.114.211.143.1077213472.squirrel@mail.alpete.com> <20040219201520.GB44313@cicely12.cicely.de> <29352.162.114.211.143.1077222503.squirrel@mail.alpete.com> <20040219204012.GA33771@troutmask.apl.washington.edu> <46490.162.114.211.143.1077223809.squirrel@mail.alpete.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46490.162.114.211.143.1077223809.squirrel@mail.alpete.com> User-Agent: Mutt/1.4.1i cc: freebsd-current@freebsd.org cc: ticso@cicely.de Subject: Re: bcwipe won't wipe a block device... 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: Thu, 19 Feb 2004 21:11:30 -0000 > > > > Use ktrace or truss to see if bcwipe is actually opening /dev/da0 > > or /dev/rda0 or /dev/da0c. > > > > The output was too long I though to post back to the list from > ktrace/kdump... you can read it here: > > http://www.alpete.com/bcwipe.kdump.txt > > I'm not so good at understanding it since it is the first time I've ever > used ktrace :) I think I understand some of it, but I still don't > understand the problem, so perhaps you guys can shed some light on the > subject for me... I'm no expert either, but that never stopped me from commenting on a topic :-). Here's the relevant part. ktrace shows that bcwipe has opened /dev/da0. 13661 bcwipe CALL access(0xbfbfee71,0x6) 13661 bcwipe NAMI "/dev/da0" 13661 bcwipe RET access 0 13661 bcwipe CALL open(0xbfbfee71,0x82,0xbfbfee71) 13661 bcwipe NAMI "/dev/da0" 13661 bcwipe RET open 3 I haven't looked up what the lseek syscall does, but I suspect that you are seek to the start of the file here and you have succeeded 13661 bcwipe CALL lseek(0x3,0,0,0,0x2) 13661 bcwipe RET lseek 0 Here'w where the problems begin. It looks like you are seeking beyond the end of the device. lseek fails and bcwipe isn't handling the failure correctly. 13661 bcwipe CALL lseek(0x3,0,0xffffffff,0x7fffffff,0) 13661 bcwipe RET lseek -1/0xffffffff 13661 bcwipe CALL read(0x3,0xbfbeeba0,0x1) 13661 bcwipe RET read -1 errno 22 Invalid argument -- Steve