zfs pool and settings restore after power failure

Status
Not open for further replies.

olle

Dabbler
Joined
Jun 17, 2013
Messages
17
Ok, so I had a power failure at home which made my Freenas not boot. None of it´s services are available, webui, nfs, smb, torrent etc. It was installed on a USB thumbdrive and I highly suspect that the data became corrupt due to the power failure. In my understanding I can´t even use console to check zfspool status etc. Tons of error messages are just running on my screen and I can´t use the keyboard for input.

Ok, so how worried should I be? If it is possible to restore my zfs pool I would be content with that, but I would much rather backup my settings as well as I don´t remember how I managed to set half of them right, with all these jail and permissions and what not.

My first idea was to backup the thumbdrive with win32diskimager, install the latest freenas on the thumbdrive, restore the pool and just hope that my one year backup up settings has the settings I want. But it does not seem that easy to import a zfs pool without first exporting it. Or does it work?

Another idea is to get the recent settings from freenas-v1.db by copying it from the thumbdrive to the pool, but how would I do that when i can´t write any commands in console?

Yet another idea is to install the latest freenas on a new thumbdrive, then try to retrieve freenas-v1.db by plugging in the old one. If this is possible I guess the problem with importing the pool is still present.

What do you guys think?
The main goal here is to restore the pool if possible, as I know you already guessed, contains very precious data...

I have attached some pictures of what happens when I try to boot freenas. These different types of text are just looping in turn.

And yes I will buy an UPS, I have learned my lesson now :(

I would really appreciate some thoughts about this because zfs pools are quite delicate business and I don´t want mess something up before consulting someone more knowledgeble than me.
 

Attachments

  • DSC_0697.jpg
    DSC_0697.jpg
    346.7 KB · Views: 264
  • DSC_0698.jpg
    DSC_0698.jpg
    372.1 KB · Views: 266
  • DSC_0696.jpg
    DSC_0696.jpg
    342.2 KB · Views: 247
  • DSC_0693.jpg
    DSC_0693.jpg
    383.3 KB · Views: 244

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
My advice is to remove the flash drive, install a new flash drive and install the FreeNAS boot image to it by method of your choice. Go simple and see if you have access to your data, worry about setting up plugins later. And go buy the UPS, depending on your system make sure it will last 20 minutes if possible, definately need the USB data cable so the UPS can signal the NAS to shut down.
 

olle

Dabbler
Joined
Jun 17, 2013
Messages
17
My advice is to remove the flash drive, install a new flash drive and install the FreeNAS boot image to it by method of your choice. Go simple and see if you have access to your data, worry about setting up plugins later. And go buy the UPS, depending on your system make sure it will last 20 minutes if possible, definately need the USB data cable so the UPS can signal the NAS to shut down.

Ok, I will try it. I´m not really sure what you mean exactly by go simple, but I´m guessing something less radical than import the pool?

Should importing the pool be possible with
zpool import -f
?
Can i identify present pools in some way (I don´t remember the name of the pool)

Wouldn´t my guess that the pool is unharmed be right? That it is just the flashdrive that became corrupt? (just so that I can sleep tonight ; )

About the UPS, I definitly agree. These are the aspects I´m looking for as well as a well known brand and a quit unit.
 

survive

Behold the Wumpus
Moderator
Joined
May 28, 2011
Messages
875
Hi olle,

By simple joeschmuck means you should start with a fresh install on (an ideally) different USB key, get the system up with as simple a config as you can and see if you can auto-import the pool.

Don't panic, don't get to far ahead of yourself. Try the simple approach and see where you get.

The absolute worst thing you can do is start running commands that you don't fully understand. Don't start by running the commands that are usually reserved for "last resort" recovery.

-Will
 

olle

Dabbler
Joined
Jun 17, 2013
Messages
17
Ok, I will try this when I get home from work and report back.

Thanks for your answers!
Regards
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Thanks Will for filling in where I wasn't clear. I was clear in my own mind :).

Olle, use the GUI Auto-Import only, don't use the command line unless someone specifically tells you to. As Will said, don't start running commands that you don't fully understand. And just take things slow. People in a hurry will destroy their data very quickly. In the end you might not be able to recover your configuration although I have seen people do it but I'd think the most important thing is to ensure you don't loose any data.

Good Luck!
 

olle

Dabbler
Joined
Jun 17, 2013
Messages
17
Guys, my data was intact!
The pool was auto-imported succesfully!
I am very grateful, because now only time is needed to make everything right again.

So I´m now in a new situation. I have a brand new flash drive with the latest version of freenas. I also have an at least partly corrupted flash drive with an earlier version of freenas on it (8.2)

I also have a backed up config file from one year ago. It should be for version 8.2.

Is there any harm in trying that settings file? But more importantly: how would I go about retreiving the freenas-v1.db file from the corrupted flash drive?

Once again thank you!
Regards, Olle

*Edit
The previous installation was 8.2, not 8.1
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I honestly don't know if you can use an 8.2 version on the 8.3 version, someone else here would know. I don't think you could load the 8.3 config into the 8.3 system either. What you could do is just reload 8.2 to the new flash drive and then load your old configuration file. That should put you back to normal, hopefully. Then if you wanted to upgrade to 8.3 you have that option but you don't have to if you're happy with 8.2.

If you can I would recommend just setting up everything again on the 8.3 version but I don't know if you had a ton of users and settings.

And glad you didn't get in a hurry and you got your data back.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
I honestly don't know if you can use an 8.2 version on the 8.3 version, someone else here would know. I don't think you could load the 8.3 config into the 8.3 system either.
If it's the same exact version you can simply overwrite it and restart. This will not work with an earlier version. However, it may be possible to import the old 8.2 db file via the GUI into the latest version. Keep in mind you are skipping a major release and that doesn't always work out.
 

olle

Dabbler
Joined
Jun 17, 2013
Messages
17
I set up everything from scratch. It was good as a reminder for me. I hope this thread can help others, and once again, thank you!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Glad you resolved the issue overall.
 
Status
Not open for further replies.
Top