Restoring zpool to original state before drive replacement

Status
Not open for further replies.

saber07

Cadet
Joined
Mar 2, 2017
Messages
7
I will start by saying that I potentially screwed up badly and am afraid my data is unrecoverable, and realize I'm an idiot for not fully understanding what I was doing.

With that said, I had a 6 drive Raidz2, with six 2tb drives that I wanted to upgrade. So i was going to swap out each disk and let the drives rebuild. I swapped out one drive, went into the GUI and selected the new unrecognized drive as the one to replace it with and let the system try to rebuild the pool. This seemed to happen fairly quickly (or so I thought) as after about five minutes or so and refreshing the page the pool said it was no longer degraded. I went ahead and swapped the 2nd drive following the same steps, and it went quick as well.

When I started on the third, it seemed to be taking a lot longer, so I started to think I screwed up and the others hadn't finished resilvering. It said it was going to take around 20+ hours to complete, but then it appeared to get stuck and I shut down the server. I then couldn't get freenas to boot past the file mounting system part of the boot process, so I tried installing a new version of Freenas and swapping my old 2tb drives back in.

And this is where I'm at now. I would think that by swapping all of my old drives back in, that the pool would still be good, but I don't know if during the resilvering process it would change the other drives as well, causing the original pool to no longer be valid.

If I do a zpool import, I get the following:

Code:

[root@freenas ~]# zpool import												 
   pool: storage																
	 id: 14937781689459233302												   
  state: DEGRADED															   
status: One or more devices are missing from the system.					   
action: The pool can be imported despite missing or damaged devices.  The	 
		fault tolerance of the pool may be compromised if imported.			 
   see: http://illumos.org/msg/ZFS-8000-2Q									 
config:																		
																				
		storage					 DEGRADED									
		  raidz2-0				  DEGRADED									
			ada0p2				  ONLINE									 
			ada1p2				  ONLINE									 
			replacing-2			 DEGRADED									
			  ada2p2				ONLINE									 
			  14134357624412389014  UNAVAIL  cannot open						
			ada3p2				  ONLINE									 
			6746355214293830694	 UNAVAIL  cannot open						
			4881288469021028751	 UNAVAIL  cannot open	 


The UNAVAIL drives are, I believe, the new drives that I attempted to swap in and have now removed and replaced with the original drives. Is there a way for me to swap in the new drives in place of these unavailable ones via the shell and would this fix my pool? Or is there another route I should try?

Would trying to put the NEW drives back in let the pool rebuild itself?

Sorry for being such a newb, but any help would be appreciated.

Thanks
 

saber07

Cadet
Joined
Mar 2, 2017
Messages
7
Also, here's the zpool status. I tried to actually import the pool as well, but the system did not do anything, just gave me a blank line in the shell and seemed to hang. I couldn't tell if it was actually importing or not.
Code:
[root@freenas ~]# zpool status												
  pool: freenas-boot															
state: ONLINE																
  scan: none requested														
config:																		
																				
		NAME		STATE	 READ WRITE CKSUM								
		freenas-boot  ONLINE	   0	 0	 0								
		  da0p2	 ONLINE	   0	 0	 0								
																				
errors: No known data errors				


Edit. little more info, did a gpart list, should i just do an import replace with the drives listed here?

Code:
[root@freenas] ~# gpart list
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 3907029134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada0p1
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1915dce5-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 2147483648
   offset: 65536
   type: freebsd-swap
   index: 1
   end: 4194431
   start: 128
2. Name: ada0p2
   Mediasize: 1998251367936 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 192ae4fc-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 1998251367936
   offset: 2147549184
   type: freebsd-zfs
   index: 2
   end: 3907029134
   start: 4194432
Consumers:
1. Name: ada0
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0

Geom name: ada1
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 3907029134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada1p1
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 199e53e1-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 2147483648
   offset: 65536
   type: freebsd-swap
   index: 1
   end: 4194431
   start: 128
2. Name: ada1p2
   Mediasize: 1998251367936 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 19ad6472-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 1998251367936
   offset: 2147549184
   type: freebsd-zfs
   index: 2
   end: 3907029134
   start: 4194432
Consumers:
1. Name: ada1
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0

Geom name: ada2
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 3907029134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada2p1
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1a1f015d-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 2147483648
   offset: 65536
   type: freebsd-swap
   index: 1
   end: 4194431
   start: 128
2. Name: ada2p2
   Mediasize: 1998251367936 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1a359db5-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 1998251367936
   offset: 2147549184
   type: freebsd-zfs
   index: 2
   end: 3907029134
   start: 4194432
Consumers:
1. Name: ada2
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0

Geom name: ada3
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 3907029134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada3p1
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1aae78c1-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 2147483648
   offset: 65536
   type: freebsd-swap
   index: 1
   end: 4194431
   start: 128
2. Name: ada3p2
   Mediasize: 1998251367936 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1ac82ddf-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 1998251367936
   offset: 2147549184
   type: freebsd-zfs
   index: 2
   end: 3907029134
   start: 4194432
Consumers:
1. Name: ada3
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0

Geom name: ada4
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 3907029134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada4p1
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1b329024-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 2147483648
   offset: 65536
   type: freebsd-swap
   index: 1
   end: 4194431
   start: 128
2. Name: ada4p2
   Mediasize: 1998251367936 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1b4f6122-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 1998251367936
   offset: 2147549184
   type: freebsd-zfs
   index: 2
   end: 3907029134
   start: 4194432
Consumers:
1. Name: ada4
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0

Geom name: ada5
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 3907029134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada5p1
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1bba09d5-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 2147483648
   offset: 65536
   type: freebsd-swap
   index: 1
   end: 4194431
   start: 128
2. Name: ada5p2
   Mediasize: 1998251367936 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1bd6d40c-5a86-11e1-947b-00259066f5aa
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 1998251367936
   offset: 2147549184
   type: freebsd-zfs
   index: 2
   end: 3907029134
   start: 4194432
Consumers:
1. Name: ada5
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0

Geom name: da0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 31277022
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: da0p1
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0
   rawuuid: 03bc90af-ffac-11e6-9eae-00259066f5aa
   rawtype: 21686148-6449-6e6f-744e-656564454649
   label: (null)
   length: 524288
   offset: 17408
   type: bios-boot
   index: 1
   end: 1057
   start: 34
2. Name: da0p2
   Mediasize: 16013287424 (15G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 544768
   Mode: r1w1e1
   rawuuid: 03d33a5d-ffac-11e6-9eae-00259066f5aa
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 16013287424
   offset: 544768
   type: freebsd-zfs
   index: 2
   end: 31277015
   start: 1064
Consumers:
1. Name: da0
   Mediasize: 16013852672 (15G)
   Sectorsize: 512
   Mode: r1w1e2


I'm a little afraid to try and replace the drive and have FREENAS try to overwrite the data and resilver it when the data is already there. I'm not sure if it would just use the drive as is or try to overwrite what's on the disk.
 
Last edited:

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977

saber07

Cadet
Joined
Mar 2, 2017
Messages
7
I was following the guide for drive replacement, but got ahead of myself before the resilvering had completed. I have since been able to replace the original drives, resilver them, recover my original pool and am now going through the replacement process and letting each disk completely resilver before getting ahead of myself.
 
Status
Not open for further replies.
Top