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

REAR image does not boot in UEFI ( only on physical machine ). Used latest rear 2.6 version #2585

Closed
cvijayvinoth opened this issue Mar 9, 2021 · 33 comments

Comments

@cvijayvinoth
Copy link

Relax-and-Recover (ReaR) Issue Template

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.6 / Git

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
    OUTPUT=ISO
    BACKUP=RSYNC
    RSYNC_PREFIX="yuvaraj1_${HOSTNAME}"
    BACKUP_PROG="/var/www/html/imageBackup/rsync"
    OUTPUT_URL=rsync://yuvaraj1@192.168.1.123::rsync_backup
    BACKUP_URL=rsync://yuvaraj1@192.168.1.123::rsync_backup
    ISO_DIR="/var/www/html/imageBackup/iso/$HOSTNAME"
    MESSAGE_PREFIX="$$: "
    PROGRESS_MODE="plain"
    AUTOEXCLUDE_PATH=( /tmp )
    PROGRESS_WAIT_SECONDS="1"
    export TMPDIR="/var/www/html/imageBackup/iso/"
    PXE_RECOVER_MODE=automatic
    ISO_FILES=("/var/www/html/imageBackup/rsync")
    ISO_PREFIX="${HOSTNAME}"

  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR): PC

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device): x86 compatible

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot): UEFI and GRUB

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath

(DM or NVMe): local disk

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT" or "lsblk" as makeshift):

  • Description of the issue (ideally so that others can reproduce it):
    NAME KNAME PKNAME TRAN TYPE FSTYPE SIZE MOUNTPOINT
    /dev/sda /dev/sda ata disk 298.1G
    |-/dev/sda1 /dev/sda1 /dev/sda part vfat 200M /boot/efi
    |-/dev/sda2 /dev/sda2 /dev/sda part xfs 1G /boot
    -/dev/sda3 /dev/sda3 /dev/sda part LVM2_member 296.9G |-/dev/mapper/centos-root /dev/dm-0 /dev/sda3 lvm xfs 50G / |-/dev/mapper/centos-swap /dev/dm-1 /dev/sda3 lvm swap 7.8G [SWAP] -/dev/mapper/centos-home /dev/dm-2 /dev/sda3 lvm xfs 239.1G /home
    /dev/sdb /dev/sdb ata disk 465.8G
    |-/dev/sdb1 /dev/sdb1 /dev/sdb part ext4 238.4G
    `-/dev/sdb2 /dev/sdb2 /dev/sdb part ext4 227.4G

  • Workaround, if any:
    error: file `/isolinux/kernel' not found.
    Loading initial ramdisk ...
    error: you need to load the kernel first.
    Press any key to continue...

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files): mkbackup
    rear-centos-7.log

To paste verbatim text like command output or file content,
include it between a leading and a closing line of three backticks like

```
verbatim content
```
@cvijayvinoth cvijayvinoth changed the title REAR image does not boot in UEFI ( on physical machine only ). Used latest rear 2.6 version REAR image does not boot in UEFI ( only on physical machine ). Used latest rear 2.6 version Mar 9, 2021
@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

Hello. There were some changes in the UEFI bootloader support, can you please try a version without those changes? You can try the rear-2.4 package included in CentOS, because it does not have the changes in question.

By the way, does "only on physical machine" mean that on a virtual machine it is working properly?

@cvijayvinoth
Copy link
Author

Yes it is working fine in virtual machine. Ok let me try with rear-2.4

@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

Note that you will need the grub2-efi-x64-modules package, I believe it is not installed by default.

@cvijayvinoth
Copy link
Author

@pcahyna : Thanks for your update. I haven't install this package. let me install it and verify once again.

@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

ReaR from CentOS should warn you that you need this package if you don't have it.

@cvijayvinoth
Copy link
Author

Thanks @pcahyna. Its working fine with rear2.4. Looks I can't use rear-2.6.

@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

@cvijayvinoth if you press any key to continue when GRUB stops, do you get to the GRUB command line? If so, can you please try echo ${root} at the command line?

@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

By the way, do you use ReaR from Git? If so, does your version contain the commit 60f28ee? I am asking because you say that you are using 2.6 and your issue looks a lot like #2434 (resolved in #2453), and this fix is planned for 2.7, not for 2.6.

@jsmeix
Copy link
Member

jsmeix commented Mar 9, 2021

@cvijayvinoth
to try out our current ReaR GitHub master code see the section
"Testing current ReaR upstream GitHub master code" in
https://en.opensuse.org/SDB:Disaster_Recovery

@cvijayvinoth
Copy link
Author

@jsmeix : yes I have been used 2.6 version from git only.

@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

@jsmeix thanks, indeed GitHub master should fix the issue.
I am thinking what would be possible workaround for those that have created rescue media using 2.6 and the media don't boot...
I suspect it could be as simple as issuing the commands

linux (cd0)/isolinux/kernel
initrd (cd0)/isolinux/initrd.cgz
boot

manually in the GRUB command line.
@cvijayvinoth can you please attempt this workaround?

@cvijayvinoth
Copy link
Author

sure let me try once @pcahyna. I have used edit option on the menu ( pressed e ) and updated (cd0) before the /isolinux. It didn't work. Let me check with GRUB command line manually and update.

@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

I am asking because you say that you are using 2.6

My bad, I have not realized that the latest Git version identifies itself as "Relax-and-Recover 2.6 / Git", not as 2.7.

@cvijayvinoth
Copy link
Author

Could you please share the link location for 2.7 version? Let me try with that too once.

@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

2.7 has not been released yet, if you use master branch from Github, you get what will eventually become 2.7 when released. Is that what you have been using?

@cvijayvinoth
Copy link
Author

yes... I am using the master branch only.

@pcahyna
Copy link
Member

pcahyna commented Mar 9, 2021

Can you please try several other things?
git commit 2be7f8b - that's the git version just before the merge that possibly caused the issue
git commit c9e61ba - that's immediately after
and in a version which works (like 2.4), try interrupting GRUB in the rescue CD and in the command line, enter
echo ${root} ${prefix}
and report the result.

@cvijayvinoth
Copy link
Author

sure @pcahyna. Now the restore is going on with rear 2.4 version. Let me verify post completing the current restore process.

@cvijayvinoth
Copy link
Author

cvijayvinoth commented Mar 10, 2021

Yes you are correct @pcahyna . After reverting the code it is working fine. Its booting now.
For rear 2.6
echo ${root} ${prefix}
hd0,msdos1 (cd0)/EFI/BOOT

@pcahyna
Copy link
Member

pcahyna commented Mar 10, 2021

Thank you for testing. Can we make a summary what works and what does not? First iteration:

current ReaR master - broken
ReaR 2.4 from CentOS 7 repos - works
ReaR revision 2be7f8b - works?
ReaR revision c9e61ba - ?

@pcahyna
Copy link
Member

pcahyna commented Mar 10, 2021

rear 2.6

You mean rear from Git master, not the 2.6 release, right? Anyway,

echo ${root} ${prefix}
hd0,msdos1 (cd0)/EFI/BOOT

That's very interesting. I did not expect this. I guess that it finds the EFI partition on the hard disk, instead of the EFI files on the CD.
I also think that if the disk content were completely destroyed and you were restoring entirely from scratch, this problem would not occur.

@cvijayvinoth
Copy link
Author

cvijayvinoth commented Mar 10, 2021

First tried with ReaR revision 2be7f8b - not working.
echo ${root} ${prefix}
cd0 (memdisk)/boot/grub

Post that with ReaR revision c9e61ba and revision 2be7f8b
works fine as expected

I missed to check ReaR revision c9e61ba only. Sorry my bad.

@pcahyna
Copy link
Member

pcahyna commented Mar 10, 2021

so revision 2be7f8b never worked after all?

That's strange because 2be7f8b is before my changes that I suspect were causing the problem. c9e61ba is after. So my changes seem to have improved it, if I understand correctly. Now the question is, why 2.4 works, even if it is way older, and current Git version does not, even though it contains my change.

@pcahyna
Copy link
Member

pcahyna commented Mar 10, 2021

First tried with ReaR revision 2be7f8b - not working.
echo ${root} ${prefix}
cd0 (memdisk)/boot/grub

That's strange, 2be7f8b did not use memdisk yet.

@cvijayvinoth
Copy link
Author

also think that if the disk content were completely destroyed and you were restoring entirely from scratch

yes, rear from Git master only.
Yes you are correct. It is finds the EFI partition on the hard disk, if the OS is exists.

@cvijayvinoth
Copy link
Author

so revision 2be7f8b never worked after all?

That's strange because 2be7f8b is before my changes that I suspect were causing the problem. c9e61ba is after. So my changes seem to have improved it, if I understand correctly. Now the question is, why 2.4 works, even if it is way older, and current Git version does not, even though it contains my change.

Tried with revision 2be7f8b couple of times. It never worked. Even I am trying to understand the changes in rear 2.6 code base and 2.4 version.

@pcahyna
Copy link
Member

pcahyna commented Mar 10, 2021

Can you please try 60f28ee and f346935? The former is after a recent change that touched UEFI code, the latter is immediately before it.

@cvijayvinoth
Copy link
Author

Can you please try 60f28ee and f346935? The former is after a recent change that touched UEFI code, the latter is immediately before it.

Let me try and update you.

@cvijayvinoth
Copy link
Author

cvijayvinoth commented Mar 10, 2021

Found one more issue on https://github.com/rear/rear/blob/master/usr/share/rear/output/ISO/Linux-i386/250_populate_efibootimg.sh
Line number 89.

local grubdir="$( echo -n ${boot_dir}/grub* )"
test -d "$grubdir" || grubdir="${boot_dir}/grub"

grubdir For me output is: /boot/grub /boot/grub2

[root@centos-7 rear-master]# ls -al /boot/grub*
/boot/grub:
total 8
drwxr-xr-x. 2 root root   27 Feb  3 04:16 .
dr-xr-xr-x. 5 root root 4096 Mar  8 02:13 ..
-rw-r--r--. 1 root root 1350 Nov 15  2011 splash.xpm.gz

/boot/grub2:
total 28
drwx------. 5 root root   82 Mar  9 05:16 .
dr-xr-xr-x. 5 root root 4096 Mar  8 02:13 ..
drwxr-xr-x. 2 root root   25 Feb 25 23:28 fonts
-rw-r--r--. 1 root root 6075 Feb 25 01:09 grub.cfg
lrwxrwxrwx. 1 root root   25 Mar  9 05:16 grubenv -> ../efi/EFI/centos/grubenv
drwxr-xr-x. 2 root root 4096 Feb 26 00:10 locale
drwxr-xr-x. 2 root root 8192 Feb 26 00:10 x86_64-efi

Actually /boot/grub2 should be assigned for grubdir.
But As per the logic grubdir="${boot_dir}/grub" is assigned.

@pcahyna
Copy link
Member

pcahyna commented Mar 10, 2021

Good catch, the code does not take into account the possibility of having both /boot/grub and /boot/grub2.
But this does not seem to be your problem, as this will affect only GRUB fonts and locales.
Also this code has been there for a long time.

@pcahyna
Copy link
Member

pcahyna commented Apr 15, 2021

Can you please try 60f28ee and f346935? The former is after a recent change that touched UEFI code, the latter is immediately before it.

Let me try and update you.

Hello @cvijayvinoth , do you have any updates?

@cvijayvinoth
Copy link
Author

@pcahyna : sorry missed to update you. Lost the access for that device. Let me try to reproduce it on my local machine and update you on this.

@github-actions
Copy link

Stale issue message

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