Windows → How to Dual Boot Windows 7 and Linux using BCDEdit
(10.24.11 – This post has been amended to address changes in recent versions of Fedora, GParted and Ubuntu — iceflatline)
This post will describe how to set up a system that can boot into Windows 7 or a Linux distribution. The Window 7 Boot Configuration Data Editor (BCDEdit) will be used to configure Windows 7 to display a menu at boot time that will allow the user to choose between Windows 7 and a Linux distribution of their choice. The steps described in this post assume that Windows 7 and the Linux distribution will occupy the same physical hard drive. Configuring BCDEdit to recognize and boot a Linux distribution located on a second physical hard drive is beyond the scope of this post.
To help explain the steps involved, we’ll use an 80 GB PATA hard drive with Windows 7 already installed. We’ll then re-partition the drive using Gnome Partition Editor (GParted) in order to add Ubuntu or Fedora. We’ll then use BCDedit to add a Windows boot menu option for our Linux distribution. All steps involved assume you have a functioning CD drive (or USB drive if you’d prefer) that the system can boot from. The software versions used in this post were as follows:
Oh… and while I’ve never encountered a situation where GParted destroyed existing disk data, make sure you backup any critical files before you proceed.
So, let’s get started.
Partitioning for Ubuntu
The first thing we’ll want to do is re-partition our 80GB drive. Download a copy of GParted Live and burn it to a CD (or place it on a bootable USB drive). Next, boot the system using the GParted disk. After accepting the default settings for keymap, language, and X-window configuration, you should arrive at the GParted desktop (See Figure 1).
You’ll notice that GParted is reporting ~74 GB of total disk space (1 Gigabyte = 1,073,741,824 Bytes) and that Windows 7 currently occupies all of that space using two primary partitions: one small boot partition at device /dev/sda1 and the remaining operating system at device /dev/sda2. Eventually, we will have five partitions in total: the two Windows 7 partitions just mentioned, as well as ones for the Ubuntu operating system and Linux swap. We’ll also create a small FAT32 partition for sharing data between Windows 7 and Ubuntu. You’ll need to determine how much disk space you want to allocate to each of these partitions based on your disk size. For our 80 GB disk example, we’ll use the following partition layout:
Windows 7: ~100MB (Windows 7 boot loader)
Windows 7: ~40 GB
Ubuntu: ~24 GB
Linux-Swap: ~1 GB
FAT32: ~9 GB
Let’s leave the Windows 7 boot partition at /dev/sda1 alone and reduce the partition at /dev/sda2 to ~40GB. Highlight /dev/sda2 by left-clicking on it and then select “Resize/Move.” This will bring up a new window where the new size for the partition can be entered manually, or you can left-click and hold the graphical bar to resize the partition. Make sure the free space is following /dev/sda2. Now hit “Resize/Move” to complete the resizing (See Figure 2). Then use GParted to complete the remaining steps.
Note: If you have a large Windows 7 partition (e.g. > ~200 GB) you may want to consider using Window’s Disk Manager to reduce the Windows partion to the desired size as it is substantially faster than using GParted. Then use GParted to complete the remaining steps.
Once the size of /dev/sda2 is reduced, you’ll see that the remaining space is now labeled unallocated. Left-click this space to highlight it and then select “New” to create a new partition. Make this partition a primary partition and the file system ext4. Now, reduce the partition to ~25 GB – you can do this by typing in the value in the New Size field or by moving the slider to the left until you reach the desired size. When complete, select “Add” (See Figure 3).
The disk is limited to four primary partitions, so in the remaining unallocated space we’ll need to create a new extended partition instead of a primary partition. Once the new extended partition is created, left-click to highlight it and create two new logical partitions following the steps above. One should be linux-swap and sized to 1 GB; the other (in the remaining space) will be our FAT32 partition. When complete, you should have a partition layout that resembles Figure 4.
Review the newly created partition layout and make any necessary adjustments. You can back out of any changes you’ve made by selecting “Undo Last Operation” or “Clear All Operations” (under the Edit menu). Now select “Apply All Operations” and GParted will proceed with writing the changes to the disk. After a few minutes you should see the re-partitioned drive (See Figure 5).
You’ll notice that GParted retained the device designations /dev/sda1 and /dev/sda2 for Windows 7 but has now assigned the appropriate device designations to each of our newly minted partitions:
/dev/sda1 – Windows 7 boot loader (Primary partition)
/dev/sda2 – Windows 7 (Primary partition)
/dev/sda3 – ext4 (Primary partition)
/dev/sda4 – (Extended partition)
/dev/sda5 – Linux-Swap (Logical partition)
/dev/sda6 – FAT32 (Logical partition)
Now, let’s exit out of GParted and reboot the system. If all went well, you will arrive at the Windows 7 logon screen. Along the way, you may see Windows perform a disk check (don’t worry, that’s normal, and should only occur once as a result of these procedures). If you log into Windows 7 at this point and access Explorer or Disk Manager you should see the FAT32 partition we created.
Partitioning for Fedora
The process for creating partitions for a Fedora install is essentially the same as described for Ubuntu. Consequently, we can use an identical partition layout:
Windows 7: ~100MB (Windows 7 boot loader)
Windows 7: ~40 GB
Fedora: ~24 GB
Linux-Swap: ~1 GB
FAT32: ~9 GB
Then use GParted and, following the steps described above for Ubuntu, create the following partitions for Fedora:
/dev/sda1 – Windows 7 boot loader (Primary partition)
/dev/sda2 – Windows 7 (Primary partition)
/dev/sda3 – ext4 (Primary partition)
/dev/sda4 – (Extended partition)
/dev/sda5 – Linux-Swap (Logical partition)
/dev/sda6 – FAT32 (Logical partition)
Note: Fedora 11 and prior versions are incapable of installing the GRUB boot loader on an ext4 partition. Therefore, if you wish to retain the ext4 partition for the operating system, you’ll need to create a small primary partition that Fedora can use to install its boot loader. This partition is typically formatted using the ext3 file system and should be 300 MB or greater in size.
Installing Ubuntu
Now it’s time to install Ubuntu on to the partitions we created using GParted. Download a copy of Ubuntu Desktop and burn it to a CD (or place it on a bootable USB drive). Boot the system using the Ubuntu disk. Double-click the install Ubuntu icon on the desktop to get started. Continue through the installation process until you arrive at “Installation type” and select “Something else” (See Figure 6).
The screen that follows is where we’ll instruct Ubuntu which mount points and file systems to use on the partitions we created. Left-click to highlight /dev/sda3 and then select “Change.” On the pop-up screen make sure that the Ext4 journaling file system is selected and the check box instructing Ubuntu to format the partition is checked. Device /dev/sda3 will serve as the root partition for Ubuntu so we’ll set the mount point to / from the list of choices in the drop down list. Now select “Okay” to accept the changes (See Figure 7).
Following similar steps, let’s move on to /dev/sda5 and set the mount point to linux-swap. There is no need to format this partition. You may also wish to set the FAT32 partition located at /dev/sda6 to have a mount point of /share, or something similar, and instruct the Ubuntu installer to format it as FAT32 (See Figure 8). The benefit of selecting a mount point at this stage is that Ubuntu will add this partition to /etc/fstab and automatically mount it at boot time. No worries though, you can always manually mount it or add it to /etc/fstab at a later time.
This next step is critical. We need to tell Ubuntu where to install its boot loader (GRUB2). We DO NOT want to install GRUB2 on /dev/sda, as that would overwrite our disk’s Master Boot Record, nor do we want to install it on /dev/sda1, as that is used for the Windows 7 bootmanager files and boot configuration data. Instead, let’s have Ubuntu install GRUB2 on the partition that will contain the Ubuntu operating system – in our case /dev/sda3. To do this, click on the drop down list under “Device for boot loader installation” and select /dev/sda3 (See Figure 9).
Now select “Install Now” and continue with the Ubuntu installation. When the install completes you’ll be asked to reboot the system. If all went well, you will once again arrive at the Windows 7 logon screen.
Installing Fedora
If you’re installing Fedora you’ll follow similar steps described in the Ubuntu install above. Download a copy of Fedora Desktop and burn it to a CD (or place it on a bootable USB drive). Boot the system using the Fedora disk and double-click on the install to hard disk icon on the desktop to get started (See Figure 10).
Make your way through the installer, selecting “Basic Storage Devices” option, until you arrive at Fedora’s installation selection screen and select “Create Custom Layout” from the list, then select “Next” (See Figure 11). Note: If you are installing Fedora on a serial ATA drive you may encounter the error “Disk contains BIOS metadata, but is not part of any recognized BIOS RAID sets. Ignoring disk sd[x]” Fedora has been known to falter on occasion in the presence of serial ATA drives and refuse to install to them. Should this error occur, try rebooting with the Fedora disk, hitting the TAB key to gain access to the boot options, and add the following command nodmraid. This will instruct Fedora to ignore the presence (or perceived presence) of RAID meta data and allow the installation to go forward.
Scroll down the list of devices until you find /dev/sda3. Left-click to highlight it and select “Edit.” This partition will contain the Fedora operating system so choose / for the mount point and format as ext4 (See Figure 12). When finished, select “Okay.” Next, highlight /dev/sda5, select Edit, and format this partition as Linux swap. Also, you may also wish to set the vfat (FAT32) partition located at /dev/sda6 to have a mount point of /share, or something similar, and instruct the Fedora installer to format it as vfat. The benefit of selecting a mount point at this stage is that Fedora will add this partition to /etc/fstab and automatically mount it at boot time. No worries though, you can always manually mount it or add it to /etc/fstab at a later time. Note: If you are installing Fedora 12, do not attempt to set the mount point or format the vfat partition at this time. Doing so will cause the installation to fail.
When complete, select “Next” and do a final review of these partition changes in the pop-up screen. You should see /dev/sda3 with a mount point of / and /dev/sda5 with a mount point of swap listed. Now select “Format” and confirm the choices by selecting “Write changes to disk.” At this point you will be presented with some choices for where Fedora should install its boot loader (GRUB2). This next step is critical. We DO NOT want to install GRUB2 on /dev/sda as that will overwrite our disk’s Master Boot Record. Instead, let’s have Fedora install GRUB2 on the partition that will contain the Fedora operating system – in our case /dev/sda3. To do this, left-click on the tab that says “Change device.” This will bring up a pop-up screen where we can specify location for the boot partition (See Figure 13).
When finished, select “Next” and Fedora will write the changes to disk and complete the install. Note: If you’re installing Fedora 12, be aware of a Bug that moves the system boot flag from /dev/sda1 to the partition the GRUB boot loader is installed on, in our case /dev/sda3. This is undesirable because we want the Windows 7 boot loader to boot first, not GRUB. To fix this, boot the system using the GParted disk. In the GParted program, left-click to highlight the partition /dev/sda3. Under the column labeled “Flags” you should see the word “boot.” We need to relocate this flag to /dev/sda1. Right-click the partition /dev/sda3 and select “Manage Flags.” Uncheck the mark next to “boot” and select “Close” (See Figure 14). Now, right-click /dev/sda1 and once again select “Manage Flags.” This time though we’re going to check the box next to “boot,” then select “Close.” Now, let’s exit out of GParted and reboot the system. If all went well, you will arrive at the Windows 7 logon screen.
Configuring for Dual Boot
Now that we have our disk partitioned and Fedora or Ubuntu installed, let’s set up our system to boot Windows 7 or the Linux distribution. This will involve copying the Master Boot Record of our Linux boot partition to Windows 7, and using BCDEdit to create a new entry in the BCD store that will point to that file. This way Windows 7 will display a menu at boot time that will give you a choice between Windows 7 and Linux.
Boot the system again using either the GParted disk or the Ubuntu or Fedora install disk you downloaded and let’s make a mount point for the FAT32 share partition we created (I prefer using the GParted disk because it boots to a usuable state much faster than the Fedora or Ubuntu Live disk). Open a terminal and enter the following:
mkdir /mnt/share
Next, let’s mount the correct device to this directory. Recall from the GParted partitioning steps above that the FAT32 partition is located at device /dev/sda6. Note: using the FAT32 partition in this step is optional. You may chose to use another device such as a USB drive. Just make sure to mount the appropriate device. Enter the following:
mount /dev/sda6 /mnt/share
Write the first 512 bytes of our Linux boot partition to a file and copy that file to our FAT32 partition:
dd if=/dev/sda3 of=/mnt/share/linux.bin bs=512 count=1
Exit GParted now and reboot to Windows 7. Open the FAT32 partition and you should see the linux.bin file. 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 “Linux” /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 30
That’s it! Now reboot and you will be presented with menu where you can choose to boot to Windows 7 or Linux. When you choose Linux, you’ll be taken to the GRUB menu where you can choose to continue booting your Linux distribution or return to the previous menu.
Note: Fedora users will notice that GRUB uses the hiddenmenu option by default. This requires users to hit “Esc” within 5 seconds (another Fedora GRUB default) in order to see the full GRUB menu. Not selecting Esc results in GRUB booting to the OS selected as the default in the boot loader operating system list during installation, which, in our case, should be Fedora, if the steps above were followed. If you would like to defeat the hiddenmenu option and/or change the default timeout, boot Fedora and open a terminal. Change to root and make a back up copy of /boot/grub/grub.conf Now open the original file in your favorite editor and comment out the line hiddenmenu. You can also change the timeout value to something greater than 5 (seconds). Now you when you select the Linux option from the Windows boot loader you should see the full GRUB menu with the option of selecting Fedora or Windows 7 within the timeout value you selected.
On a final note, if at any time you want to eliminate the Linux menu option simply delete the BCD store entry you created using the following command:
bcdedit /delete {ID}
Windows XP?
If you plan to dual boot using Windows XP then you will still partition and install Ubuntu or Fedora as described above (Note, however, that XP does not use a small primary partition for boot configuration data like Windows 7 does), but you won’t be needing BCDEdit. Instead, you can simply open the boot.ini file located at C:\ and add the following entry:
c:\linux.bin="Linux"
Conclusion
With a minimal amount time, the free and open source disk partitioning tool GParted, and a little command line foo, you can easily set up a system that can dual boot Windows 7 and your choice of Linux distributions.
References
http://technet.microsoft.com/en-us/library/cc709667%28WS.10%29.aspx
Tags: fedora, Linux, ubuntu, Windows














October 3rd, 2009 at 4:07 pm
WOW… what a great article which i was needing help of.. i have a small query that the above tutorial will work if 7 is installed in logical partition instead of primary partition & ubuntu being the first primary partition ???????
October 5th, 2009 at 8:48 am
Pratheek, thanks for the kind words, glad you enjoyed it. In answer to your question, yes, it should still work so long as the machine is using the Win 7 bootloader to boot. Again, just make sure to install the GRUB bootloader in the same partition you’re installing the associated linux distro on.
October 23rd, 2009 at 9:52 pm
Nice article,
helped me through a rough time ;)
You can use Ubuntu Live-CD instead of GParted for the command to copy the data to os-share. if you failed to install a fat32 partition for sharing data with win a ubuntu live-cd can help if you got a usb device. Connect and the ubuntu from live cd will automatically mount it to /media/YOURDEVICENAME
But Again, GREAT Work 1000x thx
October 24th, 2009 at 7:18 pm
Thanks GlorteX. Good advice. You’re absolutely right, you certainly can use the Ubuntu Live CD (or any Live CD for that matter…). I chose the Gparted disk because it boots to a useful environment much faster than the Ubuntu Live CD.
October 26th, 2009 at 10:39 pm
hey, thanks much for the post. This allowed me to:
- wipe a thinkpad, install Win XP from the factory partition
- install Windows 7
- install Ubuntu
- set up all to boot from the Windows 7 bootloader
… all in the same afternoon/evening.
Not like the old days….
October 27th, 2009 at 11:06 am
Excellent! Thanks Raul. Glad it helped. You’re right about it not being like the old days :(
December 31st, 2009 at 4:55 pm
I’ve installed linux on a 2nd physical drvie and followed the above steps. When I selected Linux, it never booted into linux. I had a blank screen, with a flashing underscore at the upper left corner of my screen. I would have thought the steps above should work regardless. BTW, I didn’t create a FAT32, I used the ubuntu Live CD and used the ‘dd’ command to copy the 512 bytes into a file.
January 1st, 2010 at 12:29 pm
ted, I agree. Although I haven’t tried the steps above when Linux was installed on another physical drive, the steps should work regardless.
I would first make sure that Windows recognizes your Linux disk as a valid drive in Disk Manager and also make sure that you’ve given BCD the correct drive letter in the following command:
bcdedit /set {ID} device partition=n:Where n is the correct drive letter.
However, in your case, the blinking cursor suggests to me that the GRUB bootloader is missing (or is not in the correct location), so make sure you’ve installed GRUB on the Linux disk correctly. You should be able to verify that it has been by trying to boot to your Linux disk directly when the machine starts.
Skipping the Fat32 partition is perfectly acceptable. I included that step simply because I find it useful for sharing files between OSs. Using the Ubuntu live CD to issue the dd command is also fine – in fact, you could use any valid Linux or Unix live CD. I recommended using the gparted disk in the instructions because I find it boots faster that most live CDs.
Good luck, and let me know how you make out.
January 1st, 2010 at 2:27 pm
Update – I forgot to mention I was using Fedora 12 instead of Fedora 11. Installed bootloader in the 1st partition and verified the boot sector ftype was ext3 instead of ext4. Copied 1st 512 into a file and placed file in c:\ directory (under windows of course). It may be there is a slight compatibility/bug/whatever issue with Fedora 12 and my H/W (which I fine a little odd since my laptop is not that old). It’s a Dell M6400, 4G RAM, and a 320G HD.
Anyway, finally gave up and installed CentOS 5.4 (RedHat in all but name). Worked beautifully! No problems. Followed steps as before and everything fell into place. Not quite sure why it didn’t work with Fedora 12, but after spending a couple of long nights trying to determine what was wrong, I’m happy just to get it to work with CentOS!
BTW, your writeup was spot on (despite my fickled Fedora 12). Thanks
January 2nd, 2010 at 10:51 am
Ah, gotcha. Well, I’m glad you got it working with CentOS. Still though, I wonder why Fedora 12 isn’t working for you. Time permitting I’ll try installing it here and see if I can duplicate the problem.
Best of luck ted, and thanks for the update.
January 2nd, 2010 at 5:25 pm
One other thing I still forgot to mention. The generated grub.conf had the HD designations backwards. Windows 7 is on hd0. grub.conf, for whatever reason, labeled it hd1 and fedora 12 as hd0 (huh? Iget that at all). I made a copy of grub.conf and edited to to correct the HD designations. Still didn’t work. Now I did forget to change the HD designation for the splash.img.gz(?) file. This may be why it didn’t work.
Anyway, CentOS generated a correct version of grub.conf. So there was no reason to go back to Fedora 12. I would have prefered Fedora 12, but not to the point where I would have messed up my Windows 7 installation.
Hopefully, I’ve haven’t overstayed my welcome, but I felt I should let others know what may happen using Fedora 12.
January 3rd, 2010 at 10:53 am
ted, you’re not overstaying at all. The updates are very much appreciated.
March 20th, 2010 at 10:24 pm
I’m a but confused here. I thought BCD could act as a replacement for Grub, which is Linux’s boot loader. Can’t BCD boot a linux distro directly, by doing something like this grub command?
title Linux-2.6.7
root (hd0,1)
kernel /boot/vmlinuz-2.6.7 root=/dev/hda2 vga=791 ro
Thanks
March 21st, 2010 at 1:11 pm
Hi. I Try variant with Win7 & Ubuntu. After i select item on winloader menu – i see this:
GRUB_
Can’t type anything…only CtrlAltDel… what can i do?
Thanks…
March 21st, 2010 at 2:38 pm
I updated many of the steps in this post today to address changes in recent versions of GParted, Fedora and Ubuntu.
March 21st, 2010 at 2:49 pm
patyr, thanks for your comment. I assume you used Ubuntu v9.10 (Karmic)? If so, I suspect you may have placed Ubuntu’s bootloader on the wrong partition. The steps I originally described in the post assumed GRUB. However, beginning with Karmic, Ubuntu uses GRUB 2 as its bootloader and the steps necessary to place the GRUB 2 on the correct partition are different. I’ve since updated the post so you might try going back over the steps again.
March 21st, 2010 at 3:11 pm
Mogplus8, thanks for your comment. Absolutely, there’s no particular reason why you need to use the GRUB menu or chainload Windows 7 in GRUB. I set it up the way I described because I rather like seeing the GRUB menu after selecting “Linux” from the Windows bootloader. It gives me the opportunity to return back to Windows, or to boot to an older kernel version if desired. The choice is yours though. Note: I have not tested your GRUB configuration suggestion so I can’t comment on whether a distribution(s) will boot with it or not.
March 23rd, 2010 at 2:25 am
iceflatiline,
I have the same result as patyr, in which I get the GRUB_ after selecting the Ubuntu option and I can only do Ctrl+Alt+Del…
The only difference is that I installed Windows 7 on one hard drive and Ubuntu 9.10 on a different hard drive. I most likely chose the wrong partition. Instead of removing and reinstalling Ubuntu, is there a way to edit the linux.bin file to point to the right partition and then repeat the steps to copy the linux.bin file? if not, I assume I could reinstall Ubuntu, choose the correct partition and then just skip to the copying of the linux.bin file??
Thanks!
March 23rd, 2010 at 8:49 am
GylWind, no way to edit the *.bin file that I’m aware of.
March 23rd, 2010 at 10:47 am
Thanks for the quick response. I will reinstall and hopefully pick the right partition. The last time, I clicked the down-arrow and was given list, such as /dev/sdb, /dev/sdb1, /dev/sdb6 along with the Windows partitions. I chose /dev/sdb1. Should I have picked /dev/sdb? or do I need to type it in as (hd1,0), for example?
March 23rd, 2010 at 2:20 pm
Ugh! Unfortunately, I have not been able to get Windows 7 Enterprise and Ubuntu 9.10 to dual boot successfully. I either get GRUB with a blinking cursor when I select UBUNTU or I just get a blinking cursor. I have tried using the drop-down selection to choose the boot area (/dev/sdb and /dev/sdb1) to no avail as well as typing (hd1) or (hd1,1).
Windows is on its own hard drive (160GB) and I’m installing UBUNTU to a 60GB hard drive. GParted sees Windows drive as /dev/hda1 and UBUNTU as /dev/hdb1 (ext4), /dev/hdb2 (extended), /dev/hdb5 (swap) and /dev/hdb6 (fat32).
Any help for you or anyone here will be much appreciated.
Thanks,
GylWind
March 23rd, 2010 at 6:07 pm
Ok – I gave up! I removed both IDE drives and used a SATA drive. I installed Windows 7 Enterprise and then created partitions for Ubuntu and followed the directions above. IT WORKED! So, the lesson I’m learning is that Windows and Ubuntu must have partitions on the same hard drive for this to work. Using separate hard drives for each OS doesn’t seem to work. If someone knows or figures out something I couldn’t – let me know :-D
Thanks!
GylWind
March 24th, 2010 at 7:09 am
Gylwind, thank you for your comments and sorry for belated reply, work really has me buried right now.
I set up a similar scenario (sda=Win 7, sdb=Linux) on my test rig last night and ran into similar difficulties. I suspect we’ll need to trick the windows bootloader into recognizing the boot sector on the second drive somehow, but the necessary BCDedit commands escape me right now. I’ll continue to work on this and post a solution when/if I find one.
mea culpa for the frustration…
March 27th, 2010 at 2:35 pm
Hi iceflatline, really nice site and article. It’s great to see someone take such effort and care when making something like this as I have read many a forum, where the replies are one liners but assume that you understand what they mean.
I have Win 7 x64 installed to sda (installed first), ubuntu 9.10 x64 installed to sdb and a few more drives which I will connect later but for now, I get the same issue where once ubuntu is selected, I immediately go to a blank black screen with the flashing cursor. I have tried 3 rebuilds so far of the ubuntu system, changing the boot and using EasyBCD in windows but haven’t been able to get around it. Online searches seem to have the same issue when win is first and ubuntu is second and using the windows bootloader. I suppose the only way to get around it is to change the order. Ubuntu first then windows.
March 28th, 2010 at 11:08 am
Hi frank, thanks for the kind words.
If the two operating systems are on the same physical disk (separate partitions) then the steps defined in the article should do the trick for you regardless of whether the small windows boot partition is the first partition or not. However, when the two operating systems are on separate physical media, I have not been able to (yet) successfully coax Windows into recognizing the GRUB bootloader residing on the other disk using BCDEdit.
What I suspect may work, although I haven’t tried it, is to install Ubuntu on, say, disk a, and Windows on disk b, then use the GRUB bootloader on disk a to chainload Windows from disk b. You’d likely have to edit GRUB’s config file manually though as I doubt Ubuntu would recognize the existence of Windows located on disk b at install.
Just some thoughts… let me know how you make out.
March 29th, 2010 at 10:42 am
I installed Ubuntu 9.10 next to Windows 7 64 bit Home Premium using your detailed guide.
Let me make 2 remarks:
1) During the installation at step 7/7 -> “Advanced” -> “Device for bootloader installation”, when it comes to replacing “(hd0)” with “(hd0,3)”, I used the dropdown list in that dialog instead of typing “(hd0,3)”.
The dropdown list offered “/dev/sda”, “/dev/sda1″, “/dev/sda2″ and “/dev/sda3″, so I chose “/dev/sda3″
This also worked, so I assume it doesn’t matter whether you specify the grub2 or the linux name of the partition.
2) After the installation and the steps involving bcdedit and copying the bootsector of sda3 to c:\ I booted into Ubuntu and updated the system. After another reboot, selecting “Linux” in the Windows boot menu just displayed
GRUB_
and didn’t boot Ubuntu.
It turned out, the Ubuntu updates included an update of grub2, which changed the boot sector in /dev/sda3, but of course did not change the copy in c:\linux.bin
I had to repeat the steps that describe copying the bootsector to c:\
After that, Linux booted again.
March 29th, 2010 at 2:04 pm
Hi Iceflatline,
Well, I have since gone through and re-installed everything, starting with ubuntu on sda and then windows 7 on sdb. During the installation of Windows 7, I had issues with windows saying that it couldn’t find a valid installation location or partition. I bounced back and forth between Live sessions, GParted and the Windows installation process but kept having the same issue. I then disconnected sda (read in a few forums that installing that way would get around it) and installed fine. Now, I can’t get Ubuntu to take over the boot process (although, I have played around with GParted trying to make the partition not bootable) but it hasn’t seemed to change anything. It looks like for now, unless I give up on having the dual boot on separate HDD’s, it just can’t be done (at least for the time being).
A curious question, which could be a part of the reason I am having such a challenge with this is in the other disk management software, I think it’s Dalimpsest, it says something like isw_raid_member. I have searched for some reference to this but there doesn’t seem to be much in the way of suggestions on how to resolve this. I did remove some reference to raid on sda when I originally installed ubuntu on it. I have been chopping and changing the sequence of the HDD’s. Some reference mdmraid commands but the one I used was different. Anyway, I might just spend another day trying to figure it out, then work on the 1 HDD option.
March 30th, 2010 at 8:55 am
frank, thanks for the update. You’ve definitely been busy!
You might look into using GRUB’s map command. While I’ve not had the occasion to use it, but it purportedly allows one to chainload Windows (or another OS) from a second disk by essentially performing a virtual swap between your first and second hard drive. You can learn more about using it from the Super Grub Disk Wiki
March 30th, 2010 at 8:58 am
Thanks for the feedback iceflatline. Can you help me with another question? I’d like to install Kubuntu in my Linux partition, but I don’t want to clobber Win7 or BCD. If I just install Kubuntu and then skip the Grub install bit will that do it, or will Kubuntu still overwrite the MBR? If I can install Kubuntu can I set BCD up to boot into Win7 or Kubuntu? I used EasyBCD last time, but that seems to have hidden everything in a binary file so I can’t tell what’s going on.
All help greatly appreciated.
Cheers,
Ian
March 30th, 2010 at 9:19 am
tscharlii, thanks much for the great info and bringing this to everyone’s attention.
Regarding your first comment, yes, I noticed this change recently myself. This was a much needed update to Ubuntu’s installer in my opinion as the previous method made it too easy for users to unintentionally overwrite the disk MBR. I’ll update the article soon to make reference to the drop down list.
Regarding your second comment, that situation is interesting indeed. I’ve not experienced any post installation updates causing subsequent boot problems. I’ll test this and if need be update the article.
Thanks again…
March 30th, 2010 at 9:43 am
Mogplus8,
I don’t recall if Ubuntu/Kubuntu LiveCD actually gives you the option to not install GRUB. So, if you don’t select an alternate partition, then yes, it will install itself to the MBR. You might want to check out and try Ubuntu’s text-based installer, which, if I recall correctly, will give you greater control over the install, including whether or not to install GRUB. An important thing to remember though is that, whether it’s Kubuntu, Ubuntu or another distribution, it will need a bootloader. If I understand your series of comments correctly, it’s the GRUB menu you find objectionable. If that’s the case, you may want to consider simply hiding it. So long as GRUB is set to boot Kubuntu by default, then you should go right to it when you select it from the Windows bootloader screen.
May 3rd, 2010 at 12:45 pm
Hello,
I am experiencing exactly the same problem as Ted when I want to install Ubuntu 10.04 on a second disc, with a Win7 dual boot.
I did not want to change anything on my 1st disc with Win7 installed in factory, as I suspect my PC is tatooed. So I created a partition for Ubuntu on my second disk (/sdb2), installed Ubuntu onto it with the bootsector on /sdb2.
I then copied it (with dd if=/sdb2 of=… bs=512 count=1) to a file that I placed on my C:, and used the same bcdedit commands to create the entry for bootmgr.
What I got:
1. I did not harm my Win7 boot, it still works :-)
2. but my Linux boot won’t work, black screen with some cryptic characters when I launch it.
I did not understood if ted could solve his problem with the Ubuntu distro… I do not know what to do now, I have a lot of unanswered questions…
is this due to Ubuntu being installed onto a different disc from Win7 ?
I noticed an “osdevice” option together with “device” in bcdedit, should I use it ?
Where is the bug ? Chaining incorrect from bootmgr to Grub, from Grub phase 1 to phase 2 ?
Any help is greaty appreciated… Thanx !!
Gilles
May 5th, 2010 at 10:40 am
Hi and thanks for allowing comments without the need to register; that’s ballsy. I have the same setup as Gillies, and up until where he says “What I got:”, I did everything the same as him.
What I get, when I boot up and choose Ubuntu is “BOOTMGR is missing. Press Ctrl+Atl+Del to Restart”
I opened the linux.bin file in notepad and can see that my error is one that is list in there but the rest of the info in there is encrypted (or not meant to be read in notepad). Any help here is also appreciated.
Thanks for this thorough guide by the way.
May 7th, 2010 at 2:04 pm
Sorry for my blatant ignorance, I am just now noticing that it has already been stated this guide will not work if each OS is installed on separate physical disks. Shyte! would have been nice. Thanks nonetheless.
May 9th, 2010 at 4:12 pm
Jeremy, thanks for your comments. Yes, the intent of this article was to describe how to dual boot off the same hard drive. I hope to find the time soon to determine how to achieve the same thing using two separate hard drives.
May 26th, 2010 at 1:18 pm
[...] grub? If you want to use the Windows 7 bootloader you got to use BCDEdit. Check the tutorial here. You can also have a look at the latest beta version of EasyBCD which supports Grub2. You will [...]
June 6th, 2010 at 7:02 am
I have the same problem with this. I install Ubuntu on second HDD and this with bcdedit dont work with me. How to resolve this?
June 8th, 2010 at 7:44 pm
Before this thread dies I was surprised none have mentioned the start up manager left idling in your repository, a GUI interface to swap O/S or kernel and mess about with the splash screen, time out etc
https://help.ubuntu.com/community/StartUpManager
Another solution would be to avoid all these various conflicts altogether!! simply buy a switch that front panels a 4 way dial and physically swap drives. one drive alive at a time. keep them all totally independent and avoid all the potential software headaches.
http://www.usbgear.com/SATA-Switch.html
I am sure you could source an UK supplier. I am definitely going down this road!! Hope this helps others
DIK
June 9th, 2010 at 9:11 am
Dulwichdik, thanks for the tips!
June 11th, 2010 at 12:50 am
I am having the same problem as Ted and Gilles here is my setup:
Ubuntu 10.04 – Disk 0 (IDE drive)
Windows 7- C: -Disk 1 (SATA drive)
I set the Linux partition’s device to C: and the path to \linux.bin like the guide says.
If only there was a way for windows to recognize Linux as D: or something and then I could specify it. But it goes unnamed in the disk manager(i can still see it but its labeled Disk 0). It seems the problem could be the linux.bin has to be found on the same drive as the linux partition. Is there any way to point to the linux.bin stored on the linux drive maybe?
Please keep looking into a solution.
Is it possible the 512 byte dump went wrong? when I open the linux.bin in a text file I see a lot of gibberish and then
“Remove disks or other media.ÿ
Disk errorÿ
Press any key to restart
¬ËØ Uª”
If you need any more information let me know.
Thanks,
Syrn
June 11th, 2010 at 2:35 am
update: I rules out the possibility that it was a bad dump, i redid the process with the livecd and I dont get any signs of error when opened up with notepad anymore. The same thing happens, the dreaded blinking cursor.
Thinking back to what I said earlier about the linux.bin having to be on the linux partition was definitely wrong. For example, my dad dual boots windows xp and windows 7 each on different drives… so what i said earlier doesn’t make sense. Now I’m really perplexed. What could be halting the boot? And most importantly how can I fix it?
Thanks,
Syrn
June 11th, 2010 at 9:44 am
Syrn, thanks for your questions and comments.
To clarify, the scope of the article is really to describe how to dual boot between two OS residing on the same hard drive using the Win 7/Vista BCD store. I use this configuration often for laptops where I typically only have one drive.
As I mentioned in an earlier comment, I hope to find the time soon to determine how to achieve the same thing using two separate hard drives, assuming BCD will even support that configuration.
In the mean time, a few options for you:
You could use GRUB or GRUB2 as your bootloader. GRUB2 in particular appears now to do a pretty good job of discovering Windows partitions and drives on its own;
You could use a third-party Windows solution like EasyBCD;
Or you could simply select which drive you want through your systems BIOS.
Hope this helps.
June 11th, 2010 at 12:32 pm
Thanks for the great information. The latest EasyBCD build did the trick and I would highly recommend this program as a solution for people running two separate hard drives. The only issue is you must sign up to the forums to download the latest build. It seems they have custom .bin files that solve the issues I was facing.
The following quote helped me get started:
“Use EasyBCD 2.0 latest build (not 1.7) in W7 to add a Linux entry to the BCD. Select the correct grub (2 or legacy depending on the distro you use), and in the latter case tick the “grub isn’t …” box only if Linux is on a different drive to W7.” -Terry60
It did quite annoy me that I had to sign up to get the latest beta build so I have uploaded EasyBCD 2.0 Beta – Build 100.
To the users above having problems with EasyBCD, have you tried the latest build?
June 11th, 2010 at 2:10 pm
Thanks a lot for sharing this information, I do not know about anyone else, but I can totally make use of it.
June 13th, 2010 at 9:39 am
You’re welcome Robyn. Thanks for your kind comment.
June 17th, 2010 at 2:21 pm
Thanks, man.
I don’t know why, but i like the Windows Bootmanager more.
Ans my wife only uses Windows, so it’s easier this way.
Congratulations for your perfect job.
June 18th, 2010 at 2:51 pm
Twinsen, thanks for your comments.
July 7th, 2010 at 9:11 am
Hi man, this is really good,very useful guide, thanks, it enabled me to install windows 7/ubuntu/Centos multi-boot using windows bootloader,thanks again, u should make it as a sticky topic in all linux forums btw, did u try that ? i think guys at fedoraforum.org will love that.
July 7th, 2010 at 9:50 pm
mnassar, thanks much for your comment. Glad to hear it worked well with Centos. Also, thanks for your suggestion regarding a forum sticky topic. I had given some consideration to sharing this post with some forums, but ultimately decided against it. I’ve already updated the post several times to reflect changes in the way Ubuntu and Fedora installers work, and I anticipate updates will be needed in the future. I don’t relish the idea of trying to maintain a forum sticky or two, as well as the post, in order to keep their content aligned.
Anyway, cheers. And thanks again for your comments.
July 13th, 2010 at 2:05 pm
I had a question regarding the partitioning of the Hard drive. I know there can only be 4 primary partitions on the disk. My laptop came with an 8 gig “Recovery” primary partition as the first partition. So the 100Mb Boot is the second, and the third is Win7. Can I make the remaining partition an extended partition, and split it up into 3 for the OS (Ubuntu), swap and share partitions? Will this work or is there a better way to work around this?
Thanks!
July 14th, 2010 at 10:15 am
Mike, thanks for your question. Yes you can. As a matter of fact, that’s essentially the same partition layout I have on the Lenovo laptop I’m using to type this response.
July 14th, 2010 at 4:40 pm
I was able to install Ubuntu and get my laptop to dual boot. Thanks! Now for a little problem when I’m in Ubuntu. It looks like the right 1/10 of my screen is cut off and not displaying correctly(I was barely able to restart/shutdown as I could only see about two characters on the menu). I tried to change resolutions, yet it still cut off the right portion. I think I need to install a new driver for my laptop as I don’t have the buttons to change how the input is received like on a normal monitor. Can you point me in the right direction or a utility that can help me out with this.
Thanks again for all your help!
July 15th, 2010 at 12:29 pm
Mike, I’m afraid I can’t be of too much help. A quick Google search did not seem to reveal any systemic problems, so I suspect this a problem with the native drivers in your system not detecting your display resolution or refresh rate correctly. You might try playing with those two aspects a bit to see if you can correct the problem. You might also want to consider posting your question to the Ubuntu forums or LinuxQuestions. Good luck and post again when you find the solution.
July 18th, 2010 at 7:39 pm
I did a search in the Unubtu forum link you posted and searched for my vid card in the appropriate forum and found my answer.
http://ubuntuforums.org/showthread.php?t=1470822&highlight=nvidia+geforce+gt+330M
Took a little bit for me work it through because it has been so long since I’ve used Linux and my hand wasn’t being help through this process but I was able to get it to work.
Thanks for all your help!
Mike
July 19th, 2010 at 8:33 am
Awesome Mike! Glad you got it working. Enjoy your dual boot setup!
August 10th, 2010 at 10:27 am
Don’t usually leave comments on blogs but this is an excellent article. Had been struggling with F13 and Windows 7 so thanks for the tutorial, have got it working, thanks
August 10th, 2010 at 10:57 am
Actually I had a small problem, was installing F13, booting from GRUB into Windows 7 (should return to windows boot screen) gave me the infamous BOOTMGR not found error. However, I’d done a clean install of Windows 7 and the boot partition was on the same partition as the install. So I needed to change the menu.lst in /boot/grub to reflect where the Windows 7 bootmgr was.
Hope this helps anyone else who has this issue -> solution of above is here:http://forums.freebsd.org/showthread.php?t=5113
August 10th, 2010 at 11:56 am
Michael, thanks for your kind comment and advice, both very much appreciated.
August 23rd, 2010 at 1:35 pm
Thanks a lot, iceflatline. The guide is great.
I would like to share some experience as well. It seems like some critical updates of an installed Ubuntu 10.04 may affect its GRUB boot sector. It makes the “C:\linux.bin” file a kind of out-of-sync. Well I’m not sure that I get things right so I simply tell
I downloaded and installed updates through the Update Manager (Now I can’t tell which updates there were), Ubuntu prompted me to reboot. Windows boot manager showed both the windows and the ubuntu options, but choosing Ubuntu lead to a black screen – grub menu didn’t show up.
1. I booted from a liveusb and “wrote the first 512 bytes of our Linux boot partition to a file” again.
2. Then I put the new file in the C:\ and compared it with the old one (Windows shell: C:\>comp linux.bin linux2.bin /a). They were different.
3. So I removed the old file and renamed the new one to “linux.bin” thus there would be no need to update the BCD entry.
4. Rebooted.
These measures fixed the black screen problem and Ubuntu got up and running again.
August 24th, 2010 at 9:51 am
alexander, thanks so much for sharing this. Your experience made me smile… I encountered the same issue and fixed it the same way you did! Something in that particular update changed the boot sector enough to render the image we created useless. Creating a new boot sector image using dd was the only way out of the mess. Ain’t Linux great!?
Thanks again for sharing your solution. I’m sure it will be of help to others.
September 2nd, 2010 at 6:01 pm
Thanks for this article.
I’ve been struggling to install Ubuntu 10 on a machine with FakeRAID 1 running Windows 7. Although the Ubuntu 10 installer recognised the RAID setup, it wouldn’t let me reformat the partition (the harddisks had already been partitioned by the vendor). I followed a suggestion I saw on an Ubuntu forum and installed Ubuntu 9, and then Ubuntu 10 without reformatting the Linux partition, and that seemed to work…
… Except that Grub wasn’t working. I tried to install it in different places, but it never seemed to make any difference whatsoever — the machine booted happily into Windows as if Grub didn’t exist.
I was therefore hopeful when I found this, but alas it didn’t work. I didn’t get any error messages, but just as others have described in comments above, I just get a blank screen with a blinking cursor when I select Linux.
I’m wondering whether Grub didn’t get written correctly to the Linux partition, either.
Is there a non-Grub way to boot Linux, I wonder?
September 2nd, 2010 at 6:48 pm
[...] then found a blog posting describing how to use Windows 7′s boot loader, BCDedit, to boot Linux. It looked promising, [...]
September 3rd, 2010 at 7:24 pm
I solve the problem by using EasyBCD instead of BCDedit.
September 3rd, 2010 at 8:13 pm
Thomas, thank you for posting. Next time you might try Gparted rather than Ubuntu’s partitioner. It features support for hardware RAID, motherboard BIOS RAID, and Linux software RAID. Once partitioned correctly, the remaining steps should work correctly. Anyway, glad you were able find a solution that worked for you :)
October 2nd, 2010 at 12:11 pm
Hello, Iceflatline,
Your tutorial has been very helpful. Thank you for the detailed instructions. However, I must be doing something wrong. I have updated GRUB2 and downloaded all the updates I can (booting 10.04 from the live CD), and moving the (hopefully updated) linux.bin to C:\.
Here’s what’s now happening: Ubuntu won’t boot, and I have three (3!) “Linux” buttons on the Windows Boot Manager screen when I attempt to boot. The consistent error message is: “This is not a bootable disk. Please insert a bootable floppy and press any key to try again . . .”
So I need to delete the three inoperable “Linux” links in the “Windows Boot Manager” screen, and start over somewhere.
I will appreciate any help you can offer. Thanks, Iceflatline.
Boris
October 3rd, 2010 at 12:58 pm
Boris, thanks for your comment and sorry you’re running into problems. My sense is that your linux.bin file does not contain the GRUB2 boot sector. This could be because a) you installed GRUB2 on a partition different from the partition your Ubuntu OS is installed on, or b) you’ve incorrectly copied the sector containing GRUB2 to linux.bin when using the dd command.
As you’ve suggested, I would start by deleting the existing Linux BCD store entries. Run back through the install steps again, making sure that in the partitioning step, you’ve correctly selected the “/” mount point for the partition you want to install the Ubuntu OS on. Then, make sure you select this same partition when it comes time to install the GRUB2 bootloader. Finally, make sure you’ve passed the correct partition to the dd command (if=). Again, this should be the same partition. I’ve caught myself several times entering the wrong partition when entering this command.
Hope this helps and good luck!
October 28th, 2010 at 11:10 pm
hi,
i am new member
May 19th, 2011 at 1:15 pm
Good instructions Iceflatline, very useful, I have been using these with XP but never with w7.
But here is another challenge : what should be done to install w7, Ubuntu 11 AND backtrack 5 (ubuntu Lucid with GRUB2)
I used easyBCD to create and set up menu options in the windows boot screen (i chose the names “Ubuntu 11″ and “backtrack 5″), when I click any of them, the command takes me to the same OS : Ubuntu 11 !!!
Please somebody have any idea ????
May 20th, 2011 at 12:26 pm
Orlando, thanks for the question. I’m afraid I don’t have much experience with easyBCD, but perhaps others have. You may also want to post your question in the NeoSmart forums, if you haven’t already.
May 22nd, 2011 at 7:36 pm
This is how i got slackware 13.37 64 bit dual booting with win7 64 bit installed first. Using lilo instead of Grub.
http://www.linuxquestions.org/questions/slackware-14/dual-booting-win7-starter-slackware-13-1-a-845373/page2.html#post4364003
May 24th, 2011 at 1:17 pm
iceflatline, what I meant was, somebody have some idea how to use your instructions to edit BCD in w7 to allow to boot ubuntu 11 & backtrack 5 (both w/grub2) ??? When I type “bcdedit /create …” the system create the same ID . Maybe I have been done something bad
May 25th, 2011 at 9:27 am
Orlando, make sure in the step utilizing the dd command that you copy the correct partitions and that each is a uniquely named .bin file (they cannot both be named “linux.bin” for example). In the next step make sure you use the /d parameter and that it follows the /create parameter in the bcdedit command. Here again you must use a unique entry name for each case (they cannot both be “Linux”).
May 25th, 2011 at 2:01 pm
Man you have made this complex topic very simple with nice layouts and real life examples.
Thanks for teaching this @ free of cost.
Also thanks to all those who have asked their questions via comments, it helped to clear few doubts.
Appreciate all of you. ;-] Bye
May 25th, 2011 at 3:24 pm
Ratnakar, thanks for your kind words. I too appreciate all the comments and feedback on this post.
June 7th, 2011 at 5:29 pm
[...] for multiboot. However, Windows 7 bootloader supports also supports multi-booting fine, check out this tutorial if you want to retain Windows 7 bootloader: There is no me. I do not exist. There used to be a [...]
August 14th, 2011 at 3:42 pm
[...] update your Windows bootloader. So you need to do some manual work to make it happen.There is a thorough article explaining this and you can just jump to end of the article to find the proceadure. ← [...]
November 5th, 2011 at 12:05 pm
I have found a solution to start Linux by the Windows 7 boot manager if Windows and Linux are on different hard disks. You can use bcdedit to build an entry in the windows 7 boot manager. In this entry you have to call GRUB4DOS instead of GRUB within linux.bin
GRB4DOS is a powerfull package but you only need two programs of it – grldr and grldr.mbr
You may download the package from
http://sourceforge.net/projects/grub4dos/
From this package copy grldr and grldr.mbr to the Windows root directory, usually C.
Now, use bcdedit for the entry in the windows 7 boot manager:
First backup:
bcdedit /export c:\bcdbackup
Then create {id}:
bcdedit /create /d “Linux” /application bootsector
The result will look like this:
The entry {05d33150-3fde-11dc-a457-00021cf82fb0} was successfully created.
The long string {05d33150-3fde-11dc-a457-00021cf82fb0} is the id for this
entry.
Then, use the following commands to set boot parameters:
bcdedit /set {id} device partition=C:
bcdedit /set {id} path \grldr.mbr
bcdedit /displayorder {id} /addlast
Please replace {id} with the actual id returned from the previous command.
At last check the bcd file:
bcdedit -v
Now, you need the appropriate menu.lst.
For a first trial you may use the menu.lst from the GRUB4DOS package. Copy it to the the Windows root directory, usually C.
Reboot your system.
The appropriate menu.lst could look like this:
# menu.lst for grldr of GRUB4DOS
# copy it to c:
color blue/green yellow/red white/magenta white/magenta
timeout 8
default /default
title Linux
root (hd1,0)
kernel /boot/vmlinuz root=/dev/……………..
initrd /boot/initrd
title windows 7
find –set-root /bootmgr
chainloader /bootmgr
title Reboot
reboot
Take your Linux menu.lst and edit it under Linux. Then copy it to the Windows C-Partition.
Now it should work.
November 6th, 2011 at 10:37 am
Rudi.RG, this is awesome! I’ve been meaning to come up with a solution to this challenge for awhile now but never seem to get around to it. Thanks so much for your efforts on this and for posting it!
November 11th, 2011 at 11:45 am
Rudi.RG, thank you for this. I’ve followed through but seem to have come unstuck at the Grub4dos menu.1st. When I boot and select my Unbutu option I get a Grub4dos menu asking me to select one of various find and boot options none of which include Linux. I just don’t know where to go from here. Grateful for any help. My Windows 7 Boot is on my first hdd with no other partition on the drive apart from system reserved and my Unbutu is on my second drive on partition 2.
November 12th, 2011 at 10:11 am
As a follow up if you’re following Rudi RG steps I found the following worked for my system
title Linux
root (hd1,1)
kernel /boot/vmlinuz-3.0.0-12-generic root=/dev/sdb2 this equates to hd1,1
initrd /boot/initrd.img-3.0.0-12-generic
I edited one of the menu.lst items in the text editor in the ubuntu live usb which I’d downloaded.
November 13th, 2011 at 10:31 am
Thomas, awesome. Thanks for your comment.
December 18th, 2011 at 6:08 am
i was running xp and arch linux. But when install windows 7 in other drive then it windows 7 start automatically. Please give me a way to start xp and windows 7.
December 18th, 2011 at 10:22 am
pankaj, I’ll try to help, but I’m not sure I fully understand your problem. Could you provide a little more detail?
January 1st, 2012 at 2:33 pm
[...] that allows *both* Grub2 and the Win7 bootloader to *coexist* (each on a different partition): http://www.iceflatline.com/2009/09/h…using-bcdedit/ [...]
January 9th, 2012 at 11:50 pm
@iceflatline
Hi,
thank you so much for this article, it helped me a lot !
I just have one question though, I hope you will be able to help me.
Your article has been quoted as a source in a wiki page for Archlinux :
https://wiki.archlinux.org/index.php/Windows_and_Arch_Dual_Boot#Using_Windows_7_Boot-Loader
On this page the author writes :
“Some documents state that the partition being loaded by the Win boot-loader must be a primary partition but I have used this without problem on an extended partition. ”
So he is saying that it is perfectly possible to get a dual-boot such as the one described in your article when Linux is installed on a logical partition.
However, in my case it simply doesn’t work. When Linux is installed on a primary partition everything works fine, but when Linux is installed on a logical partition Windows bootloader (BOOTMGR) is unable to chainload to Grub2, it can load Windows 7 but not Linux (the system just restarts as if BOOTMGR didn’t see where Grub2 was).
If you have any experience in such a setup (Windows on a primary partition and Linux/Grub2 on a logical partition) and you could give me some advice to help me find out what I’ve done wrong, I would greatly appreciate it.
If you need any further detail I will gladly provide them.
Thanks in advance !
(sorry if there are any mistakes, English is not my native language.)
January 10th, 2012 at 8:43 am
blob, Window’s bootloader absolutely will boot Linux installed on a logical partition. In fact I’m writing this response using CrunchBang Linux installed on logical device /dev/sda5, which was booted using Windows – the same way described in the post.
I’ve booted many Linux distros this way, and the only way I’ve seen that it doesn’t work is if GRUB is not installed correctly (or at all) on the logical partition containing the distro, or the boot sector of this logical partition was not copied correctly to a *.bin file.
January 17th, 2012 at 11:10 am
@blob: I boot off an extended partition without any issues (had to install twice to make grub2 work, before i just got a blank screen)
@topic
Very nice.
I installed Mint 12 that way but grub2 refused to install in a partition. It has to be installed inside the mbr.
I found no instructions how to solve it, so here is my way – in case someone finds this page like I did.
Be careful not to kill your partition table. It should work with a blocksize of 444 which prevents you from overwriting the partition table but I did not test it and 512 will work too ;-)
backup the mbr:
dd if=/dev/sda of=/root/mbr_orig.bin bs=512 count=1
install whatever you want and install grub to /dev/sda
backup the new mbr
dd if=/dev/sda of=/root/linux.bin bs=512 count=1
(copy it to the windows parition or fat USB stick or somewhere)
write back the original mbr
dd if=/root/mbr_orig.bin of=/dev/sda bs=512 count=1
Windows boots as usual and you can work with bcdedit as written in thsi how-to.
January 17th, 2012 at 11:35 am
oh, an important note:
First prepare all partitions! Create all partitions you need before backup up the first time!
January 17th, 2012 at 12:21 pm
Daniel, thanks very much for your comments.
January 27th, 2012 at 3:32 pm
did exactly what you said but everytime i try to load linux from windows bootloader the PC reboots its self and goes to windows boot manager.
Basically it does a loop: win bootloader, select ubuntu, reboot pc, win bootloader. is there any way to solve this?
January 28th, 2012 at 12:15 pm
Kisun, I’m not sure. I’ve never encountered that particular problem before. It appears though that BCD may not be correctly pointed to GRUB. About the only thing I could suggest is to go back through the steps, ensuring that you’ve correctly installed GRUB on the partition containing Ubuntu, and that you’ve indeed pointed BCD to the correct partition.
January 30th, 2012 at 3:44 am
Thank you SO much for this. I was able to use this guide to have my X201 Tablet PC dual boot Ubuntu and Windows 7 without hurting my Rescue and Recovery capability on boot up!
January 30th, 2012 at 10:06 am
Leadpoizon, you’ve touched upon exactly the reason I wrote this post – my experiences with wiping out many a recovery partition. Thanks for your comment.
January 31st, 2012 at 1:20 pm
[...] instructions worked well for me: http://www.iceflatline.com/2009/09/h…using-bcdedit/ If you do an update that causes lilo to be run, you may need to grab the MBR off your partition [...]