3

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.

4
  • Try sudo gpart
    – dchirikov
    Jul 5 '14 at 21:07
  • @dchirikov god point but I'm root on my system Jul 5 '14 at 21:08
  • $ sign shows you are not. If you not change PS1 of course. :) anyway it's just comment, not the answer.
    – dchirikov
    Jul 5 '14 at 21:12
  • Double check that this is the correct device label: sudo sfdisk -xl.
    – slm
    Jul 5 '14 at 21:36
4

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.

1
  • Thanks 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..
    – urza.cc
    Jul 21 '19 at 10:14
1

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.

0

Disk is part of active ZFS pool? In this case - detach disk from pool or destroy pool first, then create gpt table..

1
  • Not in my case, but maybe for others Feb 27 '15 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.