One can replace the "zpool import -f -a -o cachefile=none -N" line with this:
local pipe="/tmp/zpool_pipe"
no_import_pools=$(mkfifo ${pipe}; zpool import -f -a -o cachefile=none -N 2> ${pipe} | cut -d \' -f 2 ${pipe}; rm ${pipe})
If one wants a list of the pools which can not be imported.
To just discard the error though and keep update-grub from failing this works fine too:
local discard_pool_import_err=""
discard_pool_import_err=$(zpool import -f -a -o cachefile=none -N 2>/dev/null || true)
Maybe that workaround could be added so update-grub at least doesn't fail if a zpool which can't be imported is seen?
FYI:
One can replace the "zpool import -f -a -o cachefile=none -N" line with this: tmp/zpool_ pipe" import_ pools=$ (mkfifo ${pipe}; zpool import -f -a -o cachefile=none -N 2> ${pipe} | cut -d \' -f 2 ${pipe}; rm ${pipe})
local pipe="/
no_
If one wants a list of the pools which can not be imported.
To just discard the error though and keep update-grub from failing this works fine too:
local discard_ pool_import_ err="" pool_import_ err=$(zpool import -f -a -o cachefile=none -N 2>/dev/null || true)
discard_
Maybe that workaround could be added so update-grub at least doesn't fail if a zpool which can't be imported is seen?