Deleting a "Zombie Pool"

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I recently created myself a "Zombie Pool" by yanking out a temporary USB disk I had attached to do a backup/restore, but hadn't exported from the GUI before destroying at the CLI.

This results in the GUI thinking the pool still exists, but isn't currently available, so it remains in the list showing as Unavailable/Offline and there's no option in the GUI to remove it at that point.

So a quick bit of remembering about @danb35 's creating a degraded pool resource gave me a clue about how to approach it (without futzing around getting the USB disk back out and reconnecting it... which for the sake of this exercise we'll pretend is just lost or something, not easily within reach and I'm just too lazy to do it as "facts" would indicate)

So what we'll do is create a "fake" pool with the same name and then export it from the GUI.

First create a sparsefile of the same size (doesn't matter as it's sparse and won't take any real amount of space):
truncate -s 1T /root/sparsefile

Then create your pool (in my case called tmp... make sure to match the name of the Zombie here /mnt X ):
zpool create -f -m /mnt tmp /root/sparsefile

Then go to the GUI and disconnect/export it. (doesn't matter if you select to wipe or not, don't bother)

Then you can remove the no longer needed sparsefile:
rm /root/sparsefile

EDIT: this process works on both TrueNAS CORE and SCALE
 
Last edited:

tutugreen

Cadet
Joined
Feb 2, 2022
Messages
1
I ran into the same problem.

Web UI stuck for a long time during pool disconnect.
The new tab shows "Connecting to TrueNAS ... Make sure the TrueNAS system is powered on and connected to the network.".

The console not responding to any key except ctrl alt del, the system seems "try" to restart, but failed to unmount some "log" again and again (If I remember correctly). After 5min later, I issued a "hard" reboot, the unwelcome zombie pool appear, can't do anything in UI.

Now I can see why this is an RC version.

Thanks for your guide! It works!
 

TangYao14

Cadet
Joined
Feb 27, 2022
Messages
1
Thanks! its worked! i been looking this for days!Can I reprint it to another website?just for share,And I will indicate the source and address
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

runevn

Explorer
Joined
Apr 4, 2019
Messages
63
Then create your pool (in my case called tmp... make sure to match the name of the Zombie here /mnt X ):
zpool create -f -m /mnt tmp /root/sparsefile
Thanks for the guide. However, I run into trouble on this command.

It return the following:
Code:
root@nas[~]# zpool create -f -m /mnt storagepool /root/sparsefile
mountpoint '/mnt' exists and is not empty use '-m' option to provide different default.


storagepool is an old pool and is still at the /mnt/storagepool mount point.

Any help is highly appreciated.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Try it like this:
zpool create -f -m /mnt/tmp_storagepool storagepool /root/sparsefile

You may need to mkdir /mnt/tmp_storagepool first
 
Last edited:

runevn

Explorer
Joined
Apr 4, 2019
Messages
63
Try it like this:
zpool create -f -m /mnt/tmp_storagepool storagepool /root/sparsefile
Thanks for your reply. I ran the command and no errors was shown, but there is no new pool in the GUI. However, the directory /mnt/temp_storagepool is created and I'm able to select it in the GUI when creating a new SMB share.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
OK, you should destroy that pool.

What I don't get is the state of your existing pool... you're saying it's offline in the GUI?

But it's still mounted in /mnt/storagepool ?

Can you show some screenshots and a zpool status -v storagepool
 

runevn

Explorer
Joined
Apr 4, 2019
Messages
63
OK, you should destroy that pool.

What I don't get is the state of your existing pool... you're saying it's offline in the GUI?

But it's still mounted in /mnt/storagepool ?

Can you show some screenshots and a zpool status -v storagepool

As you can see, only the current and working pool is visible in the GUI.

I don't know if storagepool might have been created when I removed the previous pool. It only has the homes directory in it. So maybe it is because I still have had the SMB homes sharing enabled while only having a System Dataset Pool?

Screenshot 2022-06-29 104330.png


Code:
root@nas[~]# zpool status -v storagepool
  pool: storagepool
 state: ONLINE
config:

        NAME                STATE     READ WRITE CKSUM
        storagepool         ONLINE       0     0     0
          /root/sparsefile  ONLINE       0     0     0

errors: No known data errors



Code:
root@nas[~]# ls -l /mnt
total 5
-rw-r--r--   1 root  wheel    5 Jun  9 11:16 md_size
drwxrwxrwx   3 root  wheel   64 Jun 24 13:53 storagepool
drwxr-xr-x  11 root  wheel  576 Jun 26 23:00 Storagepool
drwxr-xr-x   2 root  wheel    2 Jun 29 10:19 temp_storagepool



Code:
root@nas[~]# ls -l /mnt/storagepool/
total 0
drwxrwxrwx  5 root  wheel  192 Jun 24 15:24 homes
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
OK, so you can destroy the tmp_storagepool and delete the sparsefile to clean up.

All that seems to need doing is to delete the directory... rmdir /mnt/storagepool (unless you're telling me there are still contents in it?)
 

runevn

Explorer
Joined
Apr 4, 2019
Messages
63
OK, so you can destroy the tmp_storagepool and delete the sparsefile to clean up.

All that seems to need doing is to delete the directory... rmdir /mnt/storagepool (unless you're telling me there are still contents in it?)
Thanks for your help. I really appreciate it. How should I destroy tmp_storagepool when it is not visible in the GUI?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Top