With the advent of UEFI and secure boot, dissecting grub 2 has become more of a risk, rather than a challenge alone. To workaround the new situation, I install a skeletal base system in a dedicated 1 GB partition. I do this by using debootstrap and chroot. However, it can be done using a normal installation CD/DVD with the condition that a GUI is not installed. Such a barebone installation will in the end ask to install GRUB 2 at the end which makes it bootable.
My setup ONLY makes sense in a multiboot system. Currently, I have five working installations on the same machine!


To make all your installations bootable following kernel updates, you will need to edit the grub.cfg file. The linux line should use /vmlinuz and the initrd line, /initrd.img. All the rest of the respective lines is required unless you know what you are doing. You can make a backup of grub.cfg to avoid your edited versions from being overwritten.
Now, if the format of GRUB 2's menu entries doesn't appeal to your likes you can edit the grub.cfg file. However, you have to strickly observe some rules as syntax errors can easily result in an unbootable system. If you have never written programming code in an advanced programming language, I strongly tell you: YOU MUST KNOW WHAT YOU ARE DOING!
Syntax Rules:
- Lines starting with echo can be deleted. Text between the single quotation marks can be edited but don't use multiple lines of text.
- Similarly text enclosed between the single quotation marks in the line starting with menuentry can be edited.
- Lines starting with linux can be edited to use the symlinks in / instead of the precise kernel file name. This also applies to the line starting with initrd.
- The partition UUID and the partition number can be replaced with those of another partition. This is useful to add bootability to another partition without using the update-grub command.
An Example:
- Code: Select all
menuentry '1: Debian 7 on /dev/sda3' --class debian --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='(hd0,gpt3)'
search --no-floppy --fs-uuid --set=root 12345678-a888-55a0-b8ee-cc9b2187dabc
echo 'Loading Debian 7 from /dev/sda3...'
linux /vmlinuz root=UUID=12345678-a888-55a0-b8ee-cc9b2187dabc ro quiet acpi_backlight=vendor
initrd /initrd.img
}
Note how linux and initrd only use the symlinks at the / directory. This is required so that whenever a kernel is updated to a different name, its corresponding installation still remains bootable.
Also note that edititing the menuentry line helps unclatter your grub menu. You can also include more meaningful menu entry names like:
- Code: Select all
1. Squeeze LTS
2. Wheezy
3. Jessie