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.

14 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.

Thanks for this post, I got stuck for a bit until I worked out I had to start a command line with sudo on Truenas Scale Dragonfish-24.04.1.1 to execute commands (sudo zpool import original_name new_name)
My SMB shares were all lost but that’s fine, another opportunity to tidy up and practice my skills.

I’m haviong some issues doing this, (Scale 24.10 currently but had the same issue on 23.10 and 24.04) so i’m assuming its just me missign something.

I’m hoping the CLI from System > Shell > “cli” and running the zpool commands above ( tried sudo zpool toop) and its saying namespace zpool not found. Am i missing somethign , are there multiple CLIs or something (My machine is headless so cant access the CLI on the machine itself).

Instead of “cli” run sudo su -

Then you can use the zpool commands

1 Like

Great thank you. Turned out that 24.10 has a bug that break thats command but rolled back to 23.10 and that fixed it.

Were you having issues with the “zpool import” command on 24.10?

I’m having trouble importing the exported pool with this command in CLI - it says it cannot find it. But in the GUI is able to find it just fine.

I cannot roll back since I’m working with a relatively fresh install.

My issue was that the command itself could not be found rather than the pool. Was partly my issue ( ‘cli’ vs sudo su - ), but also the OS version.

Problem

Click here.

Solution

Worked perfectly, also have to adjust app pointers and snapshots, but easy to do. Thanks for sharing!

1 Like

Mine seems to be having some issue, I’ve run through exporting the pool with the gui, importing it with the new name in cli, exporting again but the gui still has the old name…

ElectricEel-24.10.0.2

followed the GUI Export instructions and that was successful.

CLI Steps using sudo zpool import showed no pools available to import.

Just entering my appropriate old name and the desired new name, fails to find exported pool.

I was hoping to not destroy all of my data on that pool, but the export from GUI appears to have not worked properly in Fangtooth.

After updating to 25.04 , Incus or Instances was unable to find a zpool. I read about how it was due to a space in the Zpool name. I needed to rename the Zpool without the space. These instruction though old, worked for me on 25.04!

1 Like

Thanks for this @Stux

I have a quick question on this process.

As an example at the moment I have two pools

array and temp, I have replicated data from array to temp. I want to rename temp to array.

I would assume that I first have to rename the array pool before I can rename the temp pool to array?

So, export/disconnect “array”
zpool import array new_name
zpool export new_name
import new_name through the gui

Now I can do the same process with the temp pool but taking the array pool name.

So, export/disconnect “temp”
zpool import temp array
zpool export array
import array through the gui

Would this be the correct process?

Pretty much