Trying to recover config from 9.10 (ZFS) boot device

Status
Not open for further replies.

sremick

Patron
Joined
Sep 24, 2014
Messages
323
Yep, rookie mistake. Was bound to happen some day. Made significant changes without updating my backup of the config (somehow "changing jail" didn't register in my head as something that warranted a config backup), then had some issues with the USB device. It's still mostly readable, so I'd like to recover the config file.

Did a fresh install of 9.10 onto a separate USB boot. Then inserted old USB device and mounted (via instructions I picked up from this thread: https://forums.freenas.org/index.php?threads/recover-configure-from-failing-boot-device.28032/ ). It comes up at /dev/da1. Great. I run "zpool import" to get the ID, but when I tried to import it, it complained that I couldn't because there was another pool already imported with the name "freenas-boot". I managed to rename my old pool on the old USB device "freenas-old", and so now when I run the import command to import "freenas-old" by id, it completes without error, however nothing appears under /mnt (unlike when I was accidentally importing my data drive array, at which point I got "Mainstorage" or somesuch appearing under /mnt with then subfolders for .freenas, jails, etc). So... no errors, but where's the mount? I feel like I'm just doing something rudimentary.


(Plan B if I'm SOL: the only change I made was to my jail. I do have a 9.10 backup from before the jail change. If I could restore using that config, then manually set up a jail and point it to the existing location of my new jail that was created after this backup, I'd be fine and where I need to be).
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419

sremick

Patron
Joined
Sep 24, 2014
Messages
323
Hmm, it seems somehow the pool name reverted back to "freenas-boot" during other things I was trying last night. So let's back up a bit.

Here's the current output of zpool import:
Code:
# zpool import
  pool: freenas-boot
  id: 11318567096855096520
  state: ONLINE
status: Some supported features are not enabled on the pool.
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:

   freenas-boot  ONLINE
	da1p2  ONLINE

  pool: MainVolume
  id: 13557888607630012123
  state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

   MainVolume  ONLINE
	raidz2-0  ONLINE
	gptid/a66c889d-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a6bdca04-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a70cb091-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a75cac26-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a7b4aa7b-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a803091d-6948-11e4-b026-d050992dfbb0  ONLINE


And to answer your question:

Code:
# zfs get mountpoint freenas-boot
NAME  PROPERTY  VALUE  SOURCE
freenas-boot  mountpoint  none  local


But I'm not clear now which "freenas-boot" that is referring to. It might be the new one on the new USB device.

I'll hang tight and not try to rename the pool again until a pro gives me explicit instructions on what I should do.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Be very careful. NEVER have the old boot pool attached to the system during boot, or FreeNAS may randomly decide to load stuff from there after loading the kernel and some system things from the right boot device.

As for your question, if it shows up with zpool import, it's not improted yet. So just do zpool import freenas-boot oldboot and it will be renamed to oldboot.

From there, just navigate to /oldboot/Path/to/config.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
Eric,

Thanks for chiming in on this thread. I appreciate the addition of your expertise.

I am getting errors when trying to import the pool to make it accessible. I fear the damage to the filesystem might be in the way. So it might be necessary to move to Plan B.

Since I am only jails (no plug-ins), and only one jail... is there a way to set up a new jail then configure it to point to the location of the old jail on the main array and bring it back to life? This would be after importing a config that has the same hardware config but just pre-dates this jail.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
If the jail doesn't have too much complication setup-wise, it's close to just pointing the GUI to the relevant dataset and you're good.

However, you might want to investigate getting the config backup off the system dataset.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
However, you might want to investigate getting the config backup off the system dataset.
Ok, I'm not feeling optimistic at this point, but I'm happy to pursue it a bit more if you'd like. People can suffer without their movies and TV shows for a bit in the interest of science and trying to do this surgically. :)

Unfortunately, as soon as I try to mount/import the old dataset, I get a lot of errors. They all begin with "(da1:umass-sim1:1:0:0):" and then go like:
Code:
Error 5, Unretryable error
READ(10). CDB: 28 00 03 9c 24 38 00 00 10 00
CAM status: SCSI Status Error
SCSI status: Check Condition
SCSI sense: MEDIUM ERROR asc:11,0 (Recovered read error)


These are identical to the ones I get when I originally tried to boot with the old USB device.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Sounds like you have bigger problems if the data pool is giving you trouble.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
Sounds like you have bigger problems if the data pool is giving you trouble.
I think there might be confusion. The pool giving me problems is the ZFS-formatted old USB boot device. There is no problem importing the old data pool (I know because I accidentally did that while figuring out the CLI commands). I've seen nothing giving me any concern about the data pool (the 6 3TB HDDs) with all my actual data. What I'm trying to do is rebuild the FreeNAS boot USB... I only used "pool" referring to that as it's the ZFS syntax there as well even though it's a single device. Ideally I was hoping to copy the config off that if it was intact enough. If not, plan B is to use a config that predates the jail (but identical hardware), then resurrect the existing jail by pointing the jail setup to the old jail on the data pool (something you seemed to agree should be possible). Sorry if I'm confusing things by using the wrong way of referring to things.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Is there a .system data set on your data pool? If so it is the config in it.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
Is there a .system data set on your data pool? If so it is the config in it.
Nope, the only hidden "dot" folder I saw after (accidentally) mounting ("importing") the main data pool was ".freenas". However I'm not familiar with FreeNAS CLI much at all so I'm not clear on how to make the .system dataset appear from the CLI. Honestly, I wasn't even aware that .system contained a copy of the config. All I knew was that it contained logs and writes to .system were the source of the drive activity light blinking every 5 seconds or so.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
@Ericloewe

Please let me know if you still think pursuing finding a copy of the config file is worthwhile, or if we should switch gears and try pointing a jail setup to the existing jail to resurrect it. I'm not really clear on how to make the .system dataset appear from the 6-disk data array using the CLI per Stux's idea... out of my league here. Thanks!
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
With the pool imported, just navigate to pool/.system/path/to/config, whatever that path is (you'll have to look it up somewhere).
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
It's definitely there on pools that have been properly mounted. I'm not sure if it's mounted there if the pool is imported with a simple zpool import in the shell.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
The backups will be in a folder called configs-extremely_long_hex_number.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'm not sure if it's mounted there if the pool is imported with a simple zpool import in the shell.
I'm 99% sure that the mountpoint is determined by a zfs property, so it would be applied whether the pool is imported via the GUI or the shall.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
Ok let's give this a stab:

Code:
# zpool import
  pool: MainVolume
  id: 13557888607630012123
  state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

   MainVolume  ONLINE
	raidz2-0  ONLINE
	gptid/a66c889d-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a6bdca04-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a70cb091-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a75cac26-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a7b4aa7b-6948-11e4-b026-d050992dfbb0  ONLINE
	gptid/a803091d-6948-11e4-b026-d050992dfbb0  ONLINE

I no longer have the old USB boot device plugged in. So:
Code:
# zpool import -f -R /mnt 13557888607630012123

No error. Good!
Code:
# ls /mnt
./  ../  MainVolume/ md_size

Ok so now we have MainVolume there. However:
Code:
# ls -l /mnt/MainVolume/
total 135
drwxr-xr-x  7 root  wheel  7 Jun 29  2016 ./
drwxr-xr-x  3 root  wheel  128 May 24 16:04 ../
drwxr-xr-x  7 1002  1002  8 Nov 21  2014 .freenas/
drwxrwxrwx  13 root  wheel  15 May  9 10:49 Media/
drwxr-xr-x  6 scott  scott  6 Jan 16  2016 Photos/
drwxr-xr-x  9 root  wheel  9 May  8 20:34 jails/
drwxr-xr-x  4 scott  scott  4 Sep  8  2015 temp/

Seems stuff you thought would be there isn't. :( And there's no *.db file anywhere under the .freenas directory.

I await your next instruction.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
FWIW, if the system dataset is not in your pool, it was on your USB and could've contributed to its failure through constant writing.

I'd suggest just getting on with it and restoring your old config to your new install.
 
Status
Not open for further replies.
Top