grub-install fails if ZFS root pool is in degraded state
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have a system with a root ZFS pool that's DEGRADED:
$ zpool status -v
pool: rpool
state: DEGRADED
status: One or more devices has experienced an unrecoverable error. An
attempt was made to correct the error. Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
using 'zpool clear' or replace the device with 'zpool replace'.
see: https:/
config:
NAME STATE READ WRITE CKSUM
rpool DEGRADED 0 0 0
sda1 DEGRADED 0 0 0 too many errors
errors: No known data errors
In this state, "grub-install" will fail:
grub-install: error: failed to get canonical path of `rpool/grub'.
If I apply the following patch, "grub-install" works properly:
--- a/grub-
+++ b/grub-
@@ -296,7 +296,7 @@ grub_util_
&& !sscanf (name, "raidz1%u", &dummy)
&& !sscanf (name, "raidz2%u", &dummy)
&& !sscanf (name, "raidz3%u", &dummy)
- && !strcmp (state, "ONLINE"))
+ && (!strcmp (state, "ONLINE") || !strcmp (state, "DEGRADED")))
{
if (ndevices >= devices_allocated)
{