Bug 1657218 - DOCUMENTATION: grub2-editenv command will break boot of a system
Summary: DOCUMENTATION: grub2-editenv command will break boot of a system
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: Documentation
Version: 8.0
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: 8.0
Assignee: Jaroslav Klech
QA Contact: RHEL DPM
URL:
Whiteboard:
: 1661591 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-07 13:46 UTC by Charles Haithcock
Modified: 2019-05-22 04:52 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-16 09:45:17 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Charles Haithcock 2018-12-07 13:46:24 UTC
Document URL: 

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8-beta/html-single/managing_monitoring_and_updating_the_kernel/


Section Number and Name: 

2.4.1. Changing kernel command line parameters for all boot entries


Describe the issue: 

The grub2-editenv command, if ran as is, would cause a system to fail to boot on reboot for all kernels. 

# grub2-editenv - set kernelopts=”rd.debug=1 rhgb”

This wipes _all_ kernel parameters and resets the kernelopts to the list provided. Likewise, the 'kernelopts=' needs to be enclosed in the quotation marks as well. 


Suggestions for improvement: 

A KCS goes through great detail on how to change it: 

https://access.redhat.com/solutions/3710121

Alternatively, some sed magic and subshell fun could be used to make this option less scary since the entire parameter list must be provided: 

# grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) <NEEW_PARAM>"
# grub2-editenv - set "$(grub2-editenv - list | grep kernelopts | sed -e 's/<PARAM_TO_REMOVE>//')"


For example, if the parameter you want to add/remove is "example": 

# grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) example"
# grub2-editenv - set "$(grub2-editenv - list | grep kernelopts | sed -e 's/example//')"


Additional information: 

The grub2-editenv command does not add or subtract from the environment variables but rather overwrites the entire parameter value being changed. 

The BZ is set to high only because the documentation, as is, could legitimately break customer systems.

Comment 1 Javier Martinez Canillas 2018-12-12 10:45:21 UTC
(In reply to Charles Haithcock from comment #0)
> Document URL: 
> 
> https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8-
> beta/html-single/managing_monitoring_and_updating_the_kernel/
> 
> 
> Section Number and Name: 
> 
> 2.4.1. Changing kernel command line parameters for all boot entries
> 
> 
> Describe the issue: 
> 
> The grub2-editenv command, if ran as is, would cause a system to fail to
> boot on reboot for all kernels. 
> 
> # grub2-editenv - set kernelopts=”rd.debug=1 rhgb”
> 
> This wipes _all_ kernel parameters and resets the kernelopts to the list
> provided. Likewise, the 'kernelopts=' needs to be enclosed in the quotation
> marks as well. 
> 
> 
> Suggestions for improvement: 
> 
> A KCS goes through great detail on how to change it: 
> 
> https://access.redhat.com/solutions/3710121
> 
> Alternatively, some sed magic and subshell fun could be used to make this
> option less scary since the entire parameter list must be provided: 
> 
> # grub2-editenv - set "$(grub2-editenv - list | grep kernelopts)
> <NEEW_PARAM>"
> # grub2-editenv - set "$(grub2-editenv - list | grep kernelopts | sed -e
> 's/<PARAM_TO_REMOVE>//')"
> 
> 
> For example, if the parameter you want to add/remove is "example": 
> 
> # grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) example"
> # grub2-editenv - set "$(grub2-editenv - list | grep kernelopts | sed -e
> 's/example//')"
> 
> 
> Additional information: 
> 
> The grub2-editenv command does not add or subtract from the environment
> variables but rather overwrites the entire parameter value being changed. 
> 
> The BZ is set to high only because the documentation, as is, could
> legitimately break customer systems.

Agreed on the suggestion.

Also, now updating GRUB_CMDLINE_LINUX in /etc/default/grub and running grub2-mkconfig is also supported. This was done because there is a lot of documentation suggesting this and users are used to that workflow. So it should be mentioned in the documentation as well.

Comment 6 Charles Haithcock 2019-03-20 20:09:47 UTC
Looks good to me

Comment 7 Jaroslav Klech 2019-04-18 10:10:33 UTC
*** Bug 1661591 has been marked as a duplicate of this bug. ***


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