0

I have a TrueNAS pool being used for the apps I want to create a new pool with new hard drives but I don't want to change any app configs how do I clone it and if possible I want to change it from mirror to RAID-Z1.

1 Answers1

1

The app configs are typically stored in the ix-apps dataset of the pool used by the Apps. It is seen as mounted on the /mnt directory of the TrueNAS system as /mnt/.ix-apps, i.e., ZFS pool attribute ALTROOT is set to /mnt for the pool.

The following steps worked for me on TrueNAS 25.04.0. It may work for you if you are using this version.

  1. Unset the current pool for Apps, if the Apps Service is already running (let's refer to it as pool1). Take care to stop any running app(s) and ensure they are in stopped state before the pool is unset. (This will unmount the ix-apps dataset on pool1)
  2. Create a pool with the disk/VDEV configuration that you want to make as the new pool for Apps (let's refer to it as pool2)
  3. Set it as the pool for Apps. (This will create the ix-apps dataset on pool2 and mount it on /mnt/.ix-apps)
  4. Then unset pool2 as the pool for Apps. (This will unmount the pool2/ix-apps dataset)
  5. Replicate the pool1/ix-apps dataset to the pool2/ix-apps dataset. (In the replication wizard: On Page 1 - Both Source and Destination location are set to be on this system. Source dataset is set to pool1/ix-apps. Destination dataset is set to pool2/ix-apps. Do not check the /mnt checkbox on Source dataset. Check "Recursive" option for the snapshots on Source dataset. On Page 2 - Select "Run Once". Uncheck "Make Destination Dataset Read-Only". Set "Destination Snapshot Lifetime" : Same as source.)
  6. Run the replication job.
  7. Set pool2 as the pool for Apps again. (You may see the Apps Service is running and also the individual app(s) now. Run the app(s) and verify the app(s) are running)
  8. Export pool1. (Uncheck both options "Destroy data on the pool" and "Delete any saved TrueNAS configurations on the pool" before starting the export. Confirm the option Export/Disconnect)

Note: If you happen to get an error in the replication job in step 6 - like: ReplicationError("Target dataset 'pool2/ix-apps/truenas_catalog' does not have matching snapshots but has data and replication from scratch is not allowed. Refusing to overwrite existing data.") then go into the Linux CLI on the TrueNAS console and run the following commands:

  1. zfs destroy pool2/ix-apps/truenas_catalog
  2. zfs create -o aclmode=discard -o acltype=posix -o casesensitivity=sensitive -o atime=off -o canmount=noauto -o dedup=off -o exec=on -o normalization=none -o overlay=on -o setuid=on -o snapdir=hidden -o xattr=sa pool2/ix-apps/truenas_catalog

Then re-run the replication job and go to the next step.

These are unsupported/undocumented steps and may not work for all apps. For some apps if there are any additional application settings/user data that are not stored in the ix-apps dataset, investigation will be required to find out on which zfs dataset the additional settings/data related to the app(s) is stored on the Apps pool. That dataset will then have to be replicated or recreated as appropriate.

storsan
  • 93
  • 9