ZFS ZFS self-healing and scrub correction on read-only pools and datasets?

Hello,

I have a strange question that I wasn't able to find answer on the internet.
My company will have satellites launched into orbit in extreme conditions. The possibility of data corruption due to space radiation is huge and we wish to start using and take advantage of ZFS self healing.

However either only certain datasets or the entire pools will be imported/mounted read-only mode.
My questions here are:

1. If dataset is in read-only, will the self-heal perform modifications and corrections if it detects a problem? Will scrub do?
2. If a zpool is imported in read-only will the self-heal perform modifications and corrections if it detects a problem? Will scrub do?
3. Will it make difference if it's a single provider with copies=2? Or will it act the same as they are more providers?

Thanks,
Cheers/Beers!
 
If you're doing something that demanding then you will likely want to test all this stuff for yourself anyway...

Code:
# mdconfig -a -t malloc -s 1g
# zpool create test md0
# zfs set readonly=on test
# zpool scrub test
# zpool status
  pool: storage
 state: ONLINE
  scan: scrub repaired 0 in 0 days 00:04:37 with 0 errors on Thu Jul 30 11:27:51 2020
...

To avoid any confusion, note that the above is setting the readonly property on the test dataset, *not* the pool. By default a pool contains one dataset with the same name as the pool. zfs works on the datasets, zpool works on the pool.

Code:
# zpool export test
# zpool import -o readonly=on test
# zpool scrub test
cannot scrub test: pool is read-only

Dataset readonly flags are irrelevant to the global pool. You can still scrub. If the pool is imported or set readonly, you cannot do anything with it. This is pretty much just a feature for disaster recovery, there's little reason to ever set a working pool to readonly.

Not sure about the exact question in number 3 but the pool layout or copies setting makes no difference to any of the above. Personally I would value multiple independent devices in a mirror much more than a single device with copies >= 2.
 
Back
Top