[Bug 1965566] [NEW] grub-install fails if ZFS root pool is in degraded state
Prakash Surya
1965566 at bugs.launchpad.net
Fri Mar 18 17:27:26 UTC 2022
Public bug reported:
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://openzfs.github.io/openzfs-docs/msg/ZFS-8000-9P
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-core/osdep/unix/getroot.c
+++ b/grub-core/osdep/unix/getroot.c
@@ -296,7 +296,7 @@ grub_util_find_root_devices_from_poolname (char *poolname)
&& !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)
{
** Affects: grub2 (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1965566
Title:
grub-install fails if ZFS root pool is in degraded state
Status in grub2 package in Ubuntu:
New
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://openzfs.github.io/openzfs-docs/msg/ZFS-8000-9P
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-core/osdep/unix/getroot.c
+++ b/grub-core/osdep/unix/getroot.c
@@ -296,7 +296,7 @@ grub_util_find_root_devices_from_poolname (char *poolname)
&& !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)
{
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1965566/+subscriptions
More information about the foundations-bugs
mailing list