Restoring a zpool after motherboard failed

My server stopped turning on and in the process of troubleshooting, I may have deleted the Freenas on the boot drive. Ultimately I found the motherboard to be the issue and transferred the hard drives to another computer I had. I could not remember what version of Freenas I had so I first tried version 13.3 in hopes it would auto recover the zpool. I got it to import and could see the dataset, but had issues with accessing it even after trying the chown command. Doing some more reading, I went ahead and tried installing 25.04.2.6.

GUI was easier to use and import still finds the zpool but due to how the zpool wasn’t exported, I have issues importing on this version. Using the shell, I imported with -F command which seems to work, but I don’t see it in the GUI and can’t seem to access the dataset either. Been searching youtube and the forum and just can’t seem to figure out next steps to even try. Any help is greatly appreciated as I’m now at the point of just wanting to recover the data on the hard drives.

You need to provided better details on your current server and the status of your pools, If you have run any commands in the command line, CLI, please post the results back using Preformatted Text (</>) on tool bar or Ctrl+e.

I am guessing you are trying to share the data and access it over SMB? There have been changes on how SMB sharing is done since FreeNAS and TrueNAS. Sharing of a root dataset isn’t done. Sharing is now set up using a child dataset and allowing SMB sharing of that.

Please post as much details of your current situation and where you are. The following is run in the Shell windows (CLI) and posting the results may help someone.


    sudo zpool import
    sudo zpool status -v
```
1 Like

Yes, I must’ve had SMB as I was accessing it using windows as a mapped network drive.

sudo zpool import gives me the following:

sudo zpool import
[sudo] password for truenas_admin: 
  pool: General
    id: 2493173140690128379
 state: ONLINE
status: Some supported features are not enabled on the pool.
        (Note that they may be intentionally disabled if the
        'compatibility' property is set.)
action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
config:

        General     ONLINE
          raidz2-0  ONLINE
            sdc2    ONLINE
            sdb2    ONLINE
            sde2    ONLINE
            sdd2    ONLINE
truenas_admin@truenas[~]$ sudo zpool status -v
  pool: boot-pool
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        boot-pool   ONLINE       0     0     0
          sda3      ONLINE       0     0     0

sudo zpool status -v gives me the following

sudo zpool status -v
  pool: boot-pool
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        boot-pool   ONLINE       0     0     0
          sda3      ONLINE       0     0     0

sudo zpool list gives me the following:

sudo zpool list
NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
boot-pool   222G  2.80G   219G        -         -     0%     1%  1.00x    ONLINE  -

Not sure why my boot drive is showing as a pool. I’m fairly certain ā€œGeneralā€ was my original dataset and assume it’s my pool (was mnt/General) and I had multiple subfolders within General. I tried the following:

sudo zpool import General
cannot mount '/General': failed to create mountpoint: Read-only file system
Import was successful, but unable to mount some datasets

Any ideas of what to try would be appreciated. With my first try at 11.3, the GUI did ā€˜import’ as General automatically, but I could not access the dataset - I understood sharing of root is no longer available and all permissions were greyed out for the root folder ā€˜General’. Now I’m seemingly not even able to import.

Listing of the boot-pool is normal as that is how the boot is set up as a separate pool to any data pools. Zpool import looks to be able to see your General pool. Can you post screenshots of your Storage and Datasets tabs of the TrueNAS GUI? I am wondering what you are showing.

Importing the General pool using the CLI, exporting it using the CLI and then importing it using the GUI may fix your current situation to get the pool showing the GUI, like normal. We can then work on the SMB sharing setup.

1 Like

The GUI shows empty and the import pool was empty until just now (not sure if one of the previous commands did something?)

I went ahead and selected to import it, and now it works. I can’t seem to upload any media or links to the post. The storage dashboard now has Topology 1x RaidZ2, 4 wide, 3.64 TiB. All VDEVs not assigned. Usage is showing 68.8%, 4.75TiB used, 2.15 TiB available. ZFS health shows Pool Status: Online, Total ZFS Errors:0. I do have a Scrub in Progress. Disk Health shows Disk Temp related alerts: 0, No data for the rest.

Datasets are showing now as well. Shows General (4.75TiB/2.15TiB) Unencrypted with a sub dataset of ā€œjailsā€ (feel free to ignore the ā€˜jails’, it was never used as I never could figure it out).

Going into Shares, it’s all empty so I assume I need to setup a SMB share now? Attempting to add I get the warning for root-level datasets - I’m not sure if this means if I don’t care about permissions it’ll work.

You will want to set up a child dataset of the root dataset just for SMB sharing. See the section of the Documenation on SMB sharing for the version of TrueNAS you are on. Sharing of the root dataset isn’t allowed and you probably need to set up a user on TrueNAS just for SMB sharing that owns that child dataset and has rights for SMB sharing. You will probably have to move data from the root dataset into the child and fix the permissions. Use the docs to set up the new share and test it to make sure it works and then work on moving data and fixing permissions / ownership.

1 Like

I understand sharing of the root instead allowed. I created the child dataset and have permissions set up and can open it in windows.

I’m not understanding how that helps me access the root dataset files. Using the Documentation Hub it just points me to rsync or cp. However, when I try to do so, each of the subfolders have ā€œPermission deniedā€

Ultimately, how do I access my original data in the root folder? Note that when I go to permissions for the root dataset, it’s greyed out with the message ā€œPermissions cannot be modified on a root datasetā€

You will want to copy some files from the root dataset into the child dataset. You may have to use the SU command to switch user to the one that owns the SMB child dataset to copy from the root dataset using the command line (CLI) Test using a simple file or folder and make sure you can see and access it through the SMB share. You will need to fix the owner and permissions inside the SMB share recursively, I think.

1 Like

Thank you. For some reason I had to change my NAS IP for windows to register the new child dataset SMB. Then it required me to SU to root after setting a password for root (the disable password wasn’t letting me change to root). Then I had to use cp -r instead of rsync -aA but it’s finally copying one of the folders. Hopefully the rest will copy as well. Appreciate the help!