Getting config from broken boot drive

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
Hi everyone,

My bootpool broke after replacing one of my SSD's (see my other post in the hardware forum), i can't boot anymore. It's stuck at Grub (not the rescue variant).

And you've guessed it: I don't have a backup of my config file.

I believe all the data on the drive should be there, so i'm wondering if it's possible to connect the drive to a Windows PC to copy the config file so i can reinstall my TrueNas?

Another question i have: If i do a re-install without the config backup, is my data pool still availble? Can it be imported or something? I don't think my pools were encypted.

Hope that someone can help me out, cause i'm in panic mode for last couple of days :(

Kind regards,
Dennis de Haan
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
You can import unencrypted pools in any system with a compatible version of zfs on it.

You will have to redo all your settings...but you can consider than your penance for no backups!

Windows will not read zfs. There is a zfs driver for windows but last I tried it it was ....eh.

Depending on what's wrong with the drive, your general idea is valid; mount it and grab the config

You could try this with one ofbthenlinix live disks, as long as it has zfs.

I would have to lookup the location of the actual file as I don't recall it offhand. Should be in the forum's somewhere though
 

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
You can import unencrypted pools in any system with a compatible version of zfs on it.

You will have to redo all your settings...but you can consider than your penance for no backups!

Windows will not read zfs. There is a zfs driver for windows but last I tried it it was ....eh.

Depending on what's wrong with the drive, your general idea is valid; mount it and grab the config

You could try this with one ofbthenlinix live disks, as long as it has zfs.

I would have to lookup the location of the actual file as I don't recall it offhand. Should be in the forum's somewhere though

Thank you for the reply. I found the location of the file, so that wouldn't be a problem.

I could install TrueNas on a USB stick with the data pool disconnected and only attacht the boot drives and mount them. I think i'll give that a try ;) Thanks again!
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
You might have problems trying to import boot-pool into into truenas that way. They will have the same name, and the webui probably will refuse to even show it

I would instead get a live cd/usb for a distro that has zfs included.

If you continue, you would likely need to import it manually and rename it, something like:

zpool import boot-pool boot-pool-recover
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
A nightly backup of the Scale config is stored /var/db/system/configs*/True*, look for the latest file in your current version folder. You will recover most of your config much easier if you can get that off the disk.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
Oh, that's right! I completely forgot about that.
Again....Hmm.
 

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
A nightly backup of the Scale config is stored /var/db/system/configs*/True*, look for the latest file in your current version folder. You will recover most of your config much easier if you can get that off the disk.

Thank you for the info. That is great news, but how do i access that folder? Can i use an freah USB boot installation of TrueNas, or do i need a Linux distribution with ZFS supprt for this as artlessknave suggested?

As a second option i'm going to dissasemble the failed SSD in the hope it's a capacitor that's shorted and i can boot once from this drive to secure the configs.
 

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
To clarify, the boot of Truenas give this error and then boots into grub after replacing a broken boot ssd. It looks to me like a grub config error, but i don't have the knowledge to fix this and couldn't find anything on the internet other than re-install Truenas with a back-up config.

Thanks for all the responses so far ;)
 

Attachments

  • vlcsnap-2024-03-01-09h36m12s803.png
    vlcsnap-2024-03-01-09h36m12s803.png
    1.4 MB · Views: 35
  • vlcsnap-2024-03-01-09h36m50s440.png
    vlcsnap-2024-03-01-09h36m50s440.png
    1.5 MB · Views: 36

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
So, i've disassembled the SSD and tried to fix it, but there are no shorts to be found. Looks like this one is fully broken, no more Kingston SSD's for me (the ssd was 5 months in use).

I cloned the remaining boot drives to other ssd's so i can expirement with them to extract the config. Booted Truenas from a USB installation and as expected the two bootpools are conflicting. So i'm left with a linux distribution to mount the bootpool.

Any suggestions on wich distribution, that supports ZFS, to use? And how do i get it onto a Windows PC?

Thanks in advance for all the help.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
but how do i access that folder?
this should work the same with truenas or any other distro with a compatible version of zfs
something like this:
install truenas fresh.
import your data pool
copy a config file from /var/db/system/configs*/True* into a location you can share.
copy the file from the shared location to local disk
upload the config. this will reboot truenas and the config will be applied.
 

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
So i actually got somewhere, but don't know how to proceed. I used Linux Mint (supports ZFS).

I renamed the boot-pool to old-pool and can import it with no error. In the second picture i checked the mountpoint, but don't know how to mount it. I've tried different different mount options (mount -t zfs and zfs mount), but getting errors like can't find old-pool/ROOT/default in /etc/fstab or cannot mount legacy mountpoint.

And what item do i mount from this list? :)

Thanks again for the help!
 

Attachments

  • 20240302_124236.jpg
    20240302_124236.jpg
    427.2 KB · Views: 36
  • 20240302_124436.jpg
    20240302_124436.jpg
    422.4 KB · Views: 37
  • 20240302_124613.jpg
    20240302_124613.jpg
    415.1 KB · Views: 33

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
What will happen if i just re-install Truenas without a config? Can my data pool and datasets be imported without issues. I'm 99% sure they're not incrypted.

Would love to pick the config file from the old bootpool, but have no idea how to mount it.
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
do man zfs-mount for how to mount, you'll need the directory to exist on the system you are trying to mount on. I would mount /ROOT
 

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
Thanks Sfatula for the info.

I installed a fresh TrueNas on an old HDD and tried to mount the drives, but same errors. I think this is because i changed the mountpoints of the pool when trying stuff using Linux Mint.

So i'm now cloning the old drives again, going to only rename the old bootpool in Linux Mint and than trying to mount it again.

Tomorrow i'll try mounting the drives again with TrueNas... Fingers crossed :)
 

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
So, somehow it took a turn for the worse. The copy on the clone drives became corrupt by all the test commands i used. So i cloned the disks again, but it failed... Seems the other old drive is also gone now, so no config file to re-install TrueNas.

Can anybody tell what the risks are when i build a new TrueNas install on two new SSD's. Can i import my pool and datasets without any problem? I don't mind configuring TrueNas again as long as i can access my data.

My plan:
- Use two brand new SSD's
- Install TrueNas without any storage attached
- Config TrueNas (network, etc).
- Shutdown and attach the storage drive
- Import the data pool (and hopefully the datasets).

Is this the right approach?
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
Can i import my pool and datasets without any problem?
as long as they arent damaged any pool will import just fine; this is by design.

your plan is unnecessarily complex while also being incomplete. (there is no need to install or config without storage - often this is pointless cuz most of the config requires the pool to confure things like network shares anyway)
  • install truenas on the new SSDs
  • import pool (datasets are part of pool; if the pool works everything will be there)
  • once pool imported, check /var/db/system/configs*/True*, for existing config (iirc if your previous system dataset was on data pool, it should be there, if it was on the boot pool it will be gone).
  • if config found, restore it (will reboot); if not found, config manually.
 

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
Thank you artlessknave for the info and i did exactly what you described. Unfortunately there was no config to be found, at least i could not find it, but i have spend my Saturday to create a new one. Since i had documented my last install, it wasn't too hard.

I am back up and running!

I want to thank all members who helped my figuring this out and i WILL backup my config :)
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506

ddehan

Dabbler
Joined
May 27, 2023
Messages
19
Once again i want to thank all of you for all the help. Bringing back my TrueNas server without a backup config was a pretty scary thought, but i worked perfect!
 
Top