How do we clear a bogus zpool?

Outback Dingo outbackdingo at gmail.com
Wed Aug 21 14:31:11 UTC 2013


On Wed, Aug 21, 2013 at 10:13 AM, Adam Nowacki <nowakpl at 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 at 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 at freebsd.org>
> "
>


More information about the freebsd-fs mailing list