Linux: sed cannot rename /etc/default/sedysYQ9l Operation not permitted

Problem:

I was trying to enable Kdump and wanted to set the memory for crashkernel, so I tried this command that is provided by the RHEL official site:

[root@rac1 ~]# sudo grubby --update-kernel=ALL --args="crashkernel=1G"

And I’ve received the following error:

sed: cannot rename /etc/default/sedysYQ9l: Operation not permitted

Please note that every time you rerun the command, the letters after /etc/default change, so you probably have a different path.

Workaround:

At this time, I am providing only a workaround since I could not find a solution. You have several options available.

  • Enabling it for the current kernel, which can be done with one command:
# grubby --update-kernel=/boot/vmlinuz-$(uname -r) --args="crashkernel=1G"
  • Or enable for a specific kernel (run multiple times for other kernels if necessary)
# grubby --update-kernel=/boot/vmlinuz-4.18.0-553.22.1.el8_10.x86_64 --args="crashkernel=1G"