Bug 1446418

Summary: grub2 efidisk identifying cd/dvd drive as hd
Product: Red Hat Enterprise Linux 7 Reporter: brosser
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 7.6CC: bgollahe, bootloader-eng-team, cww, dbodnarc, fmartine, jhlavac, jstodola, kazen, lmiksik, pjones, pmahale, purnendu_bhushan_mis, release-test-team-automation, rmetrich, salmy, srandhaw, tumeya
Target Milestone: rcKeywords: OtherQA
Target Release: 7.7   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: grub2-2.02-0.78.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:02:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1420851, 1477664, 1586275, 1611917, 1618351    

Description brosser 2017-04-27 23:58:14 UTC
Description of problem:

system occasionally fails to boot, displaying errors as follows:
"error: failure reading sector 0xfc1 from `hd0.
(error repeats over and over)
Press any key to continue...
"
pressing a key will not boot, and just repeats the above behavior.  Dropping to a grub command line fails at this point, as no actual commands are loaded/available.

This same behavior is referenced in the following bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1299248

It is believed that the efidisk.c file in grub2 is misidentifying the cdrom/dvdrom as a drive.  

By disabling the dvd drive in the efi bios, this error does not appear to present itself.

Fedora has applied the following patch in fc24:
commit b00e4c2bd9fd051678a8aadafa95ad14b3c866ba
Author: Andrei Borzenkov <address@hidden>
Date:   Fri Feb 26 21:44:37 2016 +0300

    efidisk: prevent errors from diskfilter scan of removable drives

 grub-core/disk/efi/efidisk.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c
index 1c00e3e..ea75344 100644
--- a/grub-core/disk/efi/efidisk.c
+++ b/grub-core/disk/efi/efidisk.c
@@ -547,7 +547,9 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t 
sector,
 
   status = grub_efidisk_readwrite (disk, sector, size, buf, 0);
 
-  if (status != GRUB_EFI_SUCCESS)
+  if (status == GRUB_EFI_NO_MEDIA)
+    return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'", 
disk->name));
+  else if (status != GRUB_EFI_SUCCESS)
     return grub_error (GRUB_ERR_READ_ERROR,
                       N_("failure reading sector 0x%llx from `%s'"),
                       (unsigned long long) sector,
@@ -568,7 +570,9 @@ grub_efidisk_write (struct grub_disk *disk, 
grub_disk_addr_t sector,
 
   status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1);
 
-  if (status != GRUB_EFI_SUCCESS)
+  if (status == GRUB_EFI_NO_MEDIA)
+    return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'", 
disk->name));
+  else if (status != GRUB_EFI_SUCCESS)
     return grub_error (GRUB_ERR_WRITE_ERROR,
                       N_("failure writing sector 0x%llx to `%s'"),
                       (unsigned long long) sector, disk->name);
-- 
tg: (67dba97..) u/efi-no-media (depends on: master)

Fedora grub RPM with patch applied:  grub2-2.02-0.34.fc24



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

RHEL 7.3 Workstation
3.10.0-514.10.2.el7.x86_64 #1 SMP
grub2-2.02-0.44.el7.x86_64
Drive Configuration:  Adaptec 885 RAID card.  RAID 1 - Micron 1100 512GB SSD
All drives have latest micron firmware.
Adaptec RAID card has latest firmware
Supermicro Bios has latest firmware.



How reproducible:

Customer applied patch similar to what's advised in bugzilla 1299248 and has not occurred since.  Prior to that, it would happen unexpectedly, but regularly.



Additional info:

Customer would like to know if this will be applied with all future grub2 rpms to prevent manual intervention after upgrades/updates.

Comment 3 Peter Jones 2018-06-04 14:42:52 UTC
*** Bug 1481668 has been marked as a duplicate of this bug. ***

Comment 15 Jan Stodola 2019-06-05 13:34:22 UTC
Purnendu Bhushan,
Fix for this problem is present in grub2-2.02-0.80.el7, which is present in RHEL-7.7 Beta. Since this bug is related to bug 1618351 reported by Dell, could you give it a try and report back if the problems reported in this bug and bug 1618351 are resolved for you?

Thank you,
Jan

Comment 16 Purnendu Bhushan 2019-06-14 03:11:53 UTC
Hi Jan,

I tried with RHEL 7.7and seem to be resolved.

Thanks 
Purnendu

Comment 17 Jan Stodola 2019-06-14 07:07:29 UTC
Thank you for your testing and feedback, Purnendu.

I'm moving this bug to VERIFIED.

Comment 18 Jan Stodola 2019-06-19 07:22:00 UTC
*** Bug 1618351 has been marked as a duplicate of this bug. ***

Comment 20 errata-xmlrpc 2019-08-06 12:02:09 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, 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-2019:2014