Write the first 512 bytes of our Linux boot partition to a file and copy that file to a FAT32 partition:
dd if=/dev/sda2 of=linux.bin bs=512 count=1
Copy that file to the root of the Windows boot (active) partition (e.g., C:\). Next, let’s use BCDEdit to add an entry to Windows 7’s BCD store. Administrative privileges are required to use BCDEdit, so navigate to Start→All Programs→Accessories, Right-click on Command Prompt and select “Run as administrator.” Okay, now let’s start by creating an entry for our Linux distribution. Note here that you are free to choose another entry name if desired:
bcdedit /create /d “GNULinux” /application BOOTSECTOR
BCDEdit will return an alphanumeric identifier for this entry that I will refer to as {ID} in the remaining steps. You’ll need to replace {ID} by the actual returned identifier. An example of {ID} is {d7294d4e-9837-11de-99ac-f3f3a79e3e93}. Next, let’s specify which partition hosts a copy of the linux.bin
file:
bcdedit /set {ID} device partition=c:
The path to our linux.bin file:
bcdedit /set {ID} path \linux.bin
An entry to the displayed menu at boot time:
bcdedit /displayorder {ID} /addlast
and finally, let’s specify how long the menu choices will be displayed:
bcdedit /timeout 5