Re: gpart destroy efi partition?

From: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Date: Tue, 23 May 2023 15:23:14 UTC
On Tue, May 23, 2023 at 12:55:21PM +0200, Julian H. Stacey wrote:
> Steve Kargl wrote:
> > I did find 
> >
> > % sysctl -a | grep da01
> > kern.geom.disk.da0.flags: 1a8<CANFLUSHCACHE,DIRECTCOMPLETION,CANZONE,WRITEPROTECT>
> >
> > So, I suppose the question is how to clear WRITEPROTECT.
> 
> I dont use efi & gpart but some ideas:
> 
> Why da01 not da0 ? What is da01 ?
> a typo, or pulling in some gpart kernel stuff ?
> 

Yes, a typo.  I used da0.

> Is an escalated security level catching you ? I stick to default,
> on 12.4-rel multi user thats: sysctl -a | grep level # kern.securelevel: -1

securelevel is -1.

> Try a fresh reboot, even staying single user,
> & before you touch it with any gpart invoking command,
> whack it with multiple dd if=/dev/zero of=/dev/zero count=5000
> 
> (multiple as sometimes Ive seen first attempt doesnt seem to clear
> my sticks, a 2nd reboot after dd will clear any false cached memories)
> 
> If that doesnt work:
>   Try an older BSD that does know about EFI & gpart ?
>   Put it a Microsoft PC, or a USB to Go adapter on an android,
>   that probbly will complain unknown & offer to bash it back to MBR ?
>   Rumage around or ask friends, eg I have a tiny old match box size thing
>   that clones sticks. Clone your stick from some other small stick,
>   then repair the wrong sized MBR

Thanks for the suggestions.  I spent sometime on a Windows 10
system trying yo convince windows to format/destory/read/write
do whatever to the memstick.  FreeBSD tools are so much easier
to use!

From what Warner has written, I think I'll write off this
memstick.  It was the right size for what I needed to do,
but it's now past diminishing returns to play with some
more.


-- 
Steve