Solved Destroying a read-only zpool?

`Orum

Well-Known Member

Reaction score: 52
Messages: 297

I have a pool on a system that can only be imported as read-only (it has a feature flag enabled that FreeBSD doesn't support). However, I'd ultimately like to destroy it and recreate it under FreeBSD, but whenever you zpool destroy a read-only pool it acts like you've exported it, not destroyed it.

Is the best way to work around this just to dd count=10 bs=1m if=/dev/zero of=/dev/adaX? As I recall the pool information is stored at the end of the disk, so I assume a seek is necessary first?
 

rigoletto@

Daemon
Developer

Reaction score: 1,256
Messages: 2,296

Issuing zfs set readonly=off tank before mounting does not allow to mount it writable later?

Otherwise I would get rid of the entire partition ( if it is a separated partition), o simple destroy the entire disk, eventually using the sysutils/gdisk expert functions if necessary.
 

phoenix

Administrator
Staff member
Administrator
Moderator

Reaction score: 1,290
Messages: 4,099

zpool labelclear adaX will remove all traces of ZFS from a disk.
gpart destroy -F adaX will remove all traces of GPT partition tables from a disk.

The combination of the two will "destroy" a pool, if you do it to all the disks used in the pool.

BEWARE: there's no going back once you use labelclear.
 
OP
`Orum

`Orum

Well-Known Member

Reaction score: 52
Messages: 297

Issuing zfs set readonly=off tank before mounting does not allow to mount it writable later?
The issue is not a zfs setting, but the fact that it doesn't support a flag. Here's the actual output:
Code:
# zpool import -f video
This pool uses the following feature(s) not supported by this system:
        org.zfsonlinux:userobj_accounting (User/Group object accounting.)
All unsupported features are only required for writing to the pool.
The pool can be imported using '-o readonly=on'.
cannot import 'video': unsupported version or feature
If I mount it with -o readonly=on and try to set readonly=off later on...
Code:
# zpool set readonly=off video
cannot set property for 'video': property 'readonly' can only be set at import time
# zfs set readonly=off video
internal error: out of memory

zpool labelclear adaX will remove all traces of ZFS from a disk.
gpart destroy -F adaX will remove all traces of GPT partition tables from a disk.
Thanks, zpool labelclear -f adaXp1 on each drive followed by the nuking the GPTs got rid of everything.
 
Top