Fix my computer when it does the restart on open the lid thingWritten by: Kimberlee Model, posted: 2018-05-27, last modified: 2019-09-28. Tags: How I configured, Linux Laptop.
So every now and then CentOS pushes out updates to GRUB, and it changes the grub configuration. Unfortunately for me, this means that when I close the lid of my laptop, and then reopen it, the thing turns on and goes back to the "GRUB which operating system and kernel do you want to use" screen. Which is *not good* because it means I could lose work and it is just generally inconvenient. These are the steps that fix it for me.
They mostly consist of "copying and pasting from stack overflow" but putting it here means that I know exactly where to find it. So the stack overflow solution didn't work, so I had to spend an hour with the linux kernel parameter docs.
1. edit the file /etc/default/grub and add the line
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_sleep=nonvs intel_pstate=disable"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=strict acpi_sleep=nonvs"
It should go right above the line that starts GRUB_CMDLINE_LINUX.
then run this command as root because the previous file is a config file to generate the grub config file, so now just re generate the config file.
$> grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
then reboot and it should work good