I am a programmer hobbyist. I currently got a hold of an old Intel 386 Manual and I thought it would be fun to see if I could make a custom boot loader. Nothing professional, just something fun.
I do not want delete everything on my computer and write directly on my MBR. I would like to leave GRUB2 as well as all my other partitions. I have set up a small partition to experiment with.
Is there a way to set GRUB2 to boot to a partition as if it was the computers MBR?
Currently /etc/grub.d/40_custom looks like
Code:
#!/bin/sh
exec tail -n +3 #0
#
#
#
menuentry "mybootloader" {
set root=(hd0,8)
chainloader +1
}
fdisk -l gives me:
Quote:
Device Boot Start End Blocks Id System
/dev/sda1 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 842250239 421021696 7 HPFS/NTFS/exFAT
/dev/sda3 * 842250240 842444799 97280 83 Linux
/dev/sda4 842446846 1953525167 555539161 5 Extended
/dev/sda5 842446848 874475519 16014336 82 Linux swap / Solaris
/dev/sda6 874477568 1069787135 97654784 83 Linux
/dev/sda7 1069789184 1265098751 97654784 83 Linux
/dev/sda8 1265098815 1267058681 979933+ 60 Unknown
|
I update-grub and reboot. When I execute my partition from the GRUB menu I get: