[SOLVED] Zfs-import-scan Attempt to Import Removed Pool

hftsai

Member
Apr 25, 2020
2
0
21
38
Hi all.

I noticed an error on zfs-import-scan during the boot process. And the log says that it somehow finds a previously destroyed ZFS pool and is trying to import it:
Code:
May 13 23:25:46 pve zpool[1014]: cannot import 'app': pool was previously in use from another system.
May 13 23:25:46 pve zpool[1014]: Last accessed by truenas (hostid=12d506b5) at Wed Dec 31 19:00:00 1969
May 13 23:25:46 pve zpool[1014]: The pool can be imported, use 'zpool import -f' to import the pool.

As the message suggests, I was virtualizing TrueNAS, and 'app' was the volume I mounted into that VM, which should have been destroyed with the VM itself. When I try to invoke the command manually, I get the following (expected) error:
Code:
root@pve:~# zpool import -f
no pools available to import

root@pve:~# zpool import -afN -d /dev/disk/by-id -o cachefile=none
internal error: cannot import 'app': Value too large for defined data type
Aborted

How may I really destroy the 'app' pool so that zfs-import-scan no longer fails?

Many Thanks.
 
Last edited:
Hi all.

I noticed an error on zfs-import-scan during the boot process. And the log says that it somehow finds a previously destroyed ZFS pool and is trying to import it:
Code:
May 13 23:25:46 pve zpool[1014]: cannot import 'app': pool was previously in use from another system.
May 13 23:25:46 pve zpool[1014]: Last accessed by truenas (hostid=12d506b5) at Wed Dec 31 19:00:00 1969
May 13 23:25:46 pve zpool[1014]: The pool can be imported, use 'zpool import -f' to import the pool.

As the message suggests, I was virtualizing TrueNAS, and 'app' was the volume I mounted into that VM, which should have been destroyed with the VM itself. When I try to invoke the command manually, I get the following (expected) error:
Code:
root@pve:~# zpool import -f
no pools available to import

root@pve:~# zpool import -afN -d /dev/disk/by-id -o cachefile=none
internal error: cannot import 'app': Value too large for defined data type
Aborted

How may I really destroy the 'app' pool so that zfs-import-scan no longer fails?

Many Thanks.
Hi,
yes the ZFS scan will find also disks/volumes which have ZFS labels on them if used with VMs. So you will have to import the pools via cache file only by disabling the zfs import scan service.

If you want to completely destroy the pool as it is not used anymore, a zpool destroy [-f] <poolname> will destroy it (the -f flag leading to unmounting of all mounted datasets). Please see also man zpool-destroy.
 
I dived a bit deeper and found there was an uncleared label residing in one of my drives:
Code:
root@pve:~# zdb -l /dev/nvme0n1
failed to unpack label 0
failed to unpack label 1
------------------------------------
LABEL 2 (Bad label cksum)
------------------------------------
    version: 5000
    name: 'app'
    state: 0
    txg: 4
    pool_guid: 17735329303180726065
    errata: 0
    hostid: 315950773
    hostname: 'truenas'
    top_guid: 18276537860508386553
    guid: 18276537860508386553
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 18276537860508386553
        path: '/dev/disk/by-partuuid/bb047daf-febf-4c47-80be-00d0688ad845'
        whole_disk: 0
        metaslab_array: 256
        metaslab_shift: 34
        ashift: 12
        asize: 2000392028160
        is_log: 0
        create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
        com.klarasystems:vdev_zaps_v2
    labels = 2 3

So I blew it away and now it is fixed

Code:
root@pve:~# zpool labelclear -f /dev/nvme0n1
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!