Home ZFS Import Busy Dataset
Post
Cancel

ZFS Import Busy Dataset

What happened?

OS: Ubuntu 22.04 server

Well, after importing a zpool that was in use on another server (switching servers), I was unable to destroy the pool or dataset, faced with a busy dataset/pool error. I did notice something however, which helped with the trail.

Even though there was no mounts, it was busy, and i believe it was LVM making use of it…

1
2
3
4
5
zd32                      230:32   0    60G  0 disk
├─zd32p1                  230:33   0     1M  0 part
├─zd32p2                  230:34   0     1G  0 part
└─zd32p3                  230:35   0    59G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0  29.5G  0 lvm

So on my google search, i found someone who used lvm filter strings…

Destroy ZFS Pool

If you edit the /etc/lvm/lvm.conf and if in vim, search for global_filter, you’ll find the section quick enough to place this custom filter.

1
2
3
4
    ### CUSTOM START
    filter = [ "r|^/dev/zd*|" ]
    global_filter = [ "r|^/dev/zd*|" ]
    ### CUSTOM END

After this, update initramfs.

1
update-initramfs -u

And reboot.

I only did this to destroy the ZFS dataset and pool. Afterwards I commented out the custom filter just to make sure it didn’t interfere with anything, but something worth remembering.


zfs destroy -r fastZFS
zpool destroy fastZFS
This post is licensed under CC BY 4.0 by the author.