Problem attaching boot drive

TravisT

Patron
Joined
May 29, 2011
Messages
297
I had a degraded boot drive in my striped volume. I detached the failed drive and attempted to reattach the drive. When I do, I'm getting the following error:

Code:
Traceback:
File "./freenasUI/system/forms.py" in done
  296.				 c.call('boot.attach', devname, {'expand': self.cleaned_data['expand']})
File "/usr/local/lib/python3.6/site-packages/middlewared/client/client.py" in call
  394.			 raise ClientException(c.error, c.errno, c.trace, c.extra)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  42.			 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/system/views.py" in bootenv_pool_attach
  497.			 form.done()
File "./freenasUI/system/forms.py" in done
  298.				 raise MiddlewareError(str(e))
File "./freenasUI/system/forms.py" in done
  298.				 raise MiddlewareError(str(e))

Exception Type: MiddlewareError at /system/bootenv/pool/attach/
Exception Value: [MiddlewareError: Command '('gpart', 'add', '-t', 'freebsd-zfs', '-i', '2', '-a', '4k', '-s', '15900565504B', 'da0')' returned non-zero exit status 1.]


This doesn't mean much to me, so I tried manually wiping da0. Tried again with same result. Any ideas?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I think we need to know a little more about the hardware here to be able to give advice based on understanding instead of making guesses.
Why would you remove a defective device and then try to put it back?
 

TravisT

Patron
Joined
May 29, 2011
Messages
297
The hardware is a C2550 board with 32GB ram. Two 16G USB drives as the boot drives. They are in a striped volume configuration. I got an error that the boot volume was degraded (write errors). I was hoping to test it again before I called the drive bad. I detached the drive with no problems, reseated the USB drive and rebooted the FreeNAS server. Reinstalled the "bad" drive and FreeNAS detected it. Tried attaching the drive to the striped volume, and that's when I get the error.

I've ordered a replacement drive, but wanted to let it resilver to see if I saw the problem again. This seems like a software problem though, not a problem with the drive, so I was hoping to figure out what was causing it.
 
Last edited by a moderator:

hidperf

Dabbler
Joined
Jun 12, 2012
Messages
34
For what it's worth, I just tried replacing a failed boot drive and got a similar message.
The existing boot drive shows a capacity of 16GB.
The replacement boot drive, which is brand new from SanDisk as a warranty exchange, shows a capacity of 15.6GB.
I've tried both "Use all disk space" box checked and unchecked.
I haven't pulled the new drive out yet to see if anything is on it from SanDisk.

Code:
Request Method:	POST
Request URL:	http://192.168.1.2/system/bootenv/pool/attach/?label=da1p2
Software Version:	FreeNAS-11.1-U1 (f7e246b8f)
Exception Type:	MiddlewareError
Exception Value:	

[MiddlewareError: Command '('gpart', 'add', '-t', 'freebsd-zfs', '-i', '2', '-a', '4k', '-s', '16008040448B', 'da0')' returned non-zero exit status 1.]

Exception Location:	./freenasUI/system/forms.py in done, line 298
Server time:	Tue, 6 Feb 2018 00:12:08 -0600
Traceback

Environment:

Software Version: FreeNAS-11.1-U1 (f7e246b8f)
Request Method: POST
Request URL: http://192.168.1.2/system/bootenv/pool/attach/?label=da1p2


Traceback:
File "./freenasUI/system/forms.py" in done
  296.				 c.call('boot.attach', devname, {'expand': self.cleaned_data['expand']})
File "/usr/local/lib/python3.6/site-packages/middlewared/client/client.py" in call
  394.			 raise ClientException(c.error, c.errno, c.trace, c.extra)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  42.			 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/system/views.py" in bootenv_pool_attach
  497.			 form.done()
File "./freenasUI/system/forms.py" in done
  298.				 raise MiddlewareError(str(e))
File "./freenasUI/system/forms.py" in done
  298.				 raise MiddlewareError(str(e))

Exception Type: MiddlewareError at /system/bootenv/pool/attach/
Exception Value: [MiddlewareError: Command '('gpart', 'add', '-t', 'freebsd-zfs', '-i', '2', '-a', '4k', '-s', '16008040448B', 'da0')' returned non-zero exit status 1.]


Request information
GET
Variable	Value
label	'da1p2'
POST
Variable	Value
__all__	''
attach_disk	'da0'
__form_id	'form_BootEnvPoolAttachForm'
FILES

No FILES data
COOKIES
Variable	Value
csrftoken	'8E96qebfUxOuqYoyhOfbclfarCnSvaGqob11g7WSCeSKS1OviHGYgaVD6DiDElDv'
fntreeSaveStateCookie	'root%2Croot%2F55%2F56%2Croot%2F117%2Croot%2F74%2F75%2Croot%2F213%2Croot%2F158%2Croot%2F158%2F168%2Croot%2F218%2Croot%2F218%2F224%2Croot%2F218%2F224%2F226%2Croot%2F219%2Croot%2F219%2F225%2Croot%2F219%2F225%2F227%2Croot%2F190%2F196%2Croot%2F190%2F196%2F198%2Croot%2F191%2F197%2F199%2Croot%2F130%2F140%2Croot%2F189%2Croot%2F191%2Croot%2F191%2F197%2Croot%2F130%2Croot%2F195%2F201%2Croot%2F195%2F201%2F203%2Croot%2F134%2F144%2Croot%2F194%2Croot%2F194%2F200%2Croot%2F194%2F200%2F202%2Croot%2F194%2F207%2Croot%2F76%2F77%2Croot%2F132%2F142%2Croot%2F193%2F199%2Croot%2F193%2F199%2F201%2Croot%2F193%2Croot%2F197%2Croot%2F197%2F203%2Croot%2F197%2F203%2F205%2Croot%2F136%2Croot%2F136%2F146%2Croot%2F1%2F6%2Croot%2F101%2Croot%2F101%2F111%2Croot%2F157%2Croot%2F144%2Croot%2F144%2F154%2Croot%2F222%2Croot%2F222%2F236%2Croot%2F222%2F236%2F238%2Croot%2F222%2F228%2Croot%2F222%2F228%2F230%2Croot%2F222%2F243%2Croot%2F222%2F243%2F245%2Croot%2F222%2F250%2Croot%2F222%2F250%2F252%2Croot%2F217%2Croot%2F156%2Croot%2F156%2F166%2Croot%2F76%2Croot%2F225%2Croot%2F225%2F231%2Croot%2F223%2Croot%2F234%2Croot%2F239%2Croot%2F244%2Croot%2F244%2F258%2F260%2Croot%2F244%2F270%2Croot%2F244%2F270%2F272%2Croot%2F244%2F250%2F252%2Croot%2F244%2F262%2F264%2Croot%2F227%2Croot%2F232%2Croot%2F232%2F238%2Croot%2F232%2F238%2F240%2Croot%2F167%2Croot%2F229%2Croot%2F229%2F243%2Croot%2F229%2F243%2F245%2Croot%2F233%2Croot%2F82%2F83%2Croot%2F82%2F83%2F84%2Croot%2F84%2F85%2Croot%2F235%2F249%2F251%2Croot%2F235%2F256%2F258%2Croot%2F49%2F53%2Croot%2F49%2F62%2Croot%2F49%2F59%2Croot%2F49%2F56%2Croot%2F88%2Croot%2F88%2F89%2Croot%2F10'
sessionid	'cmut8at175vfrph762m4vdtv4ub3asdi'
META
Variable	Value
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
The existing boot drive shows a capacity of 16GB.
The replacement boot drive, which is brand new from SanDisk as a warranty exchange, shows a capacity of 15.6GB.
So there is just not enough room on the replacement drive to create a ZFS partition of the same size as on the original drive. Although the error handling could be improved.

There is no easy way to get around this (well, short of using a different USB stick with enough capacity). The roundabout way is to back up the system configuration and reinstall, selecting both USB devices. Then it will create a mirror matching the smaller of the two.

Long-term, it is no more effort to just use a small SSD for the boot device, far more reliable, and less trouble. But that assumes you have a free SATA port.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I've ordered a replacement drive, but wanted to let it resilver to see if I saw the problem again. This seems like a software problem though, not a problem with the drive, so I was hoping to figure out what was causing it.
USB memory devices (thumb drives) what ever they are called are really not being made very well. The manufacturers are really building them as cheap as possible to try to turn a profit. That is why the one you got in as a replacement is only 15GB when it is supposed to be 16.
I had two of them fail, one after another, within a single year a few years ago. That is why I quit using them. I have not updated my signature, but I am running three FreeNAS systems at home and I use a mirrored pair of 2.5 inch laptop drives to boot those systems from. The smallest, cheapest ones I can find being sold as "new, old stock". The ones I have been using for the past two years are all 40GB Toshiba drives that I picked up for about $9 each. When I got them, and tested them, they all had zero power on hours and they have been perfectly trouble free for over two years. I highly recommend that because it is both inexpensive and reliable, and because they are actual hard disk drives, you can run SMART tests against them to keep an eye on their health right along with all the other drives in the system.
A small SSD can work just as well, but usually costs more. Either way, I suggest getting clear of the USB sticks.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Just for verification, with both da0 and da1 attached, do diskinfo -v da0 and diskinfo -v da1 and post the results.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Bug 28216 filed to improve the error handling.
 

hidperf

Dabbler
Joined
Jun 12, 2012
Messages
34
So there is just not enough room on the replacement drive to create a ZFS partition of the same size as on the original drive. Although the error handling could be improved.

There is no easy way to get around this (well, short of using a different USB stick with enough capacity). The roundabout way is to back up the system configuration and reinstall, selecting both USB devices. Then it will create a mirror matching the smaller of the two.

Long-term, it is no more effort to just use a small SSD for the boot device, far more reliable, and less trouble. But that assumes you have a free SATA port.

I thought that might have been the issue but didn't know if FreeNAS would format and wipe out anything that was already there. It's just my Plex server for now, so it's not a big deal doing a reinstall. It wouldn't be the first time.

USB memory devices (thumb drives) what ever they are called are really not being made very well. The manufacturers are really building them as cheap as possible to try to turn a profit. That is why the one you got in as a replacement is only 15GB when it is supposed to be 16.
I had two of them fail, one after another, within a single year a few years ago. That is why I quit using them. I have not updated my signature, but I am running three FreeNAS systems at home and I use a mirrored pair of 2.5 inch laptop drives to boot those systems from. The smallest, cheapest ones I can find being sold as "new, old stock". The ones I have been using for the past two years are all 40GB Toshiba drives that I picked up for about $9 each. When I got them, and tested them, they all had zero power on hours and they have been perfectly trouble free for over two years. I highly recommend that because it is both inexpensive and reliable, and because they are actual hard disk drives, you can run SMART tests against them to keep an eye on their health right along with all the other drives in the system.
A small SSD can work just as well, but usually costs more. Either way, I suggest getting clear of the USB sticks.

I've had the same problem with these SanDisk drives. Both failed and were replaced under warranty, which is why I was replacing this one. I have some 60GB SSDs laying around, but I'll have to figure out how I can get them in the server.

Just for verification, with both da0 and da1 attached, do diskinfo -v da0 and diskinfo -v da1 and post the results.

Code:
[root@freenas ~]# diskinfo -v da0											   
da0																			 
		512			 # sectorsize										   
		15631122432	 # mediasize in bytes (15G)							 
		30529536		# mediasize in sectors								 
		0			   # stripesize										   
		0			   # stripeoffset										 
		1900			# Cylinders according to firmware.					 
		255			 # Heads according to firmware.						 
		63			  # Sectors according to firmware.					   
		SanDisk Cruzer Fit	  # Disk descr.								   
		4C530008060417111442	# Disk ident.								   
		Not_Zoned	   # Zone Mode		   

[root@freenas ~]# diskinfo -v da1											   
da1																			 
		512			 # sectorsize										   
		16008609792	 # mediasize in bytes (15G)							 
		31266816		# mediasize in sectors								 
		0			   # stripesize										   
		0			   # stripeoffset										 
		1946			# Cylinders according to firmware.					 
		255			 # Heads according to firmware.						 
		63			  # Sectors according to firmware.					   
		SanDisk Cruzer Fit	  # Disk descr.								   
		4C530009660820119405	# Disk ident.								   
		Not_Zoned	   # Zone Mode				


Bug 28216 filed to improve the error handling.

Thanks!

And thank you both for the feedback.
 
Top