Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some disks need 'dd ... bs=4092' in guess_bootloader.sh and without grub2-efi-modules installed things go wrong on RHEL 7.3 with UEFI #1242

Closed
j100ng opened this issue Mar 14, 2017 · 21 comments
Assignees
Milestone

Comments

@j100ng
Copy link

j100ng commented Mar 14, 2017

Please fill in the following items before submitting a new issue (quick response is not guaranteed with free support):

  • rear version (/usr/sbin/rear -V):
    Relax-and-Recover 2.00 / Git

  • OS version (cat /etc/rear/os.conf or lsb_release -a):

LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 7.3 (Maipo)
Release:        7.3
Codename:       Maipo
  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
OUTPUT=ISO
EXCLUDE_BACKUP=("${EXCLUDE_BACKUP[@]}" /tmp /data/rear/* /var/lib/rear)
OUTPUT_URL=cifs://10.106.3.201/rear
OUTPUT_OPTIONS="rw,uid=1003,gid=500,cred=/var/lib/rear/.cifs"
NETFS_RESTORE_CAPABILITIES=y
BACKUP=NETFS
BACKUP_URL=cifs://10.106.3.201/rear
BACKUP_OPTIONS="rw,uid=1003,gid=500,cred=/var/lib/rear/.cifs"
BACKUP_PROG_INCLUDE=("${BACKUP_PROG_INCLUDE[@]}" )
BACKUP_PROG_EXCLUDE=("${BACKUP_PROG_EXCLUDE[@]}" '/data/rear/*' /var/lib/pgsql/96_old '/data/resources/tmp/*' )
TMPDIR="/data/rear/tmp"
export TMPDIR
  • Are you using legacy BIOS or UEFI boot?
    UEFI

  • Brief description of the issue:
    I was previously using rear (v1.17.2) as installed via "yum install rear" on RHEL 7.3. It does not backup/restore capabilities. So I downloaded v2.00 and tried to run this version. It gives me this error. As I looked through the codes & logs, it complained because file, /var/lib/rear/recovery/bootloader, is missing.

I tried running "rear savelayout" and got the same error.

  • Work-around, if any:
    I rolled back to v1.18, and I can now run "rear -v mkbackup"

rear.zip

@gdha
Copy link
Member

gdha commented Mar 14, 2017

I guess this is the same as issue #1203 and #1204 - try the latest snapshot version

BUG in /usr/share/rear/layout/save/default/450_check_bootloader_files.sh:
'\''Unknown bootloader () - ask for sponsoring to get this fixed'\''

@gdha gdha self-assigned this Mar 14, 2017
@gdha gdha added bug The code does not do what it is meant to do waiting for info labels Mar 14, 2017
@j100ng
Copy link
Author

j100ng commented Mar 14, 2017

They looks similar but I couldn't find "BOOTX64.EFI" under /boot/efi.

Would you please elaborate what you mean by "try latest snapshot version"

@gdha
Copy link
Member

gdha commented Mar 14, 2017

@j100ng
Copy link
Author

j100ng commented Mar 15, 2017

I tried this snapshot version and still encounter the same error. Attached is the execution log.
rear-macso1_snapshot.zip

@gdha
Copy link
Member

gdha commented Mar 18, 2017

@j100ng Please have a look at script /usr/share/rear/prep/default/50_guess_bootloader.sh. I guess it cannot find the bootloader because it is looking at disks not (yet) known to the script?

@j100ng
Copy link
Author

j100ng commented Mar 20, 2017

Here's the output of "dd if=/dev/sda bs=512 count=4 | strings" as called in /usr/share/rear/prep/default/50_guess_bootloader.sh .

[jacksonl@macso1 sda]$ sudo dd if=/dev/sda bs=512 count=4 | strings
4+0 records in
4+0 records out
2048 bytes (2.0 kB) copied, 4.2139e-05 s, 48.6 MB/s
[jacksonl@macso1 sda]$

So it does not show the bootloader type.
I change the command slightly

[jacksonl@macso1 sda]$ sudo dd if=/dev/sda bs=4096 count=4 | strings
4+0 records in
4+0 records out
16384 bytes (16 kB) copied, 8.4453e-05 s, 194 MB/s
EFI PART
5y C
[jacksonl@macso1 sda]$

So I created my own /var/lib/rear/recovery/bootloader to contain EFI. But now I got a different error
"ERROR: Error occurred during grub2-mkimage of BOOTX64.efi"

@gozora
Copy link
Member

gozora commented Mar 20, 2017

Hello @j100ng,

Could you please run rear -d -D mkrescue and upload created log file from /var/log/rear for me?

Thanks

V.

@j100ng
Copy link
Author

j100ng commented Mar 20, 2017

@gozora
Copy link
Member

gozora commented Mar 20, 2017

@j100ng try to install grub2-efi-modules, that should help ...

@j100ng
Copy link
Author

j100ng commented Mar 20, 2017

Is this something new?
I had run rear v1.17.2 successfully before. However, the recovered system does not have the proper SELinux capabilities set. Therefore, I'm using v1.18 & up.

@j100ng
Copy link
Author

j100ng commented Mar 20, 2017

"rear -v mkrescue" was successful after I installed grub2-efi-modules.

Now trying to do a full backup & restore

@gozora
Copy link
Member

gozora commented Mar 20, 2017

For me "new" is very relative. But this requirement is in ReaR for 8 months or so ...

@jsmeix jsmeix added support / question and removed waiting for info bug The code does not do what it is meant to do labels Mar 21, 2017
@jsmeix jsmeix changed the title Run into 'Unknown bootloader ()' error when running ReaR v2.00 on RHEL 7.3 Without grub2-efi-modules installed there is 'Unknown bootloader ()' error on RHEL 7.3 Mar 21, 2017
@jsmeix
Copy link
Member

jsmeix commented Mar 21, 2017

#1242 (comment)
shows that
without grub2-efi-modules installed there is the
'Unknown bootloader ()' error on RHEL 7.3.

I wonder if there could be a reliably working automated test
in ReaR that errors out with a better matching error message like

grub2-efi-modules needs to be installed

@gozora
do you think such an automatism is possible
(with reasonable effort)?

@gozora
Copy link
Member

gozora commented Mar 21, 2017

Hello @jsmeix,

I guess you just overlooked a fact that this issue is not longer about "unknown boot loader". See #1242 (comment).

For the second problem, ReaR ended with error: "grub2-mkimage: error: cannot open `/usr/lib/grub/x86_64-efi/moddep.lst': No such file or directory", which is OK to my opinion.

V.

@jsmeix
Copy link
Member

jsmeix commented Mar 21, 2017

@gozora
Ahh! - a moving target ;-)

@jsmeix jsmeix changed the title Without grub2-efi-modules installed there is 'Unknown bootloader ()' error on RHEL 7.3 Without grub2-efi-modules installed things go wrong on RHEL 7.3 with UEFI Mar 21, 2017
@j100ng
Copy link
Author

j100ng commented Mar 21, 2017

Please note that the original issue where /usr/share/rear/prep/default/50_guess_bootloader.sh does not find the bootloader info is still there. The root cause is the line

       dd if=$devname bs=512 count=4 | strings > $TMP_DIR/bootloader

had failed. The disk drive on my system needs to use 4092 instead of 512.

I initially used a workaround of manually creating the bootloader file.

I just tried a different solution and seems to work
local block_size=$(get_block_size ${blockd%/*})
dd if=$devname bs=$block_size count=4 | strings > $TMP_DIR/bootloader

@jsmeix jsmeix changed the title Without grub2-efi-modules installed things go wrong on RHEL 7.3 with UEFI Some disks need 'dd ... bs=4092' in guess_bootloader.sh and without grub2-efi-modules installed things go wrong on RHEL 7.3 with UEFI Mar 22, 2017
@jsmeix
Copy link
Member

jsmeix commented Mar 22, 2017

@j100ng
when you have a 50_guess_bootloader.sh file
you cannot use "Relax-and-Recover 2.00 / Git"
because the old two-digit files were replaced by
now three-digit files 500_guess_bootloader.sh

Regardless what kind of guesswork you use,
this is just another instance of what hurts us
again and again:
ReaR tries to do things silently and automacically right
without providing final power to the user that he
can - if needed - explicitly specify what ReaR must do, cf.
#1204 (comment)
and
#1213 (comment)

I think I will implement support for a BOOTLOADER variable
that is empty by default which means 500_guess_bootloader.sh
is used but if the user specifies BOOTLOADER his decision
is obeyed by ReaR, cf. what I did for UEFI_BOOTLOADER in
#1212

@j100ng
for now just keep your change in guess_bootloader.sh
and preferably submit it as GitHub pull request to us, cf.
http://relax-and-recover.org/development/
and "How to contribute to Relax-and-Recover" in
https://en.opensuse.org/SDB:Disaster_Recovery

@jsmeix jsmeix added the enhancement Adaptions and new features label Mar 22, 2017
@jsmeix
Copy link
Member

jsmeix commented Mar 24, 2017

Via #1262
I did a first attempt to implement BOOTLOADER support.

@jsmeix jsmeix added this to the ReaR v2.1 milestone Mar 27, 2017
@jsmeix jsmeix self-assigned this Mar 27, 2017
@jsmeix
Copy link
Member

jsmeix commented Mar 27, 2017

@j100ng
with #1262 merged
there is now some initial support to specify BOOTLOADER
in /etc/rear/local.conf as follows:

Setting BOOTLOADER is only meant so that the user
can - if needed - (i.e. when autodetection fails for him)
enforce ReaR to set up during "rear recover" one of
the supported bootloaders i.e. one of what is listed in
layout/save/default/450_check_bootloader_files.sh

What is currently listed in
layout/save/default/450_check_bootloader_files.sh

GRUB2-EFI
EFI
GRUB2
GRUB
ELILO
LILO
PPC

Currently there is no validation check for a BOOTLOADER
setting so that with unsupported bootloaders e.g. something like
"BOOTLOADER=grubby"
ReaR would just fail somehow somewhere, cf.
#1261

@j100ng
I also tried to implement your "dd .. bs=$block_size" proposal in
#1242 (comment)

I would appreciate it if you coud test ReaR
with #1262 merged
and provide feedback to what extent it now works better
(or even worse) than before and what manual steps you
still need to make it work for your particular case.

Many thanks in advance!

@j100ng
Copy link
Author

j100ng commented Mar 27, 2017

I have tested the latest version of rear from git under the following 2 scenarios:

  1. run 'rear -v mkrescue' without any pre-configuration
    500_guess_bootloader correctly detected that system is EFI and created the necessary bootloader file

  2. run 'rear -v mkrescue' with pre-configuration in etc/rear/local.conf
    I manually deleted var/lib/rear/recovery/bootloader. Add "BOOTLOADE=EFI" into etc/rear/local.conf
    Running the command was successful, and the correct bootloader file was created.

@jsmeix
Copy link
Member

jsmeix commented Mar 28, 2017

@j100ng
many thanks for your prompt feedback!
I assume you actually added "BOOTLOADER=EFI"
to etc/rear/local.conf (with an 'R' at the end) because
otherwise case (2.) would become case (1.).
During "rear mkbackup/mkrescue" it shows you what it uses:
When BOOTLOADER is specified in local.conf it shows
"Using specified bootloader ..."
otherwise it shows
"Using sysconfig bootloader ..." or
"Using PreP boot partition bootloader ..." (only for ppc) or
"Using guessed bootloader ..."

According to
#1242 (comment)
the BOOTLOADER part of this issue is solved
and according to
#1242 (comment)
a missing grub2-efi-modules is already sufficiently reported
so that I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants