In FreeNAS you would just destroy the zpool and make sure to click the "Mark the disks as new," and call it a day. In Linux, my go-to solutions for quickly nuking the partitions on a disk have been one of the following.
- dd bs=1M if=/dev/zero of=/dev/sdwhatever
- cfdisk -z /dev/sdwhatever
But both of those have failed me with ZFS formatted disks. The partitions persist, and unplugging/replugging the drive results in Linux seeing the drive as a ZFS member. I haven't tried actually importing the zpool, now that I think about it. A fun experiment for another time.
The important thing here is the wipefs command, which apparently comes with Ubuntu Gnome 16.10 which is what I'm currently using.
wipefs /dev/sdcFirst, show that sdc contains no partition table.
zpool create -f testpool /dev/sdcZFS it up!
wipefs /dev/sdcNow we see a gpt partition table.
zpool export testpoolExport the zpool.
wipefs -a /dev/sdcFrom orbit, nuke sdc.
wipefs /dev/sdcWe check sdc once more, and no more partition table, no more ZFS.
There's probably an easier way to do this, but I didn't find any additional options with zpool export, which is where I would expect to find an option to do this.
06/03/2017 Update:
I'm silly. zpool export is for when you want the pool to stay intact, but need to migrate it elsewhere, or turn the system off, or whatever. zpool destroy is the option we want. I'm going to leave this post up, though. wipefs is a handy utility, even if I was being silly.
No comments:
Post a Comment