Transferring config from corrupt USB

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
I went back to ealier posts and I see that you do have jail and household. so I'm thinking that's your current thing to sort out.
i'm look at my own systems to see how one you access a .system without it being mounted automatically to /var/db/system

alternatives to trying to mount it directly, you might be able to try either:
exporting and reimporting both, but in the other order
moving the system dataset via system > system dataset might automagically find your wayward config files. have never tried that. it should preseve everything as the separate configs are separate datasets
 
Last edited:

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
The import tool only found my household pool which was the only pool on the disks I transferred. I did have a jails pool but didn't bring those disk over. I'll try importing them over later. Hopefully the data would be there, so fingers crossed.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
The import tool only found my household pool which was the only pool on the disks I transferred. I did have a jails pool but didn't bring those disk over. I'll try importing them over later. Hopefully the data would be there, so fingers crossed.
The system dataset gets created on the first pool that is made in TrueNAS. Unless you changed it to the boot-pool, it should be there.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
Yeh, that should be the household pool. Jails was only used for my plex server in the past. Importing the jails pool is kind of a hail Mary just to eliminate.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
Quick update. I did import my Jails pool using one of the mirrored SSD that it was on. Still no prior configs found.

My Household pools is degraded at this point as one of the mirrored disks seems to have died over the weekend. I was kind of expecting this situation as the disks are rather old now. I can say that I at least have access to the movies via Plex and other data. I have a new disk on the way to replace.

At this point I think I'll try the multi_report script route with the old freenas boot USB. I'm honestly not hopeful on that route because of the state of the old boot-pool USB but I may try just to eliminate it as an option.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
again. zfs list | grep .system might show it. if it was on jails the pool and you simply imported it, that wouldn't show up in /var/db/system, which is *only* the .system dataset on households or the boot pool.
that command will show any instance of the .system data in any pool. if we can find it, we should be able to mount it and see if it has your configs.

that said...at this point, it might be easier to just rebuild it and make sure you have backups. you can simple create a cron job that backs up the db file to a set disk location. you can then do things like replicate that elsewhere or cloud sync it elsewhere.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
again. zfs list | grep .system might show it.
Sorry, I missed that suggestion. I just tried this as well with Jails imported but everything shows up in Household.

Code:
root@truenas[~]# zfs list | grep .system
Household/.system                                            285M  3.38T      596K  legacy
Household/.system/configs-bd26c8fd36fd4618a75dffa52c04f828   372K  3.38T      372K  legacy
Household/.system/configs-efe80cf173ee4613ae999183b3905792   264M  3.38T      264M  legacy
Household/.system/cores                                       96K  1024M       96K  legacy
Household/.system/rrd-bd26c8fd36fd4618a75dffa52c04f828      15.0M  3.38T     15.0M  legacy
Household/.system/rrd-efe80cf173ee4613ae999183b3905792        96K  3.38T       96K  legacy
Household/.system/samba4                                    1.00M  3.38T     1.00M  legacy
Household/.system/services                                    96K  3.38T       96K  legacy
Household/.system/syslog-bd26c8fd36fd4618a75dffa52c04f828    344K  3.38T      344K  legacy
Household/.system/syslog-efe80cf173ee4613ae999183b3905792   3.40M  3.38T     3.40M  legacy
Household/.system/webui                                       88K  3.38T       88K  legacy


Full zfs list output just to show that Jails is in there.

Code:
root@truenas[~]# zfs list
NAME                                                         USED  AVAIL     REFER  MOUNTPOINT
Household                                                   1.93T  3.38T      112K  /mnt/Household
Household/.system                                            285M  3.38T      596K  legacy
Household/.system/configs-bd26c8fd36fd4618a75dffa52c04f828   372K  3.38T      372K  legacy
Household/.system/configs-efe80cf173ee4613ae999183b3905792   264M  3.38T      264M  legacy
Household/.system/cores                                       96K  1024M       96K  legacy
Household/.system/rrd-bd26c8fd36fd4618a75dffa52c04f828      15.0M  3.38T     15.0M  legacy
Household/.system/rrd-efe80cf173ee4613ae999183b3905792        96K  3.38T       96K  legacy
Household/.system/samba4                                    1.00M  3.38T     1.00M  legacy
Household/.system/services                                    96K  3.38T       96K  legacy
Household/.system/syslog-bd26c8fd36fd4618a75dffa52c04f828    344K  3.38T      344K  legacy
Household/.system/syslog-efe80cf173ee4613ae999183b3905792   3.40M  3.38T     3.40M  legacy
Household/.system/webui                                       88K  3.38T       88K  legacy
Household/Backup                                             207G  3.38T      207G  /mnt/Household/Backup
Household/Media                                             1.73T  3.38T     1.73T  /mnt/Household/Media
Household/iocage                                            8.43M  3.38T     7.91M  /mnt/Household/iocage
Household/iocage/download                                     88K  3.38T       88K  /mnt/Household/iocage/download
Household/iocage/images                                       88K  3.38T       88K  /mnt/Household/iocage/images
Household/iocage/jails                                        88K  3.38T       88K  /mnt/Household/iocage/jails
Household/iocage/log                                          88K  3.38T       88K  /mnt/Household/iocage/log
Household/iocage/releases                                     88K  3.38T       88K  /mnt/Household/iocage/releases
Household/iocage/templates                                    88K  3.38T       88K  /mnt/Household/iocage/templates
Jails                                                       9.42G  96.2G      120K  /mnt/Jails
Jails/.warden-template-pluginjail--x86                       469M  96.2G      469M  /mnt/Jails/.warden-template-pluginjail--x86
Jails/.warden-template-pluginjail-9.3-x64                    449M  96.2G      449M  /mnt/Jails/.warden-template-pluginjail-9.3-x64
Jails/plexmediaserver_1                                     8.50G  96.2G     8.93G  /mnt/Jails/plexmediaserver_1
boot-pool                                                   1.30G  40.4G       24K  none
boot-pool/ROOT                                              1.29G  40.4G       24K  none
boot-pool/ROOT/Initial-Install                                 1K  40.4G     1.29G  legacy
boot-pool/ROOT/default 
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
welp. then I have no further ideas. something either caused it to not write those backups or nuked them.

I use this cron task to make backups from multiple truenas systems to my main nas over nfs. i then both replicate it to my backup nas and cloud sync it to a spare onedrive account (there are no passwords or ssh keys included so i don't care about it going to cloud).

it makes a local directory if it doesnt exist, mounts the remote location, makes a directory for the hostname, copies the db to a dated name with the version, and unmounts the remote location.
Code:
mkdir -p /mnt/bkp; mount redacted-nas1.locodm:/mnt/prod/bkp/configs /mnt/bkp; mkdir -p /mnt/bkp/`hostname -s`; cp /data/freenas-v1.db /mnt/bkp/`hostname -s`/`hostname -s`_`date +%Y%m%d.%H%M`_`cat /etc/version | cut -d' ' -f1`.db;umount /mnt/bkp; rmdir /mnt/bkp

you can simplify it down to something like this (you can change the location to whatever you want)
cp /data/freenas-v1.db /mnt/household/`hostname -s`/`hostname -s`_`date +%Y%m%d.%H%M`_`cat /etc/version | cut -d' ' -f1`.db
cp /data/freenas-v1.db /mnt/household/`hostname -s`_`date +%Y%m%d.%H%M`_`cat /etc/version | cut -d' ' -f1`.db

you can then simply set the cron schedule for how often you would like backups. put it in its own dataset and set the compression highest and it wont use much space. you will have to manually delete them though, I haven't bothered to build any cleanup. if you changed the date section to just be month, day, and/or hour it would give you a basic rotation, overwriting at the year mark.
(i have a few test systems and like 5 installs so I wanted an easy to copy command that would work on all of them)
 
Top