Recover all setting without config after boot ssd failure

Hey guys, I’m moron, I know, but I need your help.

Boot drive has failed and Inecer did any backup config file.
The dataset drives are not encrypted so I will have access to it after fresh installation.

I read somewhere that the system saves the config automatically in the dataset.
Where is the location or how can I get access to the config file to restore the previous system?

I’m not that common with the truenas system and all I’ve done there took me long time and to do it all over again will take me decades.

Thanks a lot for the help!

1 Like

My boot disk is also failing. parted sees four partitions,

  1. unknown filesystem; 1MB; bios_grub, legacy_boot flags set
  2. unknown filesystem; 512MB; boot, esp flags set
  3. unknown filesystem; 16GB; swap flag set
  4. zfs; label=boot-pool; 460GB

Is the /data located in the ZFS boot-pool, or in the broken boot partition?

I eventually figured this out. I created a live USB using systemrescue+ZFS. I was able to do the following to get the config database:

zpool import boot-pool
zpool status
zfs list
#This showed a few filesystems boot-pool/ROOT/22.12.x.y with legacy mountpoints
mount -t zfs boot-pool/ROOT/22.12.4.2 /mnt
cd /mnt/data
ls

And the freenas-v1.db was there! I was able to copy it off onto a USB stick. Now I just need to go and try to recover this onto a new boot disk.

I finally got my new boot drives and re-installed the same version I had been running before. I imported the freenas-v1.db, but it didn’t unlock one of the datasets. The missing information is in this post, where you have to tar together the database and the pwenc_secret file:

Save configuration database with pwenc_secret file

Alternatively, you can use the python script here to extract the keys without creating the tar file and unlock the dataset in the GUI.

Extract Dataset Keys

1 Like