HOWTO: Rename a ZFS pool

The basic process to rename a ZFS pool is to export it from the GUI, import it in the CLI with the new name, then export it again, and re-import it in the GUI.

I find I normally want to do this after creating a new pool (with perhaps a different set of disks/layout), replicating my old pool to the new pool, and then I want to rename the new pool to the same as the old pool, and then all the shares work correctly, and its fairly transparent. Mostly.

(tested with TrueNAS CORE 12U8-1. Works with all versions, including SCALE, see Original Post)

So, firstly, you need to export your pool that you want to rename from the GUI. Note its name.

Before you do that, if your system-dataset is on the pool, its a good idea to move it back to a different pool, or perhaps the boot pool.

System → System Dataset, then select the pool you want to host it, and save.

Once that’s done,

Storage → Pools, the click the cog to the right of the pool you want to rename and choose “Export/Disconnect”

DO NOT TICK “Destroy data on this pool?”

It is up to you if you delete the shares, etc, or have to re-configure them when you re-import the pool.

TICK “Confirm Export/Disconnect” then click EXPORT/DISCONNECT

…

Once that is finished fire up a terminal and import the pool into the CLI with the new name.

zpool import original_name new_name

(replace original_name and new_name, respectively)

You can check your handy work with zpool status new_name

Then export the pool again

zpool export new_name

Then import it again in the GUI

Pools → Add, import existing

Job Done.

You may need to reconfigure your shares etc.

6 Likes

Ported this because AFAIK this functionality is still missing from SCALE, and when I next do it on SCALE, I plan to edit the post…

1 Like

Well done, sir! :clap:t2::clap:t2::clap:t2:

Succinct and easy to implement on TrueNAS Core thanks to your wonderfully written instructions.

Ran through the process on a test vdev before doing it with my primary vdevs.

Remember to copy the old vdev name because once it’s disconnect the name is gone!

1 Like

You should be able to get a list of candidate pools to import with zpool import

1 Like

Thanks, I followed this on TrueNAS-SCALE-23.10.2 and worked like a charm. My SMB shares came up fine and even the Bitwarden host on a Debian VM worked fine afterwards. The only slight hick-up was my total storage on my new pool still showed the max capacity of the old pool. But it was simple to fix it turned out the “Quota for this dataset” was set to the old value - I just deleted it and voila, perfect. Thanks for creating this.

This worked for me on TrueNAS CORE 13.0-U6.1 with a couple of hiccups.

When I attempted to export the pool from the GUI, the GUI told me an out-of-memory error had occurred and the export did not succeed. I noticed the shares for the pool had been deleted as I asked, presumably before the memory error occurred. This happened repeatedly despite the fact, it would seem, that on the second and subsequent attempts the shares for the relevant pool no longer needed to be deleted. It’s possible this could have been avoided had I deleted the shares myself in a separate step. Once I restarted, the export and the rest of the steps worked smoothly.

Sadly, Time Machine on at least one Mac then decided it didn’t like the data that was (from its perspective) in a new location, even though the data itself presumably did not change. So I had to start a fresh backup, but that’s fine because this is not yet a production system. It’s not clear what is to blame for this, but the Mac claimed it might be due to the share having disconnected during verification.