Need help for the configuration file of true nas core

Nemo_hey

Cadet
Joined
Mar 12, 2023
Messages
8
I uploaded my old config file to the the TrueNas server by coincidence, and enabled it (reboot), and forgot to save the new configuration........ lost my pool and all of the data on it now, could you please help me to get the new config back?

So appreciate it!

Regards,
 
Joined
Oct 22, 2019
Messages
3,641
Chicken and egg?

What do you mean you forgot to save the "new" config? Do you mean the configuration that existed before you uploaded the old (incorrect) config?

You can find a daily copy of your configs under:
/var/db/system/configs-XXXXXXXX/


lost my pool and all of the data on it now
Resetting and uploading a config file does not destroy any data on your storage pools. Your pool is probably not imported.
 
Last edited:

Nemo_hey

Cadet
Joined
Mar 12, 2023
Messages
8
Thank you for your reply.

But I can only find the "samba4" in the folder: /var/db/system

And unfortunately, I uploaded several times of the old config, I tried the /data/freenas-v1.db and freenas-v1.db-bak, either of them was working.
As per the time stamp of these two files, I think they were replaced by new config (I mean the config I uploaded).

Are there any other places storing the previous config ( I mean, the config before I uploaded the "old" one)?

Thanks a lot.

Chicken and egg?

What do you mean you forgot to save the "new" config? Do you mean the configuration that existed before you uploaded the old (incorrect) config?

You can find a daily copy of your configs under:
/var/db/system/configs-XXXXXXXX/



Resetting and uploading a config file does not destroy any data on your storage pools. Your pool is probably not imported.
 

Nemo_hey

Cadet
Joined
Mar 12, 2023
Messages
8
Thank you for your reply.

But I can only find the "samba4" in the folder: /var/db/system

And unfortunately, I uploaded several times of the old config, I tried the /data/freenas-v1.db and freenas-v1.db-bak, either of them was working.
As per the time stamp of these two files, I think they were replaced by new config (I mean the config I uploaded).

Are there any other places storing the previous config ( I mean, the config before I uploaded the "old" one)?

Thanks a lot.
Sorry "either of them was working" should be "neither of them".
 

Nemo_hey

Cadet
Joined
Mar 12, 2023
Messages
8
Resetting and uploading a config file does not destroy any data on your storage pools. Your pool is probably not imported.
Yes, thank you for the mention. How can I import them manually?
 

Nemo_hey

Cadet
Joined
Mar 12, 2023
Messages
8
There should be several subfolders in the /var/db/system/ directory...
Thank you. I think it's because of the different configuration?

Let me share my issue:
1, I wanted to resize my raidz2 pool by replacing the whole 6 2T HDDs of it, with 6 6T HDDs.
2, Given it's raidz2, I replace 2 disks each time.
3, For the first replacing, it worked pretty well, got 2 disks replaced one time.
4, For the second replacing, I thought the rebuilding is completed cuz the HDD led didn't flash, so I made a mistake, tried to replace the last two disks, but.... it's actually in rebuilding process, therefore, one 6T HDD got status to degraded.
5, As far for that time, everything is under control, I plug back the 2 old 2T disks, and the system continued to rebuilding ( with one HDD degraded).
6, My second mistake: I am not sure if the degraded disk will be fixed, then decided to put all thing back and do the replacing again, then I put the old 2T disks back to the NAS and turned on the server.
7, When I realized that the rebuilding process will be continued by system, I can only see two 2T disks with degraded status and one of them with "N/A" tag.
8, My biggest mistake: forgot to save current configuration of TrueNas at that time, but uploaded the old config twice to try to recover the old pool with that 6 2T disks.
9, For now, all the disks are tagged "N/A", no matter the 2T or 6T.
10, I checked the information:
zpool import -m -R /mnt/myraidz2
pool: myraidz2
id: 3601868900802525433
state: UNAVAIL
status: One or more devices are missing from the system.
action: The pool cannot be imported. Attach the missing
devices and try again.
see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-3C
config:

myraidz2 UNAVAIL insufficient replicas
raidz2-0 UNAVAIL insufficient replicas
gptid/315aeafb-e838-11e4-943e-0007e90d6bbf ONLINE
gptid/227fdc63-bfbc-11ed-9e3a-f452149c8a3c UNAVAIL cannot open
10908902397946344144 UNAVAIL cannot open
gptid/770182ab-bfbc-11ed-9e3a-f452149c8a3c UNAVAIL cannot open
2974473333754756972 UNAVAIL cannot open
gptid/11961761-ec1a-11e4-bb39-0007e90d6bbf ONLINE


glabel status
Name Status Components
gptid/e85a9455-b052-11ed-930b-f452149c8a3c N/A nvd0p1 -cache
gptid/11961761-ec1a-11e4-bb39-0007e90d6bbf N/A da5p1 -online
gptid/3388bb25-e838-11e4-943e-0007e90d6bbf N/A da4p1
gptid/bb373619-e9a9-11ea-9873-08606e47e79e N/A ada0p1 -bootssd
gptid/32de0570-e838-11e4-943e-0007e90d6bbf N/A da1p1
gptid/32365ec2-e838-11e4-943e-0007e90d6bbf N/A da0p1
gptid/315aeafb-e838-11e4-943e-0007e90d6bbf N/A da2p1 -online
gptid/ea840a1c-1412-11e6-b194-0007e90d6bbf N/A da3p1

It seems the system changed the gptid in the 4 disks of the 6 2T HDDs.

Now, my condition is:
1) No correct config for the 6T HDDs ( I forgot to save).
2) The backup config file cannot detect 4 of the 2T HDDs with new gptid.
3) The raidz2 pool is offline.

Could anybody help me to get my data back?
Will it work if I change the gptid of the disks or the configuration file of pool to make them match? If so, how to do that?
Or there is any other methods to recover the pool?

Much much appreciate it for your help!!
 
Joined
Oct 22, 2019
Messages
3,641
This has nothing to do with "uploading a config file" or "restoring from an old config file".

It sounds like you played a dangerous juggling game with your RAIDZ2 vdev, and may have inadvertently destroyed your pool. :oops:

A config file cannot restore a destroyed pool.

I honestly don't even know where to begin. It might be possible to restore your pool if you can re-replace your original 2-TiB drives. (That is, back to how things were. But I don't know how to re-attach/re-online a previously removed drive, in which it doesn't need to resilver, after you already tried to resilver the vdev using different drives.
 
Last edited:

Nemo_hey

Cadet
Joined
Mar 12, 2023
Messages
8
This has nothing to do with "uploading a config file" or "restoring from an old config file".

It sounds like you played a dangerous juggling game with your RAIDZ2 vdev, and may have inadvertently destroyed your pool. :oops:

A config file cannot restore a destroyed pool.

I honestly don't even know where to begin. It might be possible to restore your pool if you can re-replace your original 2-TiB drives. (That is, back to how things were. But I don't know how to re-attach/re-online a previously removed drive, in which it doesn't need to resilver, after you already tried to resilver the vdev using different drives.
Thank you, I am pretty sure the data is there, cuz I can read and write my pool after my second mistake.
 

Nemo_hey

Cadet
Joined
Mar 12, 2023
Messages
8
Thank you, I am pretty sure the data is there, cuz I can read and write my pool after my second mistake.
Yes, it was what I thinking of: go back to the original pool with 6 2T HDDs, but it got weird after my several mistakes. Eventually, I realized it's just stuck in the process of replacing the second couple of HDDs, there were 4 disks online at that time, and this is why I could still read and write the pool. Hence, I picked up the 2 2T HDDs and the 2 6T HDDs, tried to deploy a "degraded" raidz2 pool, and it worked, my data is back. I doubt that the reason of gptid changing is, system found that there are duplicated disks (which were replaced) in the pool, so it modified the gptid. Don't know too much of ZFS, just guess.

Anyway, thank you very much, you make me feel confidence when I was sad for my data.

Regards,
 
Top