RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1983000 - PPC64: grub2-install doesn't execute properly, making the recovered system unbootable
Summary: PPC64: grub2-install doesn't execute properly, making the recovered system un...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rear
Version: 7.9
Hardware: ppc64
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Pavel Cahyna
QA Contact: David Jež
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-16 08:52 UTC by Renaud Métrich
Modified: 2024-10-01 19:00 UTC (History)
6 users (show)

Fixed In Version: rear-2.4-14.el7_9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-01-11 17:36:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rear rear pull 1848 0 None closed Fixed, simplified and enhanced GRUB2 installation for PPC64/PPC64LE 2021-07-22 09:20:51 UTC
Red Hat Knowledge Base (Solution) 6191301 0 None None None 2021-11-26 15:22:58 UTC
Red Hat Product Errata RHBA-2022:0069 0 None None None 2022-01-11 17:36:13 UTC

Description Renaud Métrich 2021-07-16 08:52:23 UTC
Description of problem:

When recovering a PPC64+multipath system, the ofpathname binary may fail executing due to not having /sys mounted in the chroot:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Installing for powerpc-ieee1275 platform.
/sbin/ofpathname: line 411: cd: /sys/class/*/dm-2: No such file or directory
/usr/bin/find: warning: Unix filenames usually don't contain slashes (though pathnames do).  That means that '-name '/'' will probably evaluate to false all the time on this system.  You might find the '-wholename' test more useful, or perhaps '-samefile'.  Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ '/''.
/usr/bin/find: missing argument to `-name'
ofpathname: Could not retrieve Open Firmware device path
            for logical device "/dev/mapper/mpathf".
/vdevice/v-scsi@300000e2/disk@8200000000000000 /vdevice/v-scsi@3000007e/disk@8200000000000000
Installation finished. No error reported.
2021-06-04 13:42:33.207523277 GRUB2 installed on /dev/mapper/mpathf1
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

The ofpathname binary is called by grub2-install but additionally grub2-install doesn't detect the error, which doesn't make ReaR fail.

The result is an unbootable system.


Version-Release number of selected component (if applicable):

rear-2.4


How reproducible:

Always on the customer system


Additional info:

rear-2.6 has code to mount /sys automatically.

The following fix in /usr/share/rear/finalize/Linux-ppc64/620_install_grub2.sh is known to work on customer's systems:

Original lines (with numbers)
---------------------------------------------------
23 LogPrint "Installing GRUB2 boot loader"
24 mount -t proc none $TARGET_FS_ROOT/proc
25
:
75 umount $TARGET_FS_ROOT/proc
---------------------------------------------------

Modified lines:
---------------------------------------------------
23 LogPrint "Installing GRUB2 boot loader"
24 mount -t proc none $TARGET_FS_ROOT/proc
25 mount -t sysfs sys $TARGET_FS_ROOT/sys
26
:
76 umount $TARGET_FS_ROOT/sys
77 umount $TARGET_FS_ROOT/proc
---------------------------------------------------

Comment 3 Pavel Cahyna 2021-07-22 09:20:55 UTC
Thank you for the suggested fix. I suppose that in this case the system could be affected also by bz1983008, as "ofpathname" is included in the same package that may be missing (powerpc-utils) and is added to PROGS, not to REQUIRED_PROGS? Is there a way to determine whether "ofpathname" will be needed in order to add it to REQUIRED_PROGS conditionally? (Maybe, do it always except on PowerNV?)

I suppose the code in ReaR 2.6 was introduced in commit 61f36e6e5326888111b97450cf21f0b859e669c5 (PR 1848).

Comment 4 Pavel Cahyna 2021-07-22 10:37:34 UTC
Also, how to reproduce the problem? I suppose that if any ppc machine had the problem, it would have been discovered a long time ago. Is multipath the key element that makes the setup special and vulnerable to the problem?

Comment 5 Renaud Métrich 2021-07-22 11:00:33 UTC
The "ofpathname" + "bootlist" binaries need to be added to REQUIRED_PROGS in all non-PowerNV cases.
To reproduce, you need multipath indeed, I had a reproducer on a QEMU/KVM with a multipath disk but it's gone now.

Comment 6 Pavel Cahyna 2021-08-03 08:58:15 UTC
(In reply to Renaud Métrich from comment #5)
> The "ofpathname" + "bootlist" binaries need to be added to REQUIRED_PROGS in
> all non-PowerNV cases.

According to the code, KVM-emulated virtual machines do not need "bootlist"? So maybe the condition should be non-PowerNV, non KVM cases? But perhaps it does not do any harm to include it even in the KVM case and it will make the conditions a bit simpler?

Comment 7 Renaud Métrich 2021-08-31 08:21:49 UTC
I would say the simpler the better indeed.

Comment 8 Pavel Cahyna 2021-08-31 08:52:19 UTC
(In reply to Renaud Métrich from comment #7)
> I would say the simpler the better indeed.

Well, in the meantime I submitted PR 2665, which goes the more complicated way of requiring ofpathname except on PowerNV and bootlist on PowerVM.

Comment 9 Pavel Cahyna 2021-11-10 12:05:38 UTC
I tried to reproduce the bug on RHEL 8 (bz1983003) and despite the error messages the system has booted fine. How does exactly the problem manifest? You say "unbootable system", but does it mean that it does not enter GRUB, or that GRUB is not able to load the kernel, or that there is some error message from GRUB?
The problem might be RHEL 7-specific, I don't have a compatible RHEL 7 system (yet).

Comment 10 Pavel Cahyna 2021-11-10 15:50:15 UTC
> The problem might be RHEL 7-specific, I don't have a compatible RHEL 7 system (yet).

I realized that one can use RHEL-ALT-7.6 as a replacement because we have LPARs compatible with that. Still, I was not able to reproduce the problem. Despite the error messages from ofpathname called from grub-install in the recovery log the system has booted fine. Are you sure that ofpathname error was the real cause behind the unbootable system that you encountered?

Comment 22 errata-xmlrpc 2022-01-11 17:36:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rear bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:0069


Note You need to log in before you can comment on or make changes to this bug.