- no datasets mounted when it breaks
- A delay of 1 second is not enough: breaks on first try
- Retested with 5 seconds delay: ok
- Retested with new zfs script: notok, again the pool is busy error.
I had a quick look at the script and I found the remaining problem: the command ZFS_STDERR=$(zpool export "$ZFS_RPOOL" >/dev/null) will not capture stderr messages. I adapted this to ZFS_STDERR=$(zpool export "$ZFS_RPOOL" 2>&1 >/dev/null) and was able to boot correctly using rootdelay=10. So I think that solves it.
Here are the test results:
- no datasets mounted when it breaks
- A delay of 1 second is not enough: breaks on first try
- Retested with 5 seconds delay: ok
- Retested with new zfs script: notok, again the pool is busy error.
I had a quick look at the script and I found the remaining problem: the command ZFS_STDERR=$(zpool export "$ZFS_RPOOL" >/dev/null) will not capture stderr messages. I adapted this to ZFS_STDERR=$(zpool export "$ZFS_RPOOL" 2>&1 >/dev/null) and was able to boot correctly using rootdelay=10. So I think that solves it.