Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kw4dZ-0004My-P1 for mharc-grub-devel@gnu.org; Sun, 03 Jan 2021 09:45:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kw4dP-0004I0-Sc for grub-devel@gnu.org; Sun, 03 Jan 2021 09:45:31 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kw4dL-00024I-KR for grub-devel@gnu.org; Sun, 03 Jan 2021 09:45:30 -0500 X-Originating-IP: 223.101.228.230 Received: from yc-eb820g3 (unknown [223.101.228.230]) (Authenticated sender: gyc@apvc.uk) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 02F9FE0004 for ; Sun, 3 Jan 2021 14:45:19 +0000 (UTC) Date: Sun, 3 Jan 2021 22:45:08 +0800 From: gyc@apvc.uk To: The development of GNU GRUB Subject: Re: [PATCH] Fix missing root pool in 10_linux: better wording; add intructions when fail Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.70.183.196; envelope-from=gyc@apvc.uk; helo=relay4-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2021 14:45:32 -0000 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