Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

7.1.4 - Issue with ZFS Pool

Featured Replies

original post on reddit;

Hi All,
I am using Unraid 7.1 and am facing a bit of an issue with the ZFS pool.

Lets start with how i got here; I have an Ugreen NAS (DXP6800) have 6 drives configured in raidz2 and have an SSD configured as read cache. I wanted to replace the read cache drive with a different drive which I had lying around (bigger) and so I turned off the NAS and replaced the drive.

After replacing the drive I went looking in the zpool and removed the cache through the terminal seeing as the UI was not really helping things along.

I have been tinkering with the zpool and the UI for some time now and I have reached a point where I need to ask for help/pointers as the zpool is kind of borked.

If i do zpool import it looks like this:

image.png

I have 2 references to my zpool. First one (64xxxx) I am able to properly import using zpool import <id> orion and am still able to access all the files under /mnt/orion

image.png

however the unraid UI is completely borked as I am not able to browse anything in there and it does not recognize the pool etc.

I have tried many things to try to import the "invalid" pool to try to remove it, but no success as I cannot import a pool where the devices are corrupted.

Any help/pointers would be appreciated

PS:

I do have to say that I attempted the "new config" method to see if the unraid feature for importing existing zfs pools would do the trick, but this also didnt work. Everything works fine if I do it command line.

I have attached the diagnostics as well.

#pray

tower-diagnostics-20250923-1903.zip

Edited by amaduro

Solved by bmartino1

  • amaduro changed the title to 7.1.4 - Issue with ZFS Pool
  • Community Expert
  • Solution

so, just to clarify so I'm understanding you correctly... as it looks like you messed up a special disk without informing zfs of the edit or changes... see warning at the end!

What Happened

  • You had a RAIDZ2 pool (orion) and attached an SSD as a special read-cache device.

  • When you physically swapped that SSD and manually removed it from the pool, ZFS left stale metadata device references in the pool config.

  • Now zpool import shows two pools with the same name:

    • Healthy pool (ID 6418…) → imports fine, all files accessible.

    • Broken ghost pool (ID 2517…) → marked UNAVAIL with “corrupted data / insufficient replicas” because the missing special vdev destroyed its internal config.

The ghost pool is confusing Unraid’s UI, which expects only one importable orion.

Some Key Observations

  • Your data pool is intact — proven by the fact you can zpool import 641826… orion and access /mnt/orion.

  • The invalid pool is just a stale configuration entry, not another real set of disks. It references corrupted/nonexistent metadata replicas.

  • The Unraid UI is choking because it sees both references.

so lets review a potential recover plan. as we may need to invoke parts of the new config to erase the old ID and what unraid is tryign to do....

first lets Identify the Good Pool. you should know/have this given that you can mount the zfs array.

zpool import

Note the good pool ID (641826…). That’s the one to keep...

as not all data is in the diag file. the daig help but i don't have enoth info to give full commands.

Next we need to Force Import the Good Pool

If it’s not already imported:

zpool import -f -o cachefile=/etc/zfs/zpool.cache 64182623996842760 orion

*If the 6#### id is the good one...

This writes a fresh zpool.cache containing only the working config.

As we willb e dealign with zfs acl and cofig first...

Then you will need to Clear the Ghost Pool Reference

The “bad” pool is only metadata. To drop it:

  1. Make sure the good pool is imported.

    1. zpool import -D

    2. Should show destroyed pools or corrupted entries

  2. If the bad ID appears, you can remove its ghost reference with

    1. zpool import -D -f <bad_pool_id>

    2. Or, safer: let the system rebuild the cache file (next step).

      1. as the system may do a scrub or resync...

Finally we fix zfs with a cache rebuild with the new disk.

Rebuild ZFS Cache Sometimes Unraid/ZoL just holds onto the stale entry. Refresh the cache:

zpool set cachefile=/etc/zfs/zpool.cache orion

or

zpool export orion

zpool import -o cachefile=/etc/zfs/zpool.cache orion

This ensures only the good pool is seen.

Once the sync is finished...

now we can look at unraid and its UI...

  1. Reboot after the above so Unraid reloads the single valid pool.

  2. If the UI still shows broken references, remove /boot/config/plugins/zfs/zpool.cache (Unraid keeps its own copy) and let it regenerate after next import.

then on the next boot the array should work as intended...

Try the zpool export / import sequence with a rebuilt zpool.cache, then reboot Unraid. That should leave you with only the healthy pool (ID 6418…).

Warnings!!!

  • Do NOT attempt to import the corrupted pool (2517…). That pool truly has missing devices (special vdev) and importing it risks confusion.

  • Do NOT run zpool clear or zpool replace on the bad entry. It won’t fix it — it’s not a real pool anymore.

  • Your data is safe in the good pool. The goal is just cleaning up stale metadata so Unraid stops seeing two.

  • Community Expert

I asume you also have some unriad plugins insalled like the zfs master plugin

Some Best Practices for a ZFS only Setup:

View ZFS Forum Info 

ZFS Unraid Docs

Unraid caches ZFS pool configs separately from the normal /etc/zfs/zpool.cache. That’s why you’re seeing the “ghost” pool in the UI even though the CLI import is fine.

so we may need to clear the plugin data for teh ghost pool...

Make Sure the Good Pool Is Healthy

(Post above)

First confirm you can import and mount the good pool (ID 641826…):

zpool export orion

zpool import -f 64182623996842760 orion

zpool status orion

You should see all ONLINE drives and be able to browse /mnt/orion.

Backup Unraid’s ZFS Plugin Config

Before deleting anything:

cp -r /boot/config/plugins/zfs /boot/config/plugins/zfs.bak.$(date +%F)

That way if the UI gets upset, you can roll back.

Remove the Stale Pool Entries

Inside /boot/config/plugins/zfs/ you’ll likely find:

  • zpool.cache

  • Possibly per-pool config files (orion.cfg, orion*.dat etc.)

Do this:

rm /boot/config/plugins/zfs/zpool.cache

rm /boot/config/plugins/zfs/*.dat

rm /boot/config/plugins/zfs/*.cfg

(Leave the directory itself — just clear the stale metadata.)

Re-Export and Re-Import to Regenerate

Now regenerate the correct config:

zpool export orion

zpool import -o cachefile=/boot/config/plugins/zfs/zpool.cache orion

This creates a fresh plugin cache with only the good pool.

Reboot and Verify

After reboot, the Unraid UI should now only see the healthy pool.
Check:

if unraid ui doens't see it user script plugin and

zpool import

zpool status


Warrning:

!!!!!Do NOT run zpool labelclear on your data drives. Only the old cache SSD.!!!!!

Optional: Disable Ghost Discovery

zpool labelclear -f /dev/sdX

*on the removed read-cache SSD (if you still have it attached somewhere). That wipes the leftover ZFS label so it won’t ever advertise itself as part of orion.
telling zfs that that disk is no longer the read cache...

  • Community Expert

Unraid ZFS Ghost Pool Cleanup Script

#!/bin/bash
# Unraid ZFS Ghost Pool Cleanup Script
# This script will:
# 1. Verify the healthy pool (orion) is present
# 2. Backup plugin configs
# 3. Clear stale ZFS plugin metadata
# 4. Rebuild zpool.cache with only the healthy pool
# 5. Optionally wipe old labels from a removed SSD (if attached)

POOL_NAME="orion"
GOOD_POOL_ID="64182623996842760"
PLUGIN_DIR="/boot/config/plugins/zfs"
BACKUP_DIR="${PLUGIN_DIR}.bak.$(date +%F-%H%M)"

echo "=== Step 1: Checking current pools ==="
zpool import

echo
echo "=== Step 2: Backing up ZFS plugin configs to $BACKUP_DIR ==="
mkdir -p "$BACKUP_DIR"
cp -r $PLUGIN_DIR/* "$BACKUP_DIR"/ 2>/dev/null

echo
echo "=== Step 3: Clearing stale plugin metadata ==="
rm -f $PLUGIN_DIR/zpool.cache
rm -f $PLUGIN_DIR/*.dat
rm -f $PLUGIN_DIR/*.cfg

echo
echo "=== Step 4: Re-exporting and re-importing healthy pool ==="
zpool export "$POOL_NAME" 2>/dev/null
zpool import -f -o cachefile=$PLUGIN_DIR/zpool.cache $GOOD_POOL_ID "$POOL_NAME"

echo
echo "=== Step 5: Verifying pool status ==="
zpool status "$POOL_NAME"

echo
echo "=== Done! Reboot Unraid to reload the UI. ==="

echo
echo " If you still have the old read-cache SSD attached and want to clear its ZFS labels, run:"
echo " zpool labelclear -f /dev/sdX"
echo "Replace /dev/sdX with the correct device for the REMOVED cache SSD ONLY."
echo "Do NOT run on your RAIDZ2 data drives."

How to Use (user script plugin preferred)

  1. Copy this script into your Unraid terminal, e.g.:

    1. nano /boot/config/plugins/zfs/fix_zfs.sh

  2. Make it executable

    1. chmod +x /boot/config/plugins/zfs/fix_zfs.sh

  3. Run it

    1. /boot/config/plugins/zfs/fix_zfs.sh

When it finishes, reboot Unraid.
The UI should only show your healthy pool (orion).

*This won’t touch your data drives — it only clears plugin metadata and regenerates the correct zpool.cache

Edited by bmartino1

  • Community Expert

Post the output from zdb -l for every pool device, e.g.:

zbl -l /dev/sdc1

  • Author

@bmartino1

Thanks a bunch for your detailed explanation. It helped me so much to understand the way Unraid deals with ZFS.

I was not using zfs master plugin (I tried to remain as native to the newest unraid as possible).

I tried all your pointers, however what solved the issue and made the ghost entry ultimately disappear was running zpool labelclear -f /dev/nvme0n1p1 which according the the pool was the "only" remaining disk that was still alive in the pool. The moment I did this, when i ran zpool import the ghost disappeared.

I do have to say that I ran the zpool import -f -o cachefile=/etc/zfs/zpool.cache 64182623996842760 orion which should have overwritten the cache, but this did not remove the ghost entry. So I dont think it was an issue with the cache, but the nvm disk which I was using as cache probably had some metadata remaining which was removed by the labelclear.

Once again, thanks a bunch for the extensive explanation and help! <3

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.