DEV Community

Cover image for Add Power Off and Reboot to grub menu
Dhananjay Tanpure
Dhananjay Tanpure

Posted on • Originally published at blog.dtan13.tech

Add Power Off and Reboot to grub menu

To add Power Off and Reboot options to grub menu, you need to update a file in your grub configuration directory.

cd /etc/grub.d
Enter fullscreen mode Exit fullscreen mode

Open 40_custom in your favorite editor

For me its micro :

micro 40_custom
Enter fullscreen mode Exit fullscreen mode

Add following line at the end of the file


 menuentry "Reboot" {
      reboot
}

menuentry "Power Off" {
      halt
}

Enter fullscreen mode Exit fullscreen mode

Do not change the exec tail line in the file

Update your grub.cfg file

  • For Debian based distros
update-grub
Enter fullscreen mode Exit fullscreen mode
  • For Arch based and Other distros
grub-mkconfig -o /boot/grub/grub.cfg
Enter fullscreen mode Exit fullscreen mode

Discussion (0)