Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jul 2013 13:50:00 -0700
From:      Michael Sierchio <kudzu@tenebras.com>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: gpart: table 'da0' is corrupt; operation not permitted
Message-ID:  <CAHu1Y70gF4T=4F3wUy9Q5wT2EmJ5sOfwsedkrsFEoLUZfq6e%2BA@mail.gmail.com>
In-Reply-To: <AE78EABA-CB23-4B04-BE55-37627B8C6A83@gmail.com>
References:  <AE78EABA-CB23-4B04-BE55-37627B8C6A83@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHu1Y70gF4T=4F3wUy9Q5wT2EmJ5sOfwsedkrsFEoLUZfq6e%2BA>