Since most of the documentation I see on Grub2 at this point is written for Ubuntu, and Fedora does it differently, this page is more of a reminder to myself.
These commands are for Fedora 16 in its alpha stage. I don't know how many of them will change. Please consider this a work in progress.
grub2-mkconfig -o /boot/grub2/grub.cfg |
The -o is for the output file--if you don't give it, then no changes are actually made.
menuentry "ArchLinux" {
set root='(hd0,6)'
linux /boot/vmlinuz-linux
initrd /boot/initramfs-linux.img
}
|
If using chainloading then,after the setroot line, instead of linux and initrd, it would look like
menuentry "ArchLinux" {
set root='(hd0,6)'
chainloader (hd0,6)+1
}
|
When done, once again, one would run grub2-mkconfig -o /boot/grub/grub.cfg.
Instead of adding those lines to /etc/grub.d/40_custom, one can create a file /boot/grub2/custom.cfg. If one looks at /etc/grub.d/41_custom (as opposed to 40_custom) in Fedora, they will see that it says if /boot/grub2/custom.cfg exists, then source it. So, if one creates a custom.cfg file with the entry given above, i.e.
menuentry "ArchLinux" {
set root='(hd0,6)'
linux /boot/vmlinuz-linux
initrd /boot/initramfs-linux.img
}
|
upon reboot, the ArchLinux line should be visible. One advantage of having a custom.cfg file is that one doesn't have to run grub2-mkconfig after making any changes, the file will always be read upon boot.