zpool labelclear destroys GPT data

Daniel Kalchev daniel at digsys.bg
Sat Jun 15 11:48:47 UTC 2013


On 14.06.2013, at 19:16, Tom Evans <tevans.uk at googlemail.com> wrote:

> 
> I suppose if labelclear was made to check for the existence of a
> pre-existing ZFS label, the force flag could be used to force the
> change… I still don't like it, the command is not called
> labelclear-only-if-the-label-area-already-has-sane-data.

It apparently does, because zpool labelclear would refuse to wipe a label that it believes belongs to an active zpool. So it apparently does check data. Just applies some weird logic.

The logic is also flawed and annoyed me few times. For example, you want to remove a drive from an raidz. You do this by marking the drive offline and wiping it's ZFS labels, so that you can "repurpose it". However, as long as the zpool is not exported, zpool labelclear  refuses to wipe labels and you re forced to resort to dd.
Why would it refuse to clear labels on an offlined drive? Is there better method?

Daniel


More information about the freebsd-stable mailing list