ZFS Any way to import zfs root pool readonly during boot?

Hi guys,
Because a RAM stick issue(some bits changed unexpectedly), my zfs pool was damaged, and system keep crash, it will print follow message and then reset immediately:
Code:
panic: solaris assert: ((offset) & ((1ULL << vd->vdev_ashift) - 1)) == 0 (0x800 == 0x0), file: /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c, line: 3593
cpuid = 0
time = 4
KDB: stack backtrace:
#0 0xffffffff80c1d297 at kdb_backtrace+0x67
#1 0xffffffff80bd05cd at vpanic+0x19d
#2 0xffffffff80bd0423 at panic+0x43
#3 0xffffffff829f322c at assfail3+0x2c
#4 0xffffffff826cbb83 at metaslab_free_concrete+0x103
#5 0xffffffff826ccdd8 at metaslab_free+0x128
#6 0xffffffff8272a17c at zio_dva_free+0x1c
#7 0xffffffff82726b7c at zio_execute+0xac
#8 0xffffffff80c2fa74 at taskqueue_run_locked+0x154
#9 0xffffffff80c30da8 at taskqueue_thread_loop+0x98
#10 0xffffffff80b90c23 at fork_exit+0x83
#11 0xffffffff81082a4e at fork_trampoline+0xe
Uptime: 4s

I have try set vfs.zfs.recover=1 and boot -s, but it not works, crash again, thus I boot from a usb image, and import it, and it fail again.
But I could import pool readonly use:
zfs import -o readonly=on -R /tmp/zroot -N zroot


The question is, could I import zfs pool readonly when boot from disk?
I can't find any option to enable it.

Thanks
 
If you boot to single user mode the ZFS filesystem is mounted read-only. This is always the case.
 
If you boot to single user mode the ZFS filesystem is mounted read-only. This is always the case.
After search zfs code, I found zfs import root pool in different function compare with non root pool, and this function will not set props like readonly or altroot.
So root pool could only import as readonly if the pool prop set readonly, but this could only set when import, thus there is no way to import root pool readonly.

Readonly prop is set to dataset when boot to single user I think, not the pool, so boot to single user will not help.
 
Back
Top