Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Aug 2013 10:31:10 -0400
From:      Outback Dingo <outbackdingo@gmail.com>
To:        Adam Nowacki <nowakpl@platinum.linux.pl>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: How do we clear a bogus zpool?
Message-ID:  <CAKYr3zxTcYLX78r1YgMnTD2YADPiK3TPOwtcJsj0n228R%2BBnNQ@mail.gmail.com>
In-Reply-To: <5214CB21.8080206@platinum.linux.pl>
References:  <1377015858.1450.3.camel@localhost> <CAOaKuAVuJXf-Ceuh0Z4ToLtCc2D%2BBTVEabcVNWK=vktKjqoQcQ@mail.gmail.com> <1377026509.1478.3.camel@localhost> <5214CB21.8080206@platinum.linux.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 21, 2013 at 10:13 AM, Adam Nowacki <nowakpl@platinum.linux.pl>wrote:

> On 2013-08-20 21:21, Sean Bruno wrote:
>
>> On Tue, 2013-08-20 at 20:28 +0200, Johan Hendriks wrote:
>>
>>>          # zpool import
>>>             pool: zroot
>>>               id: 854190767471294680
>>>            state: UNAVAIL
>>>           status: One or more devices are missing from the system.
>>>           action: The pool cannot be imported. Attach the missing
>>>                  devices and try again.
>>>             see: http://illumos.org/msg/ZFS-**8000-3C<http://illumos.org/msg/ZFS-8000-3C>;
>>>           config:
>>>
>>>                  zroot                     UNAVAIL  insufficient
>>>          replicas
>>>                    raidz1-0                UNAVAIL  insufficient
>>>          replicas
>>>                      17925463268209287656  UNAVAIL  cannot open
>>>                      11020448220822113890  UNAVAIL  corrupted data
>>>                      10143858893287711942  UNAVAIL  corrupted data
>>>                      7542790596970715955   UNAVAIL  corrupted data
>>>                      10811885036534933813  UNAVAIL  corrupted data
>>>                      13343774937261906429  UNAVAIL  corrupted data
>>>
>>>          # zpool destroy -f zroot
>>>          cannot open 'zroot': no such pool
>>>          # zpool clear -F zroot
>>>          cannot open 'zroot': no such pool
>>>
>>>
>>>          Sean
>>>
>>>
>>>
>>> There is a label clear option for zpool # zpool labelclear devicename
>>> It will wipe ALL labels, and not only zpool/zfs labels.
>>>
>>
>>
>> Sure, but which device to pass in as an argument?  I'm not sure where
>> the zpool information is even coming from.
>>
>>
> sysctl -b kern.geom.conftxt | sh -c 'while read a b c d; do zdb -l /dev/$c
> | grep -q version && echo $c; done'
>
>
nice snippet, now output that to a variable and then

 for disk in /dev/$c; do dd if=/dev/zero of=${disk} bs=512 count=1; dd
if=/dev/zero of=${disk} bs=512 seek=$(( $(diskinfo -v ${disk} | grep
"mediasize in sectors" | awk '{ print $1 }') - 1 )); done

 and that will nuke them clean


This should list all devices with zfs labels.
>
> ______________________________**_________________
> freebsd-fs@freebsd.org mailing list
> http://lists.freebsd.org/**mailman/listinfo/freebsd-fs<http://lists.freebsd.org/mailman/listinfo/freebsd-fs>;
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@**freebsd.org<freebsd-fs-unsubscribe@freebsd.org>
> "
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKYr3zxTcYLX78r1YgMnTD2YADPiK3TPOwtcJsj0n228R%2BBnNQ>