Recover configure from failing boot device

Status
Not open for further replies.

Stryf

Dabbler
Joined
Apr 3, 2016
Messages
19
I made the same mistake by forgetting to back up my key when I first created the pool. I was in the process of starting over with a mirrored boot drive when I realized i didn't have a backup of the Geli key.

Took me about 7 hours of research till i got the pool back. I used this forum and the below hyperlink where he talks about importing the old thumb drive's zpool with a new pool name which i called "dump". I had to mount again within that dump folder the latest dated "zfs list" which for me was called "9.10-STABLE-201605021851".

The path looks like this : /dump/dump/ROOT/9.10-STABLE-201605021851/data/geli

Luckily the *.key file was still in there so I copied it to /data/geli and was then able to import my encrypted pool from the freenas gui. The GUI auto detected the key and the password was blank.

https://headcrash.industries/reference/recovering-freenas-configuration-from-zfs-boot-drive/
 

maglin

Patron
Joined
Jun 20, 2015
Messages
299
This is why encryption isn't recommend as the possibility of losing you pool to user error is high.

I would put your key in several places so you don't have this happen in the future.


Sent from my iPhone using Tapatalk
 

juanjico

Dabbler
Joined
Sep 18, 2012
Messages
31
I have the same problem described here. I'm currently on a new FreeNAS installation with the USB drive connected. I can see the pool:

Code:
[root@freenas] /# zpool import
   pool: oldboot
     id: 18136804645215110063
  state: ONLINE
status: The pool is formatted using a legacy on-disk version.
action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
config:

        oldboot     ONLINE
          da1p2     ONLINE



Then I tried to import the pool:

Code:
[root@freenas] /# zpool import -R /mnt 18136804645215110063 oldboot
[root@freenas] /#


No error reported, but ...

Code:
[root@freenas] /# cd /mnt
[root@freenas] /mnt# ls -la
total 10
drwxr-xr-x   2 root  wheel  64 May 15 09:42 ./
drwxr-xr-x  19 root  wheel  26 May 15 09:12 ../
-rw-r--r--   1 root  wheel   5 May 15 08:46 md_size
[root@freenas] /mnt#


Nothing is really imported. But is listed as imported:

Code:
[root@freenas] /mnt# zpool list
NAME           SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
freenas-boot  7.19G   491M  6.71G         -      -     6%  1.00x  ONLINE  -
oldboot       7.19G  2.26G  4.92G         -      -    31%  1.00x  ONLINE  /mnt

[root@freenas] /mnt# zfs list
NAME                                            USED  AVAIL  REFER  MOUNTPOINT
freenas-boot                                    491M  6.48G    31K  none
freenas-boot/ROOT                               484M  6.48G    25K  none
freenas-boot/ROOT/Initial-Install                 1K  6.48G   481M  legacy
freenas-boot/ROOT/default                       484M  6.48G   481M  legacy
freenas-boot/grub                              6.34M  6.48G  6.34M  legacy
oldboot                                        2.26G  4.70G    31K  /mnt/mnt
oldboot/ROOT                                   2.19G  4.70G    31K  /mnt/mnt/ROOT
oldboot/ROOT/FreeNAS-9.3-CURRENT-201503161938   588K  4.70G   937M  /mnt
oldboot/ROOT/FreeNAS-9.3-STABLE-201601181840   5.42M  4.70G  1.01G  /mnt
oldboot/ROOT/FreeNAS-9.3-STABLE-201602031011   2.19G  4.70G  1.01G  /mnt
oldboot/grub                                   57.1M  4.70G  11.2M  legacy
[root@freenas] /mnt#




What I'm doing wrong ??

Thanks!
 

selva

Cadet
Joined
Feb 13, 2016
Messages
1
Hi I have lost the config file now triying to recover it from the usb. installed latest stable version and mounted the old drive by executing "zpool import -f -R /mnt 18180872934373801733 oldboot" the import is successful but there is nothing located in /mnt. Please help. all the required details attached in the code section.

[font=Trebuchet MS, Helvetica, Arial, sans-serif]
Code:
[root@freenas ~]# zpool import												  
   pool: freenas-boot														  
	 id: 18180872934373801733												  
  state: ONLINE																
 status: The pool was last accessed by another system.						  
 action: The pool can be imported using its name or numeric identifier and	  
		the '-f' flag.														  
   see: http://illumos.org/msg/ZFS-8000-EY									  
 config:																		
																			   
		freenas-boot  ONLINE													
		  da1p2	 ONLINE 

[root@freenas ~]# zpool import -f -R /mnt 18180872934373801733 oldboot		  
[root@freenas ~]# cd /mnt/oldboot											  
bash: cd: /mnt/oldboot: No such file or directory							  
[root@freenas ~]# cd /mnt													  
[root@freenas /mnt]# ls														
md_size		  

[root@freenas /mnt]# zpool list												
NAME		   SIZE  ALLOC   FREE  EXPANDSZ   FRAG	CAP  DEDUP  HEALTH  ALTROO
T																			  
freenas-boot  7.44G   647M  6.81G		 -	  -	 8%  1.00x  ONLINE  -	
oldboot	   7.44G  1.52G  5.92G		 -	  -	20%  1.00x  ONLINE  /mnt


[root@freenas ~]# zpool status
config:																		
																			   
		NAME		STATE	 READ WRITE CKSUM								  
		freenas-boot  ONLINE	   0	 0	 0								
		  da0p2	 ONLINE	   0	 0	 0								  
																			   
errors: No known data errors													
																			   
  pool: oldboot																
 state: ONLINE																  
status: Some supported features are not enabled on the pool. The pool can	  
		still be used, but some features are unavailable.					  
action: Enable all features using 'zpool upgrade'. Once this is done,		  
		the pool may no longer be accessible by software that does not support  
		the features. See zpool-features(7) for details.						
  scan: scrub repaired 0 in 0h8m with 0 errors on Tue Mar 28 15:23:05 2017	  
config:																		
																			   
		NAME		STATE	 READ WRITE CKSUM								  
		oldboot	 ONLINE	   0	 0	 0								  
		  da1p2	 ONLINE	   0	 0	 0								  
																			   
errors: No known data errors  

gpart show da1												
=>	  34  15722429  da1  GPT  (7.5G)										  
		34	  1024	1  bios-boot  (512K)									
	  1058		 6	   - free -  (3.0K)									
	  1064  15721392	2  freebsd-zfs  (7.5G)								  
  15722456		 7	   - free -  (3.5K)


gpart list

end: 1057																	
   start: 34																	
2. Name: da1p2																  
   Mediasize: 8049352704 (7.5G)												
   Sectorsize: 512															  
   Stripesize: 0																
   Stripeoffset: 544768														
   Mode: r1w1e1																
   rawuuid: 464b9fa1-694b-11e6-a500-00259066d12e								
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b								
   label: (null)																
   length: 8049352704														  
   offset: 544768															  
   type: freebsd-zfs															
   index: 2																	
   end: 15722455																
   start: 1064																  
Consumers:																	  
1. Name: da1																	
   Mediasize: 8049917952 (7.5G)												
   Sectorsize: 512															  
   Mode: r1w1e2 

[root@freenas /]# gpart show da1												
=>	  34  15722429  da1  GPT  (7.5G)										  
		34	  1024	1  bios-boot  (512K)									
	  1058		 6	   - free -  (3.0K)									
	  1064  15721392	2  freebsd-zfs  (7.5G)								  
  15722456

[root@freenas /mnt]# file -s /dev/da1p1																							
/dev/da1p1: data																													
[root@freenas /mnt]# file -s /dev/da1p2																							
/dev/da1p2: data


[/font]
 
Status
Not open for further replies.
Top