FreeNAS Error Creating Pool

command ‘(‘gpart’, ‘create’, ‘-s’, ‘gpt’, ‘/dev/da8′)’ returned non-zero exit status 1.

If you get this error while trying to create a pool in FreeNAS-11.2-U4.1 or wiping a disk, there seems to be an issue wiping the referenced hard disk (ie. /dev/da8). I don’t have a root cause analysis at this time however sysctl is able to set a flag to ignore the error. I suspect it’s either detecting bad sectors on the physical disk, or a rogue preexisting RAID config, and I have both. Deciding to stripe a couple old WD Raptor 150’s that were used in a previous hardware RAID setup caused this headache for me.

Login to the shell as root on your freenas system and run sysctl kern.geom.debugflags=0x10 and continue performing whatever action caused this error message. Once you are done be sure to set it back to 0 with sysctl kern.geom.debugflags=0. It is not persistent and will be reset once you reboot the system if you forget to revert the change.

If for some reason you are still getting the error you can try zeroing out the beginning and end of the disk with the dd command. Replace the string </dev/da#> and <da#> with your own.

Zero beginning:

dd if=/dev/zero of=</dev/da#> bs=1m count=1

Zero end:

dd if=/dev/zero of=</dev/da#> bs=1m oseek=`diskinfo <da#> | awk '{print int($3 / (1024*1024)) - 4;}'`

Here is the full initial error msg I received:

file "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 219, in wrapper
response = callback(request, *args, **kwargs)

file "./freenasui/api/resources.py", line 1449, in dispatch_list
request, **kwargs

file "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 450, in dispatch_list
return self.dispatch('list', request, **kwargs)

file "./freenasui/api/utils.py", line 251, in dispatch
request_type, request, *args, **kwargs

file "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 482, in dispatch
response = method(request, **kwargs)

file "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 1384, in post_list
updated_bundle = self.obj_create(bundle, **self.remove_api_resource_names(kwargs))

file "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 2175, in obj_create
return self.save(bundle)

file "./freenasui/api/utils.py", line 445, in save

file "./freenasui/storage/forms.py", line 316, in save
raise e

file "./freenasui/storage/forms.py", line 310, in save
c.call("alert.unblock_source", lock)

file "./freenasui/storage/forms.py", line 303, in save
notifier().create_volume(volume, groups=grouped, init_rand=init_rand)

file "./freenasui/middleware/notifier.py", line 760, in create_volume
vdevs = self.__prepare_zfs_vdev(vgrp['disks'], vdev_swapsize, encrypt, volume)

file "./freenasui/middleware/notifier.py", line 695, in __prepare_zfs_vdev

file "./freenasui/middleware/notifier.py", line 341, in __gpt_labeldisk
c.call('disk.wipe', devname, 'quick', job=true)

file "./freenasui/middleware/notifier.py", line 341, in __gpt_labeldisk
c.call('disk.wipe', devname, 'quick', job=true)

file "/usr/local/lib/python3.6/site-packages/middlewared/client/client.py", line 477, in call
raise clientexception(job['error'], trace=job['exception'])

middlewared.client.client.clientexception: command '('gpart', 'create', '-s', 'gpt', '/dev/da8')' returned non-zero exit status 1.

Source: https://www.ixsystems.com/community/threads/error-creating-pool-problem-with-gpart.70629/

Disqus Comments Loading...
All Rights ReservedRegular Version