Be careful when re-using disks that have had ZFS pool on them. I used a disk that was part of single disk bootable ZFS pool with a partition layout like this:
The third partition was previously of type freebsd-zfs that contained a ZFS pool. I didn't think anything of it and just recreated the partition as freebsd-ufs and newfs(8)ed it to make an UFS filesystem on the partition and installed a 10.1-RELEASE system on it.
I then for testing added a second disk to the system and tried to tried to create a ZFS pool on it. Much to my surprise the ada0p3 partition still contained ZFS labels that were detected on probe. I tried just about everything non-destructive to get rid the labels but the only thing that worked was
The proper way to reuse the disk would have been destroying the pool with
Code:
% gpart show ada0
=> 34 312581741 ada0 GPT (149G)
34 1024 1 freebsd-boot (512K)
1058 3038 - free - (1.5M)
4096 16777216 2 freebsd-swap (8.0G)
16781312 134217728 3 freebsd-ufs (64G)
150999040 161582735 4 freebsd-ufs (77G)
The third partition was previously of type freebsd-zfs that contained a ZFS pool. I didn't think anything of it and just recreated the partition as freebsd-ufs and newfs(8)ed it to make an UFS filesystem on the partition and installed a 10.1-RELEASE system on it.
I then for testing added a second disk to the system and tried to tried to create a ZFS pool on it. Much to my surprise the ada0p3 partition still contained ZFS labels that were detected on probe. I tried just about everything non-destructive to get rid the labels but the only thing that worked was
zpool labelclear -f ada0p3
. Needless to say this destroyed the UFS filesystem on the partition. I was cautious enough to make a full backup before proceeding and restored the backup without problems.The proper way to reuse the disk would have been destroying the pool with
zpool destroy
and then running zpool labelclear -f
to be doubly sure before recreating the partition with the new UFS filesystem.