From owner-freebsd-current@FreeBSD.ORG Thu Feb 19 13:21:47 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 5412416A4CE for ; Thu, 19 Feb 2004 13:21:47 -0800 (PST) Received: from ex-nihilo-llc.com (ex-nihilo-llc.com [206.114.147.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C22043D1F for ; Thu, 19 Feb 2004 13:21:47 -0800 (PST) (envelope-from aaron@alpete.com) Received: from mail.alpete.com (localhost [127.0.0.1]) by ex-nihilo-llc.com (Postfix) with SMTP id 318816F5; Thu, 19 Feb 2004 16:23:55 -0500 (EST) Received: from 162.114.211.143 (proxying for 172.26.45.231) (SquirrelMail authenticated user aaron@alpete.com) by mail.alpete.com with HTTP; Thu, 19 Feb 2004 16:23:55 -0500 (EST) Message-ID: <26399.162.114.211.143.1077225835.squirrel@mail.alpete.com> In-Reply-To: <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> <20040219211125.GA34078@troutmask.apl.washington.edu> Date: Thu, 19 Feb 2004 16:23:55 -0500 (EST) From: "Aaron Peterson" To: "Steve Kargl" User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal cc: freebsd-current@freebsd.org cc: ticso@cicely.de cc: Aaron Peterson Subject: Re: bcwipe won't wipe a block device... X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: aaron@alpete.com 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:21:47 -0000 > 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 Just for fun, here's the kdump from the "dd if=/dev/urandom bs=1024 count=5 of=/dev/da0" which was successful: http://www.alpete.com/dd.da0.kdump.txt Looks like the open call, plus some: 13760 dd CALL open(0x804f063,0x602,0x1b6) 13760 dd NAMI "/dev/da0" 13760 dd RET open 4 13760 dd CALL fstat(0x4,0xbfbfeca0) 13760 dd RET fstat 0 13760 dd CALL ioctl(0x4,FIODTYPE,0xbfbfec9c) 13760 dd RET ioctl 0 and i don't see much else useful in there... sooo.... how might i fix this? learn C and fix bcwipe? heh...