Transferring config from corrupt USB

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
Hi all! Long story short here, I'm learning a hard lesson. My boot USB seemed to have corrupt on a quick blackout and I'm trying to get things going again.

I have installed Freenas 11.2-U8 on a new USB and am trying to restore my install with the config from the old USB. I've been working on Google searches but at this point, I feel like I'm a bit of a monkey on my keyboard trying different things.

Here are some things I've done on the command line:
Code:
root@freenas[~]# camcontrol devlist
<WDC WD30EFRX-68EUZN0 82.00A82>    at scbus0 target 0 lun 0 (pass0,ada0)
<WDC WD30EFRX-68EUZN0 82.00A82>    at scbus1 target 0 lun 0 (pass1,ada1)
<WDC WD30EFRX-68EUZN0 82.00A82>    at scbus2 target 0 lun 0 (pass2,ada2)
<WDC WD30EFRX-68EUZN0 82.00A82>    at scbus3 target 0 lun 0 (pass3,ada3)
<KINGSTON SV300S37A120G 608ABBF0>  at scbus6 target 0 lun 0 (pass4,ada4)
<KINGSTON SV300S37A120G 605ABBF2>  at scbus7 target 0 lun 0 (pass5,ada5)
<VendorCo ProductCode 2.00>        at scbus9 target 0 lun 0 (pass6,da0)
<SanDisk Cruzer Fit 1.26>          at scbus10 target 0 lun 0 (da1,pass7)


da0 is my newly installed flash drive and da1 is the old one that won't boot.

Code:
root@freenas[~]# zpool import
   pool: freenas-boot
     id: 156071699754310836
  state: ONLINE
 status: The pool was last accessed by another system.
 action: The pool can be imported using its name or numeric identifier and
    the '-f' flag.
   see: http://illumos.org/msg/ZFS-8000-EY
 config:

    freenas-boot                                  ONLINE
      gptid/25e564ed-9485-11e4-8a4b-7427ead4818d  ONLINE

   pool: Jails
     id: 5796307042325333398
  state: ONLINE
 status: The pool was last accessed by another system.
 action: The pool can be imported using its name or numeric identifier and
    the '-f' flag.
   see: http://illumos.org/msg/ZFS-8000-EY
 config:

    Jails                                           ONLINE
      mirror-0                                      ONLINE
        gptid/c8a3ef4e-dcd6-11e5-ac2c-7427ead4818d  ONLINE
        gptid/c8fb44f5-dcd6-11e5-ac2c-7427ead4818d  ONLINE

   pool: Household
     id: 5497875948946148045
  state: ONLINE
 status: The pool was last accessed by another system.
 action: The pool can be imported using its name or numeric identifier and
    the '-f' flag.
   see: http://illumos.org/msg/ZFS-8000-EY
 config:

    Household                                       ONLINE
      mirror-0                                      ONLINE
        gptid/74665fdb-5e5a-11e5-9c45-7427ead4818d  ONLINE
        gptid/753109e2-5e5a-11e5-9c45-7427ead4818d  ONLINE
      mirror-1                                      ONLINE
        gptid/6bc41aac-86a4-11e7-b00d-7427ead4818d  ONLINE
        gptid/6cda92cb-86a4-11e7-b00d-7427ead4818d  ONLINE


This looks like data from my old USB so I tried the following.

Code:
root@freenas[~]# zpool import -R /tmp/freenasbak freenas-boot
cannot import 'freenas-boot': a pool with that name already exists
use the form 'zpool import [-t] <pool | id> <newpool>' to give it a new temporary or permanent name


Taking the system's advice, I ran this. I had already tried without the -f and got an error telling me to try the -f flag.

Code:
root@freenas[~]# zpool import -t 156071699754310836 -R /tmp/freenasbak freenasbak   
cannot import 'freenas-boot': pool may be in use from other system, it was last accessed by freenas.local (hostid: 0xcea9e7f9) on Tue Dec  6 23:27:40 2022
use '-f' to import anyway
root@freenas[~]# zpool import -f -t 156071699754310836 -R /tmp/freenasbak freenasbak
cannot import 'freenas-boot' as 'freenasbak': one or more devices is currently unavailable


At this point I'm stumped. Could someone please give me some advice on how to get my old config off of the old USB so that I can put it on the new one and get my system back up and running?
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
it's failed. restore from a backup config.....you did backup your config, right?

failing that, set it up from scratch, as you didn't back it up and the single point of failure has failed.

additionally, USB is highly discouraged. ZFS eats USBs like candy.

and you haven't added your hardware; a forum requirement.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
it's failed. restore from a backup config.....you did backup your config, right?

failing that, set it up from scratch, as you didn't back it up and the single point of failure has failed.

additionally, USB is highly discouraged. ZFS eats USBs like candy.

and you haven't added your hardware; a forum requirement.

I have added my hardware info to my signature so I don't make the mistake of not posting it again. I'll update when I rebuild and transfer everything to a new system. As you can see, it's a rather old system that has been VERY reliable up to this point. When I built it, a USB drive was recommended which is why I had Freenas running on the USB but I'm learning, the hard way, the following lessons to apply to my new build.

  • Download and backup the config elsewhere
  • Boot drive on SSD
  • Mirror the boot drive

Being said, without the config, does this mean all of the data on the disks are gone as well?
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
data on the disks are gone as well?
not unless they also failed. the config is the config. users, shares, emails, snapshots etc.
data is stored on data disks for a reason. if the OS disk dies you can simply reinstall, restore config, and be back to where you were.

since that's not available, you will just import your pools and set everything back up how you want it. it's inconvenient but functionally the same - you just have to manually restore your config instead of using a function.

I have had some success with the sandisk cruzer fit series sandisk handles SSD-like functions better on USB than the cheaper stuff. I have some of these that work for years and others that fail in days, so your mileage will vary.
you could do a mirror with 1 ssd and 1 USB, if you are badly limited on drive bays.

you have realtek NIC, so YMMV already.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
When I built it, a USB drive was recommended
ya, this was the old way before boot was moved to ZFS. unfortunately, ZFS is both hard on the disk AND extremely good at detecting it failing, resulting in most USBs death.
the problem is that USB drives, particularly cheap ones from less known brands, typically do not have SSD functions like wear leveling that properly distribute writes over the drive. this means that your writes basically write over the same part of the drive until dead.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
not unless they also failed. the config is the config. users, shares, emails, snapshots etc.

Disks had been working fine before the system wouldn't boot so fingers crossed, they should be fine too. At this point, I think I should just move on to Truenas on the new hardware and import the pools. Or should I just do that on the old Freenas system first?
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
new hardware and import the pools.
if the goal was migrating there is no reason not to. any truenas zfs pool should import on any openzfs of same or newer version.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
Yep, I knew that the hardware was aging and that I needed to rebuild and upgrade to Truenas. The boot drive just forced it sooner. At least now I don't have to worry about going through the upgrade process since I'll be starting fresh with a new config.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
mm. have you tried truenas on this new system?
i question if this will have any network at all.
1 x 2.5 Gigabit LAN 10/100/1000/2500 Mb/s (Dragon RTL8125BG)
it may not work well.
neither of your listed hardware is a very good choice for TrueNAS. YMMV.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
Do you mean neither of the NIC or another piece of hardware?
motherboard, primarily, which means the RAM and CPU aren't really great choices either.
this is a desktop or gaming board, it looks like. TrueNAS should be used on a server board. that would be ASrock RACK line.

while it's provided free, TrueNAS is an appliance ultimately built, tested, and run on enterprise hardware. other hardware can be very iffy; realtek NIC's in particular are known to be garbage most of the time, and because of that FreeBSD tends to not update the drivers.

you should at least test the truenas install before moving any disks around, as if you have no network at all, you will need to plan out a better solution. a USB NIC is not a solution at all.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
Just got TrueNAS Core installed without much issue. The only minor issue was that I didn't get the 2.5 Gigabit LAN interface up. It's not necessary for me at this point so I'm not worried about that. I did have to go through the network configuration and used DHCP for now but I'll change that up later.

while it's provided free, TrueNAS is an appliance ultimately built, tested, and run on enterprise hardware. other hardware can be very iffy;
I really appreciate your input thus far! I don't mean to contradict this statement but I've seen it installed on similar hardware on a number of other tutorials that I've found across the web. In particular, I have been following Brian C Moses' DIY NAS installations and this year's gave me the inspiration for this install. As you mentioned YMMV:)

One bullet dodged with getting Truenas up....on to the next and learning how to import my disks from the borked system.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
One bullet dodged with getting Truenas up
soon, look like NEO, you will; supply of bullets, underestimated, you might have.

one of the other problems with realtek NICs (and this often extends to other non server grade hardware) is that, while they might "Be up" their version of "up" is often barely acceptable for a desktop, and they often choke on the volumn of a server.

one must always remmember that just just because you can get it "Working" doesn't mean it will work or that you should.

the forums are where people who followed the build guides in youtube videos go when their build fails them, sometimes catastrophically.
most of use hate seeing data lost, and highly advocate for getting supported gear and setups that will reliably not lose data.

over and over I see YouTube videos, sometimes with IX staff in them, who keep calling SLOG a "Write cache" when it's absolutely not a write cache, and expecting it to function like a write cache isn't going to make it a write cache. this means that people will add a SLOG device and wonder why their writes are slower. as this is normal for a (not-a-write-cache) LOG device, they often, again, come to the forums. sometimes they argue with the resident Grinch, which I highly recommend against trying.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
sometimes they argue with the resident Grinch
No argument intended at all. Again, I do appreciate your input into my issue as this is what the forum is meant for. I was just pointing out where I was coming from as I understand your perspective as well. I'm just a simple home user who backs up and uses my NAS for hosting my movies.

I will just hope that this hardware holds up for 10 years plus as the previous has. Aside from the USB boot drive.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
I will just hope that this hardware holds up for 10 years plus as the previous has.
you might consider using the old one for backups. that can make any issues you do run into, if any, less impactful overall.
 

cjastacio

Dabbler
Joined
Sep 14, 2018
Messages
22
I assume this is the procedure I should follow for the new system?

 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
how are they going to access files on an inaccessable disk? they can't import the old boot pool, and didn't save a copy of the config.
no pool = no files.
they already tried a read only import, but the pool only had one device and that one device is reporting unavailable. it's obviously enough to see that there was a pool, but not enough to import the pool even read-only. they also got the renaming part, which looks correct and I would expect it to have worked.
there is nothing to access. if the drive worked, totally, we could have gotten the config. it would have just needed new passwords.
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
Well, as I read it he’s expecting to import his pool with a new TrueNAS install …
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
there were 2 core questions:
how to recover old boot drive or config: cant, drive dead, no config backup. reinstall and setup.
if their data was lost: unlikely, unless they overwrote something trying to import the old install, but I don't see any sign of that in the commands.

that post applies to getting the config file, which is stored on the boot pool. there is no automatic backup to the data pool unless you make one. /var is on the boot pool
also, that file will not have password seeds and a few other things; the save config function is better.

which, now that I think of it, might not be a bad idea if they implemented: just like .system, they could make a .backup, and always stuff a backup there. but as this is for enterpise, that's probably not gonna get any traction.
 
Top