Re: gpart: table 'da0' is corrupt; operation not permitted

2013-07-16 Thread aurfalien

On Jul 16, 2013, at 3:01 PM, Warren Block wrote:

> 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  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

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=16
> 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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: gpart: table 'da0' is corrupt; operation not permitted

2013-07-16 Thread Warren Block

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  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.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: gpart: table 'da0' is corrupt; operation not permitted

2013-07-16 Thread aurfalien

On Jul 16, 2013, at 1:50 PM, Michael Sierchio wrote:

> On Tue, Jul 16, 2013 at 1:44 PM, aurfalien  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.

- aurf
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: gpart: table 'da0' is corrupt; operation not permitted

2013-07-16 Thread Michael Sierchio
On Tue, Jul 16, 2013 at 1:44 PM, aurfalien  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}
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


gpart: table 'da0' is corrupt; operation not permitted

2013-07-16 Thread aurfalien
Hello again,

Not happy to be posting so much lately especially being so new.

I grabbed a few disks from a Mac and am using them for sys disks.

Upon booting from an install CD into a shell, I type;

gpart show

and see several partitions;

34  78165293da0 GPT 
(37G)   [CORRUPT]
34  6   - free -
(3.0k)
40  409600  1   efi 
(200M)
409640  774935362   
!52414944--11aa-aa11-00306543eacac  (37G)
77903176262144  3   apple-boot  
(128M)
781653207   - free- 
(3.5k)


Upon doing;

gpart destroy da0

I get;

gpart: Device busy


Upon doing;

gpart delete -i 1 da0

I get;

gpart: table "da0" is corrupt: Operation not permitted

Any insight would be huge, thanks in advance,

- aurf


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"