SOLVED Recovering config from failed USB OS

BitBug

Cadet
Joined
Feb 17, 2019
Messages
8
First time posting here and I'm pretty green with FreeNAS, but learning...

I've had several OS failures with using USB devices for the OS and despite having a mirror setup, they keep failing... long story short, I switched to an SSD after the last failure. After bring FreeNAS up on the SSD as the OS I went to restore my config backup... and I can't find it, which irritates me to no end because I am religious about backing up my config and putting it on a thumbdrive I carry with me, but its not there for whatever reason. Not to worry, I was able to access one of the bad USB's and can see my config file on a different system.

Here is where my lack of experience hurts me... I can add the USB to FreeNAS by plugging in into an open USB port and then Storage > Volume > Mount disk from the FreeNAS GUI and mount it. I can't figure out the next two things:

How to access the USB from Shell. It doesn't seem to mount like the other volumes I have?
How to Copy the .db file on the USB to the appropriate place on FreeNAS for it to use my config file? (i.e. System > General > Upload Config)

GUI process or CLI via Shell works for me either way.

Really appreciate any help anyone can give me.

Thanks!
 
D

dlavigne

Guest
A copy is saved for you. From https://www.ixsystems.com/documentation/freenas/11.2/system.html#general:

Save Config: save a backup copy of the current configuration database in the format hostname-version-architecture to the computer accessing the administrative interface. Saving the configuration after making any configuration changes is highly recommended. FreeNAS® automatically backs up the configuration database to the system dataset every morning at 3:45. However, this backup does not occur if the system is shut down at that time. If the system dataset is stored on the boot pool and the boot pool becomes unavailable, the backup will also not be available. The location of the system dataset can be viewed or set using System ‣ System Dataset.
 

BitBug

Cadet
Joined
Feb 17, 2019
Messages
8
I may not be explaining myself well. Let me try again:

- Had a FreeNAS 11 Server running with mirrored 2 x 32gb SanDisk Ultra USB Drives for the OS.
- Server failed and neither USB Drive would boot
- This has happened to me multiple times over the life of the server
- I am tired of the USBs failing, so this time I reinstalled OS on 1 x 120 GB Intel SSD I had lying around
- On the new install of FreeNAS via the FreeNAS WebGUI on my Windows 10 system I went to restore my configuration backup file I keep (i.e. *.db file) and could not find it. I've looked everywhere, but for whatever reason my configuration backup is gone.
- While the old USB sticks that failed will no longer boot up FreeNAS I AM able to mount one of them (System > Volume > Mount)
- I need help from that point with how to view the USB contents via Shell and copy the *.db file to a location I can upload it to FreeNAS to recover my configuration. I know the file is there still in the data directory of the USB drive, I just don't have the knowledge to know how to recover it.


Thank you.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Did you store your system dataset on the data pool or your boot device? If it was on the data pool you can find your config file in
/var/db/system/configs-****random_characters****. no need to mess with the old usb devices. I have a hunch that because your usb devices died so often that you stored your system dataset on your usb devices. *hint dont store your system dataset on your boot device, my usb devices are going on 5y without failure.

As for importing the usb stick and accessing the files i have no clue. Maybe watch /var/log/messages as you plug it in and see if it shows you a path it was mounted on?
 

BitBug

Cadet
Joined
Feb 17, 2019
Messages
8
Just following up that I got this solved. I never could pull the config file off the bad USB Boot Devices despite being able to see it. It dawned on me that once I could see the file that maybe it would boot for me one more time... and it did! I quickly made a backup Config file, then started poking around my drives to see what the hell had happened to my backup config I kept OFF this system so I would have access if needed.

How embarrassing to find that when moving a backup from another system to my FreeNAS system for deep storage, I had moved my backup configs with it. And thus when the FreeNAS server went down, so did my config. Lesson learned.

Anyhow, I have replaced the USB's with two SSD's mirrored and hope for a more robust and reliable OS then I have been getting with the USB's lately.

Thanks for your help.
 

BitBug

Cadet
Joined
Feb 17, 2019
Messages
8
Is there a way to mark this solved?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Edit thread, on the right towards the top. I've marked it for you.
 
Top