Hello list, it is damn difficult to destroy ZFS labels :) I try to remove the vedev labels of disks used in a pool before. According to http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/ondiskformat0822.pdf I created a script that removes the first 512 KB and the last 512 KB, however I always miss the last labels .. -------------------------------------------- LABEL 0 -------------------------------------------- failed to unpack label 0 -------------------------------------------- LABEL 1 -------------------------------------------- failed to unpack label 1 -------------------------------------------- LABEL 2 -------------------------------------------- version=14 name=''pool1'' state=1 txg=26 .... -------------------------------------------- LABEL 3 -------------------------------------------- version=14 name=''pool1'' state=1 How can I calculate or determine the location of the superblocks described ion the document above ? Has that changed over the versions of ZFS ? (I now that vdevs now do not need to be exactly the same size in later OpenSolaris releases, so maybe something has changed) Any hints appreshiated .. p.s. Clearing the whole disk is troublesome, because those are a bunch of 1 TB disks and deletion should be fast. -- This message posted from opensolaris.org
On Feb 28, 2010, at 5:05 AM, Lutz Schumann wrote:> Hello list, > > it is damn difficult to destroy ZFS labels :)Some people seem to have a knack of doing it accidentally :-)> I try to remove the vedev labels of disks used in a pool before. According to http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/ondiskformat0822.pdf I created a script that removes the first 512 KB and the last 512 KB, however I always miss the last labels .. > > -------------------------------------------- > LABEL 0 > -------------------------------------------- > failed to unpack label 0 > -------------------------------------------- > LABEL 1 > -------------------------------------------- > failed to unpack label 1 > -------------------------------------------- > LABEL 2 > -------------------------------------------- > version=14 > name=''pool1'' > state=1 > txg=26 > .... > -------------------------------------------- > LABEL 3 > -------------------------------------------- > version=14 > name=''pool1'' > state=1 > > > How can I calculate or determine the location of the superblocks described ion the document above ? Has that changed over the versions of ZFS ? (I now that vdevs now do not need to be exactly the same size in later OpenSolaris releases, so maybe something has changed)It has not changed. The labels are aligned to 256KB boundaries, so your script needs to find the correct end. You can also measure this directly using something like iosnoop when running zdb -l. -- richard> > Any hints appreshiated .. > > p.s. Clearing the whole disk is troublesome, because those are a bunch of 1 TB disks and deletion should be fast. > -- > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discussZFS storage and performance consulting at http://www.RichardElling.com ZFS training on deduplication, NexentaStor, and NAS performance http://nexenta-atlanta.eventbrite.com (March 16-18, 2010)
On Sun, Feb 28, 2010 at 1:12 PM, Richard Elling <richard.elling at gmail.com>wrote:> On Feb 28, 2010, at 5:05 AM, Lutz Schumann wrote: > > Hello list, > > > > it is damn difficult to destroy ZFS labels :) > > Some people seem to have a knack of doing it accidentally :-) > > > I try to remove the vedev labels of disks used in a pool before. > According to > http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/ondiskformat0822.pdfI created a script that removes the first 512 KB and the last 512 KB, > however I always miss the last labels .. > > > > -------------------------------------------- > > LABEL 0 > > -------------------------------------------- > > failed to unpack label 0 > > -------------------------------------------- > > LABEL 1 > > -------------------------------------------- > > failed to unpack label 1 > > -------------------------------------------- > > LABEL 2 > > -------------------------------------------- > > version=14 > > name=''pool1'' > > state=1 > > txg=26 > > .... > > -------------------------------------------- > > LABEL 3 > > -------------------------------------------- > > version=14 > > name=''pool1'' > > state=1 > > > > > > How can I calculate or determine the location of the superblocks > described ion the document above ? Has that changed over the versions of ZFS > ? (I now that vdevs now do not need to be exactly the same size in later > OpenSolaris releases, so maybe something has changed) > > It has not changed. The labels are aligned to 256KB boundaries, so your > script needs > to find the correct end. You can also measure this directly using > something like iosnoop > when running zdb -l. > -- richard > > > > > Any hints appreshiated .. > > > > p.s. Clearing the whole disk is troublesome, because those are a bunch of > 1 TB disks and deletion should be fast. > > -- > > This message posted from opensolaris.org > >Perhaps this has already been suggested, but it would seem to me to make a lot more sense to have some sort of "zfs label clear" type command to quickly and easily clear labels... --Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20100228/18dc5be7/attachment.html>