Ok so as many of you may know the Windows 8 developer preview was released today and as such I'm very eager to use it but I have both Ubuntu and Windows 7 installed on my machine. I don't want to disturb these drives and have recently set up a dedicated grub partition on /media/sdb8

My question is if I install windows 8 will it overwrite the grub partition and if so what are the steps I should take to recover it.


Windows 8 will not overwrite your boot partition (/media/sdb8) if you you specifically tell Windows not to do so during the installation process (hard disk setup where you select which partition to install C: drive on...). But Windows 8 will overwrite your MBR, as far as I know. So, once Windows 8 is installed, you will not be able to boot into Ubuntu; even though you will still be able to boot into Windows 7.

To fix this problem, you will need the same version of the Ubuntu LiveCD from which you had installed Ubuntu. Using the LiveCD, you can fix the MBR to show a boot screen to select Windows 8, 7 and Ubuntu. The detailed instructions can be found here: https://help.ubuntu.com/community/Grub2#Copy_LiveCD_Files.

I am listing them here for convenience.

  1. Boot the LiveCD Desktop.
  2. Open a terminal by selecting Applications, Accessories, Terminal from the menu bar.
  3. Determine the partition with the Ubuntu installation. The fdisk option "-l" is a lowercase "L". sudo fdisk -l or sudo blkid. The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently. Example: the MBR may be installed on /dev/sdb and the Ubuntu partition may be on /dev/sdb3.
  4. Mount the partition containing the Ubuntu installation: sudo mount /dev/sdXY /mnt. Example: sudo mount /dev/sdb3 /mnt. Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot. Since you have a separate boot partition (which contains grub - /media/sdb8 - you will need to run the following command as well: sudo mount /dev/sdb8 /mnt/boot. Note: If the user has a separate /home partition, this must be mounted to /mnt/home. Encrypted home partitions should work.
  5. Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device. If you are using 10.04 or 10.10, then run sudo grub-install --root-directory=/mnt /dev/sdX. Example: sudo grub-install --root-directory=/mnt /dev/sdb. If you are using 11.04 or 11.10, then run sudo grub-install --boot-directory=/mnt/boot /dev/sdX. Example: sudo grub-install --boot-directory=/mnt/boot/ /dev/sdb.
  6. Reboot into the Ubuntu installation on your hard disk.
  7. Refresh the GRUB 2 menu by typing the following command in your terminal: sudo update-grub.

NOTE: As answered by Steve, "Windows 8 uses the new Protogon file system". Grub does not have support for this file system (yet!). Once this support comes, you can use Grub to boot into the Windows 8 bootloader. Until that time, as suggested by jart, use a separate hard disk to hold the Windows 8 partition and it's bootloader. This way, even the Ubuntu hard disk MBR will not get over-written. Unplug the Ubuntu hard disk when you are installing to the Windows 8 hard disk. Once the installation is complete, plug the Ubuntu hard disk back in, boot into the Ubuntu hard disk (by setting it in the BIOS boot sequence) and follow the steps which I have outlined above.

| improve this answer | |

Watch out - Windows 8 uses the new Protogon file system and Grub can't find it.

This means that when you put grub back - you lose the ability to get into Windows 8

| improve this answer | |
  • I have the windows 8 consumer preview version on a different drive, and Grub2 can find it, but calls it "Windows recovery". If you select this, you a BSOD and it reboots. My solution for now: boot directly from your windows8 disk and all is fine. – Cojones Mar 9 '12 at 23:28

If money is not a problem, then buy a new hard drive and install windows 8 in that one. That way you will have ubuntu and windows 7 in one, and windows 8 in the other hard drive. You will have to boot windows 8 from the bios though, but you won't have to worry about messing up windows 7 or ubuntu. Before you install windows 8 remember to first unplug the hard drive containing windows 7 and ubuntu. One's you install windows 8 in the new drive re-plug the hard drive containing window 7 and ubuntu.

| improve this answer | |
  • +1 do you think it would be possible to use an external USB harddrive to install windows 8? – gideon Dec 20 '11 at 10:04

I'm guessing most people finding this question will find it AFTER having already b0rked their bootloader. I installed Windows 8 on a totally separate disk, and planned on re-installing grub after as usual after doing something hokey with Windows. Re-installing grub wasn't sufficient fix my boot menu, unfortunately.

So after fixing grub per ubuntu's instructions, I ran

apt-get install startupmanager

in terminal, ran the startupmanager application, and it found the appropriate menus. Closed it, rebooted, and everything worked.

Please note that using the shutdown option from the Windows 8 menu actual hibernates, so in order to boot back into Linux after hanging out in Windows 8 you'll need to use the restart option, or run the following command in terminal to fully shut it down.

shutdown /s /full / t 0 
| improve this answer | |

When you install Windows, Windows assumes it's the only OS on the machine—or at least it doesn't account for Linux. So, it replaces GRUB with its own bootloader.

What you have to do is to replace the Windows bootloader with GRUB. Simply chroot into your install and run update-grub.

Here's how: How can I repair grub? (How to get Ubuntu back after installing Windows?)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.