Solved [Solved] How do I really really really remove a ZFS pool

I tried removing my one and only ZFS pool on my FreeBSD 9.2-RELEASE machine with the following command and it completed without error: zpool destroy pool1. Now when I run the command to list available pools, zpool list, no pools show as available. However, zpool import shows:

Code:
pool: pool1
     id: 13857587814309924975
  state: FAULTED
 status: The pool metadata is corrupted.
 action: The pool cannot be imported due to damaged devices or data.
        The pool may be active on another system, but can be imported using
        the '-f' flag.
   see: http://illumos.org/msg/ZFS-8000-72
 config:

        pool1        FAULTED  corrupted data
        logs
          ada0p6     ONLINE
          ada1p1     ONLINE

How do I really really really remove a pool instead of only half way removing it? ada0p6 and ada1p1 were log devices from pool1 which should have been destroyed.

Thanks in advance.
George
 
Re: How do I really really really remove a ZFS pool

Code:
# zpool labelclear ada0
# zpool labelclear ada1

And so on for each device that was part of the pool.

NOTE: This removes all GPT labels on the device, regardless of whether it was used for ZFS or not. So be sure you understand what that means, especially if you have re-partitioned the drives for other uses.
 
Re: How do I really really really remove a ZFS pool

Aw, poop - @phoenix beats me again (as he should).

This is an extensively discussed problem. sometimes the problem gets solved, other times it does not. The random solution is: zpool labelclear -f /dev/<device>, where <device> is the HDD number + partition for GPT disks. Look for listings under /dev or run # gpart show to see all partition layouts.
 
Last edited by a moderator:
Re: How do I really really really remove a ZFS pool

A # gpart destroy -F ada0 might also do it, as that also clears the GPT labels.

And, as a last resort, the following will definitely nuke all formatting from the drive: # dd if=/dev/zero of=/dev/ada0 bs=1M
 
Re: How do I really really really remove a ZFS pool

Thanks @phoenix and @Beeblebrox.

I used:

zpool labelclear -f /dev/ada0p6
zpool labelclear -f /dev/ada1p1

And this worked!

Now when I execute zpool import I receive the message:

Code:
no pools available to import

Without any errors or warnings. Very nice.

Thanks.
George
 
Last edited by a moderator:
Back
Top