Results 1 to 3 of 3

Thread: When Reinstalling Windows On A Dual Partition With Ubuntu

  1. #1
    Join Date
    Mar 2011
    Beans
    90
    Distro
    Ubuntu 12.04 Precise Pangolin

    When Reinstalling Windows On A Dual Partition With Ubuntu

    Given a dual partition of Ubuntu 12.04 and Windows 7 - both 64 bit operating systems and a working version of GRUB: I need to be reminded of what will happen upon reinstallation of Windows 7 on the Windows partition in terms of GRUB.

    Will GRUB be wiped?

    I am concerned about this. I know that GRUB is installed on SDA currently, and the only way I could get it to be installed on SDA was through the process of firstly installing 10.10 selecting SDA from the Bootloader drop down. For someone reason I could not select SDA when using 12.04;

    In summary:

    1- Will GRUB be wiped?
    2- If so, can I FORCE grub to be installed to SDA /boot no matter what?

  2. #2
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: When Reinstalling Windows On A Dual Partition With Ubuntu

    Yes, installing windows will install its bootloader on the MBR of the disk wiping grub2.

    But your ubuntu is still there and reinstalling grub2 to the MBR is very easy using the ubuntu cd in live mode.

    Basically, right now, before reinstalling windows, make sure to note down your / partition. You can see them mounted with:
    Code:
    df -h
    In the list that shows, lets assume your / is /dev/sda5.

    After windows is installed and grub2 is gone, all you need to do is boot with the same version of ubuntu cd into live mode, open terminal and run:
    Code:
    sudo mount /dev/sda5 /mnt
    sudo grub-install --root-directory=/mnt /dev/sda
    If your / is not /dev/sda5 (partition #5), just modify the first command and that's it. In the second command it stays '/dev/sda' without any number because that's the destination where you want grub2 installed which is the MBR of the disk.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  3. #3
    Join Date
    Mar 2011
    Beans
    90
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: When Reinstalling Windows On A Dual Partition With Ubuntu

    Quote Originally Posted by darkod View Post
    Yes, installing windows will install its bootloader on the MBR of the disk wiping grub2.

    But your ubuntu is still there and reinstalling grub2 to the MBR is very easy using the ubuntu cd in live mode.

    Basically, right now, before reinstalling windows, make sure to note down your / partition. You can see them mounted with:
    Code:
    df -h
    In the list that shows, lets assume your / is /dev/sda5.

    After windows is installed and grub2 is gone, all you need to do is boot with the same version of ubuntu cd into live mode, open terminal and run:
    Code:
    sudo mount /dev/sda5 /mnt
    sudo grub-install --root-directory=/mnt /dev/sda
    If your / is not /dev/sda5 (partition #5), just modify the first command and that's it. In the second command it stays '/dev/sda' without any number because that's the destination where you want grub2 installed which is the MBR of the disk.
    Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •