Re: zpool labelclear destroys GPT data

2013-06-15 Thread Daniel Kalchev

On 14.06.2013, at 19:16, Tom Evans tevans...@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
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org

Re: zpool labelclear destroys GPT data

2013-06-15 Thread Steven Hartland


- Original Message - 
From: Daniel Kalchev dan...@digsys.bg

To: freebsd-stable@freebsd.org
Sent: Saturday, June 15, 2013 12:39 PM
Subject: Re: zpool labelclear destroys GPT data




On 14.06.2013, at 19:16, Tom Evans tevans...@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?


I'd recommend raising a bug report and posting on the on illumos zfs list
for this so its specific behavour can be discussed there, as it does
sound odd to me and should in theory be quite an easy fix.

   Regards
   Steve 




This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone +44 845 868 1337
or return the E.mail to postmas...@multiplay.co.uk.

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org