Jan Leow's Blog Page

GRUB2 Menu Entry Manually Set Up For Non-Detected Linux & Other OS

My earlier post about super multi-boot using Linux GRUB2 as my main boot loader and menu selection had been fun to do! There were also some tricky issues such as some OS need to be installed first before Linux and other OS could be installed.

Now we come to the issue of those Linux OS that could not automatically be detected by way of issuing terminal command ‘update-grub’ and had to be manually written into the GRUB configuration. I scoured the web for the commands and there were some variations to the menu entry. In some cases, some amount of tweaking was required in order to get it to work.

What I have listed here are for those Linux and alternate OS that I have created in my super multi-boot computer:

Basically one should edit the 40_custom file. This file is located in /etc/grub.d/

	/etc/grub.d/40_custom

And after adding the menuentry, go into terminal mode and type:

	update-grub 

Or

	sudo update-grub

If root privileges are required to issue the command.

However I found issuing the update-grub command for every minor edit a tad troublesome and thus I also do edit the grub.cfg file directly too to save some time. This file is located in:

	/boot/grub/grub.cfg

Do note whatever changes you made in grub.cfg would be overwritten whenever update-grub command is issued. Thus do remember to copy the changes to 40_custom file if you don’t want to lose those changes.

And for another handy menu entry, I have added the reboot and shutdown entry in the GRUB2 menu. Placed it as the final entry in the 40_custom / grub.cfg file.

    submenu 'EXIT' {
    	menuentry 'Reboot'{
    	echo 'REBOOTING...'
    	reboot
    	}
    	menuentry 'Shutdown (Halt)'{
    	echo 'SHUTTING DOWN NOW...!'
    	halt
    	}
    }

Cheers!

No comments: