# Panic on 'zpool replace' on readonly pool



## c_geier (Nov 2, 2012)

Hi,

I did a fresh install of FreeBSD 9.1-RC2 and imported an originally 4 disk zraid pool with only 3 disks attached in readonly mode (via zpool import -o readonly=on storage). On replacement of the missing disk via zpool replace storage ada1 the machine reboots instantly (with no messages in the system logs). I repeated the procedure five times with the same outcome. On importing the zpool without the readonly option, resilvering starts and works fine.

I guess this is not desirable behaviour, but should it in theory be possible to resilver a degraded zpool imported in readonly mode?

Since I couldn't find anything that seems related in the PR database, should I file a problem report on this?

Thanks

PS: 

```
# uname -a
FreeBSD brutus.lostpackets.de 9.1-RC2 FreeBSD 9.1-RC2 #0 r241106: Mon Oct  1 18:26:44 UTC 2012     [email]root@farrell.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## m6tt (Nov 4, 2012)

It sounds like you found a ZFS bug, filing a PR is a very good idea.

Perhaps since the pool is readonly, and resilvering is technically a write, the code is between a rock and a hard place and does something stupid instead of printing "Cannot replace on a readonly pool"?

I can't find any docs indicating you can do a replace on a readonly pool, if this was expected behavior on Solaris for instance, I'd include that in the PR.


----------



## dove (Feb 8, 2013)

Possibly related PR is here...

http://www.freebsd.org/cgi/query-pr.cgi?pr=175897


----------



## c_geier (Feb 9, 2013)

the pr of the problem I reported above is http://www.freebsd.org/cgi/query-pr.cgi?pr=173363


----------

