Windows 7 installation without harming current Linux/GRB2 setup


Results 1 to 3 of 3

Thread: Windows 7 installation without harming current Linux/GRB2 setup

  1. #1
    Join Date
    Feb 2004
    Location
    Japan
    Posts
    134

    Windows 7 installation without harming current Linux/GRB2 setup

    Half of my hard drive is an unused partition, which is formatted ext2 which is just temporal and has no specific intention of mine. This unused partition has its own swap area, which is also a temporal and not important.

    So my HD is:
    sda1: Linux (Ubuntu 9.10) -- ext4
    sda2: ext2 unused
    sda3: linux-swap
    sda4: linus-swap unused

    Now, I'd like installing Windows 7 using these sda2 and sda4 partitions without corrupting current Linux installation and its GRUB2 setting(I'd likt to reconfigure the GRUB2 after successfully installing the Windows image, for the dual-boot).

    Could someone teach me how to do it safely?
    Last edited by hiwa; 10-04-2010 at 08:08 AM. Reason: typo

  2. #2
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,983
    No MS System I know can be installed without being able to boot immediately. Every Windows installer by default thinks it is the only important system of the PC and will overwrite the MBR without giving it a thought.

    So let the bugger have it!

    Grub2 can be re-installed/restored/replicated by just using any Linux Live CD that has Grub2 (say Ubuntu 10.04).

    If you want to do it in a cunning way then before installing Win7 into sda2 add this lines to /boot/grub/grub.cfg to your Linux in sda1.
    Code:
    menuentry 'Win7 in sda2 known to Grub2 as (hd0,2)' {
    set root=(hd0,2)
    chainloader +1
    }
    You then install Win7 into sda2. I would recommend you alter the partition type of sda2 to Type 7 for NTFS so that Win7 installer will sink its teeth into it and won't let go. Thereby your other partition has no risk of being used by Win7 installer. You can alter a partition type by the standard facilities in cfdisk or fdisk.

    Once Win7 has been installed and operating normally you can boot up a Linux Live CD and issue this command in a terminal to restore Grub2
    Code:
    sudo su
    mkdir /mnt/sda1
    mount /dev/sda1 /mnt/sda1
    grub-install --root-directory=/mnt/sda1 /dev/sda
    SInce you have already have the choice of booting Win7 in Grub2 (before you install Win7) then once Grub2 has been restored it will offer you Win7 as a booting choice.
    Last edited by saikee; 10-04-2010 at 04:54 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  3. #3
    Join Date
    Feb 2004
    Location
    Japan
    Posts
    134
    Thanks saikee. I'll try it when I have enough time.

Tags for this Thread

Posting Permissions

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