Articles‎ > ‎Linux‎ > ‎

Windows 7 bootloader to Linux

Sometimes you might prefer to use the Windows bootloader rather than using the one that comes with your linux distribution when you get started.

Here is what you'll need to do:
  • Install Linux bootloader on a Linux partition
  • Grab the first 512 bytes of the Linux partition where you installed the bootloader and move it to a directory (probably the Windows root) as a file, referred to hereafter as linux.bin
  • Set the windows bootloader to launch that file as an option
There is more detail which I intend to add later, but most of the process is fairly easy to find and work with aside from manipulating the Widows bootloader.

Install linux specifying that a partition, not the MBR (Master Boot Record) should get the boot loader. Typically I set aside a couple hundred MegaBytes to hold the bootloader as a partition and set it to something slow but reliable as a format, like ext3.
Get root access (Ubuntu and other systems probably need you to type "sudo su -" from a command line)

(Assuming here that /dev/sda is your primary drive, /dev/sda1 is your Windows directory and /dev/sda5 is where you installed the linux bootloader)

Run these commands:
dd if=/dev/sda5 of=/root/linux.bin bs=512 count=1
mkdir /mnt/sda1
mount -t ntfs-3g /dev/sda1 /mnt/sda1
mv /root/linux.bin /mnt/sda1/linux.bin

With Vista as a native install or with Windows 7, you'll need to use BCDEdit (here is another guide)
  • Run cmd or "Command Prompt" as Administrator
  • Type BCDEdit to list the existing setup
  • type BCDEdit /create /d "Linux" /application BOOTSECTOR (and note the identifier it returns, referred hereafter as [linux_identifier])
  • type BCDEdit /set [linux_identifier] device partition=c: (or the drive where Windows can find the linux boot file)
  • type BCDEdit /displayorder {ID} path \linux.bin
  • type BCDEdit /timeout 30
To rename your Linux partition later:
  • type BCDEdit /set [linux_identifier] description "New Description"
To change the default boot system to the linux system,
  • bcdedit /set {bootmgr} default [linux_identifier]