Unable to GPT format the disk

Status
Not open for further replies.
Joined
Jun 27, 2017
Messages
13
Hey guys!!

Im unable to add a new HDD to my server, take a look to the LOG:

Code:
Environment:

Software Version: FreeNAS-11.0-RELEASE (a2dc21583)
Request Method: POST
Request URL: http://10.0.0.69/storage/volumemanager/

Traceback:
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  39.			 response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _legacy_get_response
  249.			 response = self._get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  178.			 response = middleware_method(request, callback, callback_args, callback_kwargs)
File "./freenasUI/freeadmin/middleware.py" in process_view
  162.		 return login_required(view_func)(request, *view_args, **view_kwargs)
File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.				 return view_func(request, *args, **kwargs)
File "./freenasUI/storage/views.py" in volumemanager
  157.		 if form.is_valid() and form.save():
File "./freenasUI/storage/forms.py" in save
  290.					 init_rand=init_rand,
File "./freenasUI/middleware/notifier.py" in init
  238.			 f(objectid, *args, **kwargs)
File "./freenasUI/middleware/notifier.py" in _init_volume
  1057.		 self.__create_zfs_volume(volume, swapsize, kwargs.pop('groups', False), kwargs.pop('path', None), init_rand=kwargs.pop('init_rand', False))
File "./freenasUI/middleware/notifier.py" in __create_zfs_volume
  802.			 vdevs = self.__prepare_zfs_vdev(vgrp['disks'], vdev_swapsize, encrypt, volume)
File "./freenasUI/middleware/notifier.py" in __prepare_zfs_vdev
  738.								  swapsize=swapsize)
File "./freenasUI/middleware/notifier.py" in __gpt_labeldisk
  409.				 raise MiddlewareError(f'Unable to GPT format the disk "{devname}": {error}')

Exception Type: MiddlewareError at /storage/volumemanager/
Exception Value: [MiddlewareError: b'Unable to GPT format the disk "ada1": gpart: geom \'ada1\': Operation not permitted\n']
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
Im unable to add a new HDD to my server, take a look to the LOG:

Lucas,

Please provide your server hardware specs. Also what were you trying to do when got the error? Create a volume? how many disks? What type of raidz?
 

CraigD

Patron
Joined
Mar 8, 2016
Messages
343
FreeNAS does have commands to do it, but I don't know them

The easy way is to put the drive into a computer with an OS you know how to use and remove all Volumes

The right way is to test the drive and this will fix your problem, it destroys all data on the disk

Have Fun
 

saikee

Explorer
Joined
Feb 7, 2017
Messages
77
I believe if you can't add a disk to an existing volume it is more to do with the format of the existing setup and not the disk preformatted with a GPT partition table. In my case the volume manager does all the formatting when a disk is accepted.

The Guide doesn't explain it in details but if you have a Mirror set up you need to add two disks at a time. The addition of one new disk is possible to a stripe volume and probably not in other Raidz setups. It is a pig's job to add disks but before you build the volume you could submit less number of disks and then try to add a disk to find out how the volume manager behaves. My point is if the volume manager refuse to take a disk there could be a reason for it.

The rule of the zfs system is the setup cannot be changed. It can be expanded but some setups may not accept just one disk for expansion.

I am new to FreeBSD but if you really need to format the disk to GPT the Windows' Disk Management can do it. Also almost every Linux has a CLI program called "parted". Say if your disk is device sdb you can at a terminal
Code:
sudo parted /dev/sdb

once inside parted
Code:
mklabel gpt
It is just a three-second job. I found Parted is the quickest as well as the more reliable because by changing gpt to msdos one can revert back to the Msdos partition table. gpt disk has the partition table both at the front and at the rear of the disk and not all partitioning tools could change it back cleanly. The GUI Gparted in Linux can also do it.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
There should be no need for Windows or Linux. FreeNAS has a "Wipe" option under View Disks. Make backups first, and be certain the correct disk is being wiped. The serial number is displayed to help identify it.

This can be done from the command line with the gpart command, but is easier from the GUI.
 
Joined
Jun 27, 2017
Messages
13
Hey!!

Im adding a second disk to my FreeNAS (ada1), I'm using the wizard to do this.

The disk has no any partitions/data on this.
 

Attachments

  • ERR0.PNG
    ERR0.PNG
    20.9 KB · Views: 508
  • ERR1.PNG
    ERR1.PNG
    59.2 KB · Views: 480
Last edited by a moderator:
Joined
Jun 27, 2017
Messages
13
There should be no need for Windows or Linux. FreeNAS has a "Wipe" option under View Disks. Make backups first, and be certain the correct disk is being wiped. The serial number is displayed to help identify it.

This can be done from the command line with the gpart command, but is easier from the GUI.

Code:
[MiddlewareError: b'Failed to wipe ada1: dd: /dev/ada1: Operation not permitted\n']
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
Lucas,

You are missing the hardware specs as per request.
 
Joined
Jun 27, 2017
Messages
13
Lucas,

You are missing the hardware specs as per request.
System Information
Hostname freenas.local Edit
Build FreeNAS-11.0-RELEASE (a2dc21583)
Platform AMD E-350 Processor
Memory 3782MB
System Time Wed Jun 28 09:01:08 PDT 2017
Uptime 9:01AM up 13:02, 0 users
Load Average 0.17, 0.20, 0.18

AMD AHCI Sata with two disk ada0+ada1 and flah disk for freenas installation.
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
System Information
Hostname freenas.local Edit
Build FreeNAS-11.0-RELEASE (a2dc21583)
Platform AMD E-350 Processor
Memory 3782MB
System Time Wed Jun 28 09:01:08 PDT 2017
Uptime 9:01AM up 13:02, 0 users
Load Average 0.17, 0.20, 0.18

AMD AHCI Sata with two disk ada0+ada1 and flah disk for freenas installation.

That box don't meet the requirements:

Minimum Hardware Requirements:
These specifications will suffice to get a small FreeNAS install running reliably with moderate performance for a few users.

  • Multicore 64-bit* processor (Intel strongly recommended)
  • 8GB Boot Drive (USB Flash Drive suffices)
  • 8GB RAM
  • At least 1 direct attached disk (Hardware RAID strongly discouraged)
  • One physical network port
Might not be the cause of your problem but will add to it.

If that disk has been used on another file system and it's not new, I'd manually delete and recreate a blank partition on it. Be aware your data will be lost.

Keep in mind that FreeNAS uses OpenZFS and it requires memory to work correctly, so if you are adding jails, plugins, VMs as well, you will be extremely under specifications.
 
Joined
Jun 27, 2017
Messages
13
That box don't meet the requirements:

Minimum Hardware Requirements:
These specifications will suffice to get a small FreeNAS install running reliably with moderate performance for a few users.

  • Multicore 64-bit* processor (Intel strongly recommended)
  • 8GB Boot Drive (USB Flash Drive suffices)
  • 8GB RAM
  • At least 1 direct attached disk (Hardware RAID strongly discouraged)
  • One physical network port
Might not be the cause of your problem but will add to it.

If that disk has been used on another file system and it's not new, I'd manually delete and recreate a blank partition on it. Be aware your data will be lost.

Keep in mind that FreeNAS uses OpenZFS and it requires memory to work correctly, so if you are adding jails, plugins, VMs as well, you will be extremely under specifications.


I'm monitoring CPU and memory consumption, and it's not missing. The server is very little used.

The error "Operation not permitted" maybe is permission problem?
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
The error "Operation not permitted" maybe is permission problem?

Never saw that.

Have you tried drop to the shell and erase/recreate the partition, checked the smart status for such drive, etc?

I'm monitoring CPU and memory consumption, and it's not missing. The server is very little used.

Not the point. You don't get a fusquinha to transport a soccer team...
 
Joined
Jun 27, 2017
Messages
13
Never saw that.

Have you tried drop to the shell and erase/recreate the partition, checked the smart status for such drive, etc?



Not the point. You don't get a fusquinha to transport a soccer team...

Yes, i tried erase/create partitions with the shell, but i get the same error @ shell: "Operation not permitted"
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
The other thing I can think is to try from another environment. Maybe burn gparted live, boot from it, and try that way: http://gparted.org/index.php
 

codebuddha

Cadet
Joined
Jan 7, 2018
Messages
2
I am running FreeNAS-11.1-RELEASE

This worked for me:

Boot up FreeNAS on the target machine
Once booted, you should see the options:
Code:
1) Configure Network Interfaces
.......
9) Shell
...


Select
Code:
9) Shell


You should see
Code:
root@freenas:~ #


Run the following commands (replace ada1 and ada2 with your drive IDs):

Code:
sysctl kern.geom.debugflags=0x10
dd if=/dev/zero of=/dev/ada1 bs=512 count=1 && dd if=/dev/zero of=/dev/ada2 bs=512 count=1
exit


Then navigate to the web interface, select
Code:
Storage -> Volume Manager -> Add Volume
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
That does not erase even the full primary GPT table, much less the backup at the end of the disk. And setting that sysctl means "yes, I want to blow away my system disk if there is an opportunity".

Do not set that sysctl, which removes a safety. Instead, use diskinfo -v drive to locate the correct drives. Then use gpart destroy -F on those drives.
 
Status
Not open for further replies.
Top