grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix missing root pool in 10_linux: better wording; add intru


From: gyc
Subject: Re: [PATCH] Fix missing root pool in 10_linux: better wording; add intructions when fail
Date: Sun, 3 Jan 2021 22:45:08 +0800

After applying the previous patch, apply this patch to show recovery
instructions when root pool detection fails. Also the description has
been improved.

This could be very useful guiding people to fix failed root pool detection.

---
 util/grub-mkconfig.in | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 04f8a11e6..2c3958ae1 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -291,8 +291,21 @@ if test "x${grub_cfg}" != "x" ; then
   if test "x${GRUB_FS}" = "xzfs" ; then
     if grep -q "grub_root_pool_detection_failed" ${grub_cfg}.new ; then
        gettext_printf "Root pool detection failed!
-You must specify correct pool name with GRUB_ZFS_ALT_RPOOL
-and run the command again. Otherwise system will not boot." >&2
+You must specify pool name detection command with GRUB_ZFS_ALT_RPOOL
+and run the command again. Otherwise system will not boot.
+
+Possible detection commands:
+
+with zdb
+    if
+        zdb -l %s | grep -E '[[:blank:]]name' | cut -d\\\' -f 2
+    returns root pool name, then try set
+        export GRUB_ZFS_ALT_RPOOL=\"zdb -l \\\${GRUB_DEVICE} | grep -E 
'[[:blank:]]name' | cut -d\\\' -f 2\"
+with blkid
+    if
+        blkid -s LABEL -o value %s
+    returns root pool name, then try set
+        export export GRUB_ZFS_ALT_RPOOL='blkid -s LABEL -o value 
\${GRUB_DEVICE}'" "${GRUB_DEVICE}" "${GRUB_DEVICE}" >&2
        echo >&2
        exit 1
     fi
--
2.30.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]