How to destroy existing disk partitions
Solution 1
sysctl kern.geom.debugflags=16
This solve it for me. If some one can explain for future reader how and why this work I delete my answer and accept your answer.
Solution 2
Do you have any securelevel set? Because a securelevel inhibits EVEN the root from writing onto disks!!! It does not look to me like a broken disk, because with a broken disk you would get a storm of I/O errors over several monitor pages at least. He there just says that he can not do it because he has no permission to do that. If you are root, it might be securelevel, or some type of mandatory access control. And your title does not fit into the question you posed then. Destroying partitions along with the label is done by gpart destroy -F ada0.
Sir l33tname
OS: win10, Fedora 26 (4.19.6-300.fc29.x86_64), FreeBSD 12 Music: Hardstyle, Punk Rock
Updated on September 18, 2022Comments
-
Sir l33tname over 1 year
I added some disks to my system, which were in use before. I tried to create them:
$ gpart create -s GPT ada0 gpart: geom 'ada0': Operation not permitted $ gpart show ada0 gpart: No such geom: ada0.
Is there a way to find out, why this happening?
Update:
It's probably a broken disk. I this with other disks and everything work as expected.
-
dchirikov almost 10 yearsTry
sudo gpart
-
Sir l33tname almost 10 years@dchirikov god point but I'm root on my system
-
dchirikov almost 10 years
$
sign shows you are not. If you not changePS1
of course. :) anyway it's just comment, not the answer. -
slm almost 10 yearsDouble check that this is the correct device label:
sudo sfdisk -xl
.
-
-
urza.cc almost 5 yearsThanks for this! I dont know what it does but it solved my problem, after spending few hours googling. I needed to format disks in FreeNAS, which refused to create new zfs pool from disks that were previously used in NAS4Free with GELI enctyption. This is the only command that allowed me to format them with gpart create -s gpt /dev/ada0 etc..