Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jul 2013 16:01:01 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        aurfalien <aurfalien@gmail.com>
Cc:        Michael Sierchio <kudzu@tenebras.com>, FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: gpart: table 'da0' is corrupt; operation not permitted
Message-ID:  <alpine.BSF.2.00.1307161558270.82814@wonkity.com>
In-Reply-To: <CB03CFAC-6F82-46B0-B456-E81E45A4F4AB@gmail.com>
References:  <AE78EABA-CB23-4B04-BE55-37627B8C6A83@gmail.com> <CAHu1Y70gF4T=4F3wUy9Q5wT2EmJ5sOfwsedkrsFEoLUZfq6e%2BA@mail.gmail.com> <CB03CFAC-6F82-46B0-B456-E81E45A4F4AB@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Jul 2013, aurfalien wrote:

>
> On Jul 16, 2013, at 1:50 PM, Michael Sierchio wrote:
>
>> On Tue, Jul 16, 2013 at 1:44 PM, aurfalien <aurfalien@gmail.com> wrote:
>>
>>> Upon doing;
>>>
>>> gpart destroy da0
>>>
>>> I get;
>>>
>>> gpart: Device busy
>>
>> crude but effective:
>>
>>
>> DISK=da0
>>
>> offset=`diskinfo $DISK | awk '{ print $4 - 131072 }'`
>> dd if=/dev/zero of=/dev/$DISK bs=64k count=1
>> dd if=/dev/zero of=/dev/$DISK bs=64k seek=$offset
>>
>> gpart create -s gpt ${DISK}
>
> This is what I ended up doing.
>
> I unplugged it, waited a few, re plugged and then I was able to delete/destroy.
>
> I will keep your method on hand though as I prefer not doing a hot plug.

Hot plug?  That just wipes the beginning and end of the disk.  I would 
erase 1M just to be sure.

The more elegant version is

   gpart destroy -F da0

If it gives an error when doing that, disabling the safety may be 
necessary:  sysctl kern.geom.debugflags=16
Do that only when necessary.  It usually is not.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1307161558270.82814>