From owner-freebsd-questions@FreeBSD.ORG Tue Jul 16 22:10:41 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7FFB0843 for ; Tue, 16 Jul 2013 22:10:41 +0000 (UTC) (envelope-from aurfalien@gmail.com) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [IPv6:2607:f8b0:400e:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 5B72D60E for ; Tue, 16 Jul 2013 22:10:41 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id tj12so1249948pac.12 for ; Tue, 16 Jul 2013 15:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=t/w+A19G1jM+rdmSpqHTw38gnNTF0njOQL4rkT/MzbY=; b=tSs4sPm0tMwTAGboL2j2ma8VlFlAgIOIWNhgAss3g5fwV3w7wcvfnfDNcY0R6EzrmA 9GbDaiQhvlRVWENxW5eyLuYX+2V/z5mM7ptLaSVBI43CW8IHCbJizpilM4pWs+1SBKxb +Npczv/Z36qG+E26TiNVMgRRWfxKP+Q0mFCwiv5AyxZC8cH2EGkzIBbGqEoIf8bTmLI+ tcoEz0C1XjFHptwU/8k9nrN/VDrhenCTzvDP5AaadvWHeYp2OrsntsD3LMd36lUVKAl1 nZ4bHLwKdvGa9D4Uv4R97dPEwX0+TftoXBt2jL3tNrSauiFk3eQ64LCaZZgjz3xltFyi Upkw== X-Received: by 10.66.11.197 with SMTP id s5mr4593938pab.129.1374012641076; Tue, 16 Jul 2013 15:10:41 -0700 (PDT) Received: from briankrusicw.logan.tv ([64.17.255.138]) by mx.google.com with ESMTPSA id wg6sm3990298pbc.3.2013.07.16.15.10.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Jul 2013 15:10:39 -0700 (PDT) Subject: Re: gpart: table 'da0' is corrupt; operation not permitted Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: aurfalien In-Reply-To: Date: Tue, 16 Jul 2013 15:10:37 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <706BDFA7-0C04-4C16-96A7-61C145997554@gmail.com> References: To: Warren Block X-Mailer: Apple Mail (2.1085) Cc: Michael Sierchio , FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2013 22:10:41 -0000 On Jul 16, 2013, at 3:01 PM, Warren Block wrote: > On Tue, 16 Jul 2013, aurfalien wrote: >=20 >>=20 >> On Jul 16, 2013, at 1:50 PM, Michael Sierchio wrote: >>=20 >>> On Tue, Jul 16, 2013 at 1:44 PM, aurfalien = wrote: >>>=20 >>>> Upon doing; >>>>=20 >>>> gpart destroy da0 >>>>=20 >>>> I get; >>>>=20 >>>> gpart: Device busy >>>=20 >>> crude but effective: >>>=20 >>>=20 >>> DISK=3Dda0 >>>=20 >>> offset=3D`diskinfo $DISK | awk '{ print $4 - 131072 }'` >>> dd if=3D/dev/zero of=3D/dev/$DISK bs=3D64k count=3D1 >>> dd if=3D/dev/zero of=3D/dev/$DISK bs=3D64k seek=3D$offset >>>=20 >>> gpart create -s gpt ${DISK} >>=20 >> This is what I ended up doing. >>=20 >> I unplugged it, waited a few, re plugged and then I was able to = delete/destroy. >>=20 >> I will keep your method on hand though as I prefer not doing a hot = plug. >=20 > Hot plug? That just wipes the beginning and end of the disk. I would = erase 1M just to be sure. >=20 > The more elegant version is >=20 > gpart destroy -F da0 Oh for sure, I did that after the hotplug which finally allowed me to f = do it. I had to hot plug a few times though. > If it gives an error when doing that, disabling the safety may be = necessary: sysctl kern.geom.debugflags=3D16 > Do that only when necessary. It usually is not. Funny, I did that based on some googling but no dice. I booted in both regular shel and Live CD. - aurf=