Phantasm66
Posts: 4,909 +8
OK, I had to investigate this just recently, so I thought I would share. Here is what to do if you want to add Linux to Vista's boot menu, rather than using Grub in the Master Boot Record.
# Install Vista as normal.
# Install Linux, but install Grub to the bootsector of your / partition (which from now on we will call /dev/sda3) and NOT the MBR (i.e. /dev/sda)
# Boot Linux from the install CD, choose rescue mode.
# From the command prompt in rescue mode, mount your Linux installation partition, i.e.
mount /dev/sda3 /mnt/sysimage
then chroot it:
chroot /mnt/sysimage
reinstall Grub just to make sure that its working OK
/sbin/grub-install /dev/sda3
now, make a file image of the bootsector of /dev/sda3:
dd if=/dev/sda3 of=bootsect.lin bs=512 count=1
copy the bootsect.lin to somewhere you will be able to get it back when in Vista.
# Now, back in Vista
copy bootsect.lin to c:\
open a command prompt with cmd, and do the following:
bcdedit /displayorder {current}
bcdedit /create /d "Linux" /application BOOTSECTOR
(should say something like created entry, it will give it a name, like {cfc90cf0-f718-11db-b281-005056c00008} )
then
bcdedit /set {cfc90cf0-f718-11db-b281-005056c00008} device boot
bcdedit /set {cfc90cf0-f718-11db-b281-005056c00008} PATH \bootsect.lin
bcdedit /displayorder {cfc90cf0-f718-11db-b281-005056c00008} /addlast
bcdedit /timeout 5
# Reboot, Linux is now in the boot menu which if you select it you will go into Grub.
Easy, eh??
# Install Vista as normal.
# Install Linux, but install Grub to the bootsector of your / partition (which from now on we will call /dev/sda3) and NOT the MBR (i.e. /dev/sda)
# Boot Linux from the install CD, choose rescue mode.
# From the command prompt in rescue mode, mount your Linux installation partition, i.e.
mount /dev/sda3 /mnt/sysimage
then chroot it:
chroot /mnt/sysimage
reinstall Grub just to make sure that its working OK
/sbin/grub-install /dev/sda3
now, make a file image of the bootsector of /dev/sda3:
dd if=/dev/sda3 of=bootsect.lin bs=512 count=1
copy the bootsect.lin to somewhere you will be able to get it back when in Vista.
# Now, back in Vista
copy bootsect.lin to c:\
open a command prompt with cmd, and do the following:
bcdedit /displayorder {current}
bcdedit /create /d "Linux" /application BOOTSECTOR
(should say something like created entry, it will give it a name, like {cfc90cf0-f718-11db-b281-005056c00008} )
then
bcdedit /set {cfc90cf0-f718-11db-b281-005056c00008} device boot
bcdedit /set {cfc90cf0-f718-11db-b281-005056c00008} PATH \bootsect.lin
bcdedit /displayorder {cfc90cf0-f718-11db-b281-005056c00008} /addlast
bcdedit /timeout 5
# Reboot, Linux is now in the boot menu which if you select it you will go into Grub.
Easy, eh??