Boot Linux From Menu
-
I have a dual boot system, grub2 loading ipxe from the linux ext3 partition, windows on the first partition.
Is there any way to force boot of Linux using fog’s grubfordos in boot.php? What I want is to be able to boot ipxe as first choice, and fog has no tasks, boot ubuntu.
-
Well grubfordos booting is only for bios computers.
Is your target computer a bios or uefi system?
-
@george1421 both are supported, but it is currently set up for legacy bios.
-
@jrhaner So tell me how you have the disk structure setup. You’ve got one partition that has ipxe on it, a second partition with windows on it and a third partition with ubuntu on it?
FOG’s normal operation is to pxe boot into the FOG iPXE menu over the network. From these depending on the firmware type it will either exit with SANBOOT for bios to boot from the first hard drive or refind.efi for uefi and refind searching for the EFI boot partition then chains to that.
For reference FOG issues this iPXE command to boot to the hard drive:
sanboot --no-describe --drive 0x80
-
@george1421
Grub2 defaults to ipxe which is a linux kernel in (hd0,msdos5)/ipxe/ipxe.lkrn on the root ubuntu partition. Grub2 also has menu items for Windows 10 and Ubuntu, however, since IPXE is the default, it will boot loop unless fog exit condition is the first windows partition. I didn’t see an option for first linux partition. -
@jrhaner said in Boot Linux From Menu:
(hd0,msdos5)/ipxe/ipxe.lkrn
OK this is telling me you are working with a bios based system. In that case grub4dos can be used.
FOG Creates this chain command for first found windows option
chain -ar ${boot-url}/service/ipxe/grub.exe --config-file="find --set-root /BOOTMGR;chainloader /BOOTMGR""
and this command for first hard drive
chain -ar ${boot-url}/service/ipxe/grub.exe --config-file="rootnoverify (hd0);chainloader +1"
Why I’m telling you this is because you can create your own custom iPXE menu with the proper grub commands you want then set that as the default iPXE menu item in fog. That way it will/can exit exactly the way you want it to and not the way the developers intended.
-
@george1421 I was working in that line of thinking. I just need to figure out how to translate Ubuntu’s grub2 parameters to grub4dos. I was looking at the definitions in the /fog/lib and found that snippet. I am just not as familiar with grub4dos vs grub2 commands.
great community, by the way.
-
@jrhaner From this page: https://www.gnu.org/software/grub/manual/grub/html_node/Chain_002dloading.html
set root=(hd0,1) chainloader +1
That should be root= first hard drive first partition.
ref: https://www.linux.com/training-tutorials/how-rescue-non-booting-grub-2-linux/ -
@george1421 Honestly, a better solution might be to use grub-reboot on startup in ubuntu. A bit hacky, but it’ll do