Bug 2072978 - Sometimes rear does not update the UUID in /etc/fstab to match the new partition but no error is shown
Summary: Sometimes rear does not update the UUID in /etc/fstab to match the new partit...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rear
Version: 8.5
Hardware: All
OS: All
unspecified
medium
Target Milestone: rc
: ---
Assignee: Pavel Cahyna
QA Contact: David Jež
Šárka Jana
URL:
Whiteboard:
Depends On: 2083272
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-07 11:56 UTC by Welterlen Benoit
Modified: 2022-11-08 11:09 UTC (History)
3 users (show)

Fixed In Version: rear-2.6-5.el8
Doc Type: Bug Fix
Doc Text:
.ReaR no longer fails to display an error message if it does not update the UUID in `/etc/fstab` Previously, ReaR did not display an error message during recovery when it failed to update the universally unique identifier (UUID) in `/etc/fstab` to match the UUID of the newly created partition in case the UUIDs were different. This could have happened if the rescue image was out of sync with the backup. With this update, an error message occurs during recovery if the restored basic system files do not match the recreated system.
Clone Of:
: 2083272 (view as bug list)
Environment:
Last Closed: 2022-11-08 10:02:43 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rear rear issues 2785 0 None closed No error is printed if UUID are not updated during recover (no sed output) 2022-05-09 14:53:15 UTC
Github rear rear pull 2786 0 None closed Print error if UUID not updated 2022-05-09 14:53:07 UTC
Github rear rear pull 2795 0 None Merged Verify file hashes at the end of recover after file restore from backup 2022-05-09 14:53:11 UTC
Red Hat Issue Tracker RHELPLAN-118239 0 None None None 2022-04-07 12:01:01 UTC
Red Hat Product Errata RHBA-2022:7654 0 None None None 2022-11-08 10:02:50 UTC

Description Welterlen Benoit 2022-04-07 11:56:50 UTC
Description of problem:
- In certain circumstances, rear does not update the UUID in /etc/fstab and also other files:

~~~
 sed -i ';/7ADA-C08C/s/7ADA-C08C/0DB3-E018/g' /mnt/local/etc/default/grub
++ sed -i ';/7ADA-C08C/s/7ADA-C08C/0DB3-E018/g' etc/fstab
++ sed -i ';/7ADA-C08C/s/7ADA-C08C/0DB3-E018/g' etc/mtools.conf
++ sed -i ';/7ADA-C08C/s/7ADA-C08C/0DB3-E018/g' boot/efi/EFI/redhat/grub.cfg
~~~

This is certainly due to a mix of rescue ISO and updated files available in the backup.
This must be clarified, but the issue here is that there is no error printed, the return code of sed does not say that the file has been patched.

Version-Release number of selected component (if applicable):
rear-2.6-3.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. make a rear backup/rescue
2. change the UUID of EFI partition
3. make the recover

Actual results:
No error is printed during the recover about the non updated UUID

Expected results:
at least a warning about wrong UUID

Additional info:
I submitted a PR upstream to check if files are really patched
https://github.com/rear/rear/issues/2785
https://github.com/rear/rear/pull/2786

Comment 1 Pavel Cahyna 2022-04-07 12:40:47 UTC
(In reply to Welterlen Benoit from comment #0)
> Description of problem:
> - In certain circumstances, rear does not update the UUID in /etc/fstab and
> also other files:
> 
> ~~~
>  sed -i ';/7ADA-C08C/s/7ADA-C08C/0DB3-E018/g' /mnt/local/etc/default/grub
> ++ sed -i ';/7ADA-C08C/s/7ADA-C08C/0DB3-E018/g' etc/fstab
> ++ sed -i ';/7ADA-C08C/s/7ADA-C08C/0DB3-E018/g' etc/mtools.conf
> ++ sed -i ';/7ADA-C08C/s/7ADA-C08C/0DB3-E018/g' boot/efi/EFI/redhat/grub.cfg
> ~~~

7ADA-C08C is an EFI UUID? It looks too short, isn't it rather the MS-DOS volume ID?

> This is certainly due to a mix of rescue ISO and updated files available in
> the backup.
> This must be clarified, but the issue here is that there is no error
> printed, the return code of sed does not say that the file has been patched.

But what if fstab does not mount the partition by UUID at all? It could mount it by volume label, or by device name. In that case, it is entirely OK if sed fails. is the sed command generated only if the original ID is actually found in the particular file?

> How reproducible:
> always
> 
> Steps to Reproduce:
> 1. make a rear backup/rescue
> 2. change the UUID of EFI partition
> 3. make the recover

I wonder how did the updated files get into the backup. I think the list of steps is missing a "rear mkbackuponly" or an external backup tool run between the UUID change and recovery attempt.

Comment 2 Welterlen Benoit 2022-04-07 12:53:07 UTC
Yes, it's the UEFI partition. By default, it's identified by the UUID.
I agree that we will have false warning because of this ...

I think I identified the workflow that leads to this issue.
Will share soon.

Thank you !

Benoit

Comment 3 Pavel Cahyna 2022-04-07 14:14:09 UTC
sorry, I have not understood originally that by "UUID of EFI partition" you meant the volume ID of the vfat filesystem on the EFI System Partition, I thought you meant the UUID in GPT partition table.

Comment 5 Pavel Cahyna 2022-04-11 12:09:25 UTC
Has the particular case here happened with internal backup (rear mkbackup or mkbackuponly) or with an external backup method (like NetBackup or TSM)? If the latter, how is the backup triggered?

Comment 6 Pavel Cahyna 2022-05-09 14:56:36 UTC
The pull request to detect inconsistencies after restore of files from backup using md5sums has been merged upstream. It is not yet the ideal solution (it warns about the problem instead of preventing it), but it is already an improvement.

Comment 16 errata-xmlrpc 2022-11-08 10:02:43 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:7654


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