Unexpected pool state after config restore

BitCollider

Cadet
Joined
Jul 12, 2016
Messages
9
I’m migrating data from an old GELI encrypted pool to a larger, natively encrypted pool. (I think) I used a bad export command and my legacy pool seemed to disappear. I restored a config backup I took when both pools were still connected and when TrueNAS restarted, the legacy pool was back and the new pool was gone. I’d like to understand what happened and why.

Initial state:

- 4 drives in a RAIDz2 with GELI encryption. These are ada0-ada3. The pool is named zpool
- 2 drives mirrored as the boot pool. These are ada4-ada5. The pool is named boot_pool. This pool holds the system dataset.

The migration process:

I plugged four new drives into an HBA, adding da0-da3 to the system.

I set up a new pool, zpool2, choosing to encrypt the new root dataset.

I took snapshots of each dataset on zpool, then used the CLI to send/receive each dataset to zpool2. I confirmed that the data was present on zpool2.

Now I was ready to disconnect the legacy pool and rename the new pool to just zpool. Here’s what I did.
  1. Download a config backup, including secrets and legacy encryption keys
  2. Using the GUI, export/disconnect zpool and zpool2 leaving unchecked the two boxes.
  3. Using the CLI, zpool import zpool2 zpool
  4. Facepalm. Realize I probably just did something bad to my legacy pool. Oh well.
  5. Using the CLI, zpool export zpool
  6. Using the GUI, import zpool. My new, natively encrypted pool is now mounted.
  7. Wondering whether I could get my legacy pool back and feeling more confident because of my backups, I restored the config I took at the beginning of the process. TrueNAS restarted.
When the system came back up, zpool was mounted and zpool2 was listed but as unavailable. The mounted zpool is my legacy zpool. TrueNAS doesn’t list any other pools available for import and the disks tab lists N/A in the pool column for da0-da3.

So… what happened? Why did my legacy pool come back when I restored my config and what happened to the new pool? Is the data in the new pool unreachable or is there something I can do to avoid copying my old pool again?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You now have 2 pools (with different IDs) named zpool on your sets of disks.

Since there's already a pool called zpool in the GUI, it won't show you another one with the same name, so that explains why you can't see the new one right now.

When you restored your config, the old pool ID was used in the automount, so the old pool was of course the one chosen to mount.

What you would need to do is use zpool import to look at the new pool ID, then import it with the new pool ID (rather than the name)... and ideally rename it, so you don't run into further naming problems.
 

BitCollider

Cadet
Joined
Jul 12, 2016
Messages
9
Ahh. I had run `zpool import` and saw only one pool, zpool, and assumed it was showing me the one I had already imported. I understand now that it was an available-to-import pool. I renamed it and exported again, but TrueNAS still doesn't show it as an available pool to import in the GUI.

Here's what I did:

# zpool import
pool: zpool
id: 13932396901313879168
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

zpool ONLINE
raidz2-0 ONLINE
gptid/5094f307-2680-11ee-a5bf-0cc47ab62bf4 ONLINE
gptid/508a7403-2680-11ee-a5bf-0cc47ab62bf4 ONLINE
gptid/506d29b1-2680-11ee-a5bf-0cc47ab62bf4 ONLINE
gptid/50b0180c-2680-11ee-a5bf-0cc47ab62bf4 ONLINE

# zpool import 13932396901313879168 zpool-new

# zpool export zpool-new

Now when I run `zpool import` I do see the renamed zpool-new, but I don't see any pools available to import from the GUI. Should I?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Maybe a reboot is needed to deal with all the messing around.
 
Top