@rej, I don't have Windows on my home machines.
For what it's worth, here is part of my custom entries in my custom.cfg file, and I'll explain each of the 5 entries at the bottom of the post because I was experimenting and mixing/matching many different ways of doing the same thing, ie, booting into my many distros:
For your system, obviously the partition numbers/labels and UUID numbers will all be different.
Code: Select all
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
#
# Manjaro Controlling grub
menuentry 'Manjaro Linux (Kernel: 4.14-MANJARO x64)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.60-1-MANJARO x64-advanced-2dfde925-1bcb-45b3-be68-aafd86795420' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod part_msdos
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 2dfde925-1bcb-45b3-be68-aafd86795420
else
search --no-floppy --fs-uuid --set=root 2dfde925-1bcb-45b3-be68-aafd86795420
fi
echo 'Loading Linux 4.14-MANJARO x64 ...'
linux /boot/vmlinuz-4.14-x86_64 root=UUID=2dfde925-1bcb-45b3-be68-aafd86795420 rw quiet splash
echo 'Loading initial ramdisk ...'
initrd /boot/intel-ucode.img /boot/initramfs-4.14-x86_64.img
}
#The other distros
menuentry "MX17 Final (ex-MX15) at sdb15" --class mx --class gnu-linux --class gnu --class os {
insmod part_gpt
insmod chain
chainloader (hd1,15)+1
}
menuentry "MX16 at sda3" --class mx --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
chainloader +1
}
menuentry "Korora Configfile sdb16" --class korora --class fedora --class gnu-linux --class gnu --class os {
insmod part_gpt
insmod part_msdos
insmod ext2
search --set=root --label korora
configfile /boot/grub2/grub.cfg
}
# ----------------------------------
menuentry 'FEHLIX GRUB MULTIBOOT KDE-NEON (/dev/sdb8)' --class neon --class gnu-linux --class gnu --class os $menuentry_id_option 'grub-multiboot-086fa4af-75fa-44b5-bf22-3c8a26fe6a98' {
# ----------------------------------
savedefault
insmod part_gpt
insmod part_msdos
insmod ext2
set root='hd1,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt8 --hint-efi=hd1,gpt8 --hint-baremetal=ahci1,gpt8 086fa4af-75fa-44b5-bf22-3c8a26fe6a98
else
search --no-floppy --fs-uuid --set=root 086fa4af-75fa-44b5-bf22-3c8a26fe6a98
fi
set OS_boot_config='/boot/grub/grub.cfg'
multiboot /boot/grub/i386-pc/core.img
}
My multiboot setup:
sda = msdos-partition table SSD. Controlling grub is written onto the MBR of /dev/sda
sdb = gpt-partition table hard drive (If I used msdos-formatting only the first 2 TB of the 3TB disk would be usable). Since MBR is on the msdos first disk, most distro installers don't seem to get confused that the distro is to be installed on a secondary GPT-formatted disk without the user using UEFI boot. A few did, so I just didn't install bootloader at all for those distros.
Entry #1 = Manjaro is my controlling grub. Nothing special, I just opened up Manjaro's grub.cfg file and copied the relevant section into my custom.cfg file. Manjaro keeps the kernel name of a kernel series the same even when there are updates to it, so as long as I continue using 4.14 kernel, I don't have to change this custom entry.
Entry #2 = MX17, in the gpt 2nd disk. This uses the usual chainloader command in grub2.
Entry #3 = MX16, which is in the msdos first disk. Another way to set out the usual chainloader command.
From what I understand, these traditional chainloader commands tell your system to JUMP from the main grub menu in my MBR, to the grub menu found in the partition boot record of the target distro, and then continue from there.
Entry #4 = Korora.
OK this is where it a little different. I use gparted to give labels to all my distro partitions.
search --set=root --label korora
configfile /boot/grub2/grub.cfg
Instead of setting root by referring to hard drive number and partition number, e.g. set root='hd0,msdos3'
I used the search command to search for a partition labelled "korora" and set that as root.
Then I use the "configfile" command to tell my main grub menu in MBR that instead of running all the menu entries it currently has, that it should "replace" those entries with the ones found in the /boot/grub/grub.cfg file found in partition labelled as "korora".
So unlike normal chainloading commands, I haven't jumped to the korora grub in its partition boot record, I'm running directly its grub.cfg file from the MBR grub menu. That's good because I never did install Korora's grub in its root partition (it wasn't allowed by Fedora's grub-mkconfig). I just installed the grub program itself and it could generate a grub.cfg file but the grub menu wasn't written into PBR.
Entry #5 = Neon, using Fehlix's template.
He uses hard drive and partition numbers, plus UUID to set root.
set OS_boot_config='/boot/grub/grub.cfg'
multiboot /boot/grub/i386-pc/core.img
Then he uses set OS_boot_config for use the boot configuration settings in korora's grub.cfg file,
and the "multiboot" command to boot from Korora's core.img.
I really have no idea of the differences between the multiboot and configfile methods, but both work fine. I have a configfile menu entry for Neon as well, and I interchange between that and Fehlix's "multiboot" entry. I can't see any differences.
Many ways to skin this particular cat.