#3581 PR merged: grubenv should not be moved away by default

Labels: enhancement, cleanup, fixed / solved / done

jsmeix opened issue at 2026-03-10 13:57:

grubenv should not be moved away by default,
see https://github.com/rear/rear/issues/3578

Therein see in particular in
https://github.com/rear/rear/issues/3578#issuecomment-4031339803
the part

> removing grubenv is problematic in some cases,
> so I would keep it by default and when a user knows
> that removing grubenv in the recreated system is needed,
> they can set
> BACKUP_RESTORE_MOVE_AWAY_FILES+=( /boot/grub2/grubenv )

I agree - in particular because according to
https://github.com/rear/rear/issues/1828#issuecomment-398717889
when grubenv is kept a SUSE system boots
regardless of the GRUB error message
"error: invalid environment block."
but according to this issue here a Rocky 9 system
fails to boot when grubenv is removed so this issue here
is more severe than only a GRUB error message annoyance.

pcahyna commented at 2026-03-10 15:55:

Thanks @jsmeix , please give me some time to test with various RHEL versions. In particular I am curious what will happen if the filesystem UUID changes and the kernel command line needs to be updated.

jsmeix commented at 2026-03-23 12:35:

@rear/contributors
I would like to merge it on Wednesday afternoon
unless there are objections.
We are still in ReaR 3.0 development phase
so if this changes cause more problems than they solve
I can simply revert things to what it was before.
In any case the user can specify what works for him
in his particular environment regardless what the
BACKUP_RESTORE_MOVE_AWAY_FILES default setting is.

jsmeix commented at 2026-03-24 16:12:

This one is obsoleted by
https://github.com/rear/rear/pull/3591

Neverthelles I would like to keep this one open as a "Draft"
until the comments from @pcahyna are solved.

pcahyna commented at 2026-03-24 17:22:

This one is obsoleted by #3591

Neverthelles I would like to keep this one open as a "Draft" until the comments from @pcahyna are solved.

Since you agreed with one of the comments, could you please resolve it and then merge it? https://github.com/rear/rear/pull/3591 should then be rebased on top of it.

I don't have anything further to add beyond these "comments-on-comments" above. I have not tested it yet, but I am confident that it will improve the situation. Thanks!

codacy-production commented at 2026-03-31 13:30:

Up to standards ✅

🟢 Issues 0 issues >
> > **Results:** > `0` new issues > > [View in > Codacy](https://app.codacy.com/gh/rear/rear/pull-requests/3581/issues) >

TIP This summary will be updated as you push new changes. Give us feedback

jsmeix commented at 2026-03-31 14:21:

@rear/contributors
I will merge this one right now in a few minutes
so @svlv can proceed with his
https://github.com/rear/rear/pull/3591

pcahyna commented at 2026-03-31 14:36:

@jsmeix thanks!


[Export of Github issue for rear/rear.]