[SOLVED] Install Windows 7 after installation of Linux [Dual Boot]

Some people say that shouldn't install Windows 7 after install Linux, because Windows can override your start-up mechanizm called Master Boot Record (MBR) and You can lose your data if you don't know what happend. It's very good attention, because I almost experienced this. But I had a very basic knowledge about what I had done. I knew that I need second disk for create backup all my data. I had opposite situation, becouse I thought on that notebook was installed Windows XP and I couldn't see GRUB window to choose OS. It was wrong, it was mistake. Admins from Univercity advised me that i must run Fix MBR and Fix Boot from Windows XP Installer CD. After that, neither Windows nor Linux didn't want to run. Partition table was crashed. 

Now I know more than in the past. Now I don't worry about Install Windows 7 after install Linux. Let's start lesson about Windows and Linux installation in option dual boot.

Windows can be installed for two main ways. The easiest way is prepare partition table in Windows Installer or from Linux Live CD. This operation is very simple and it not entails loosing of data, assuming that hard drive disk is clean, in other case we must prepare a backup of our data. Preparing of partition table is easiest when we have a multiple hard drive disks, becouse we can create all partitions like Primary, not Extended/Logical. In my opinion It is good becouse we have clear partition table without dirty nesting and strange number of partitions without sort order.

Second way is harder becouse we must be very careful. We don't want loose all linux data and partitions. In this case I had another experience. I decide to install Windows 7 from USB Flash Drive, becouse I didn't want burn CD/DVD installer disk. First problem was how to run installer from USB. You have two option:
1. Setup Boot order in BIOS
2. Run Boot menu when you can see option like "Press XXX to run Boot Menager" 
In next step we must be sure what partition is designated for Windows. I was shure but I two times I checked that is correct partition. When I runned again Windows installer from USB I saw that Windows mount disks in descending sort order. It was very strange but though that I decided to continue installation of Windows... And after reboot I saw again GRUB User Interface to choose OS. It was very strange... I didn't know what happend. I found solution in the internet. The problem was that I have two device (two hard drive disks) and Windows boot maganer was installed on second disk. I tried to run auotmatic tool to repair it... and it was big wrong. I lost my linux home partition - Windows 7 installer and tool to repair bootmgr change my linux ext3 partition to FAT partition and create new partition with another Windows 7 data. It was very strange because two NTFS partitions wasn't touched and I thought that I loose all my data from HOME linux partition. I tried to install testdisk and learn how to use it for recover / restore lost partition. I did it. All my partition table was rescued! I hadn't backup! My master’s thesis... I don't want think about it.

This case teached me more and reminded me that I must have a backup. 

Example 1: 
Install Windows before Install Linux - The easiest Way (ONE HDD)
1. Open your CD/DVD ROM  and insert Windows CD or plug USB Flash Bootable Windows instalation drive
2. Reboot / Restart your computer
3. Run BIOS setup and set in Boot tab order devices (CD/DVD or USB at first position)
or if you have opportunity then run Boot Magaer Device and select correct device (CD/DVD or USB)
4. Create Partitions and Install Windows.
5. Install Linux 
-----------------------------------------------------------------------------------------------------------------------------------------

Example 2: 
Install Windows before Install Linux - More difficult (ONE HDD)
1. Open your CD/DVD ROM  and insert Linux Live CD or plug USB Flash Bootable Linux bootable instalation drive
2. Reboot / Restart your computer
3. Run BIOS setup and set in Boot tab order devices (CD/DVD or USB at first position)
or if you have opportunity then run Boot Magaer Device and select correct device (CD/DVD or USB)
4. Open terminal or use creator / wizard from Linux Live CD for partition table create
5. Create partition table
  5.1. First way is using cfdisk  
user@host $ cfdisk /dev/sda 
  5.2. Second way is using fdisk

user@host $ fdisk /dev/sda 
6. Your partition table can look like below 
/dev/sda
/dev/sda1  # (Primary) Boot / Grub partition
/dev/sda2  # (Primary) Windows
/dev/sda3  # (Extended)
 /dev/sda4 # (Logical) (Linux Swap)
 /dev/sda5 # (Logical) (Linux ROOT)
 /dev/sda6 # (Logical) (Linux Home)
...

7. After save a partition table you can reboot and insert Windows CD/DVD or plug USB installer.
8. Install Windows on created Windows partition
-----------------------------------------------------------------------------------------------------------------------------------------

Example 3: 
Install Windows before Install Linux - More difficult (Mutliple HDD)
1. Open your CD/DVD ROM  and insert Linux Live CD or plug USB Flash Bootable Linux bootable instalation drive
2. Reboot / Restart your computer
3. Run BIOS setup and set in Boot tab order devices (CD/DVD or USB at first position)
or if you have opportunity then run Boot Magaer Device and select correct device (CD/DVD or USB)
4. Open terminal or use creator / wizard from Linux Live CD for partition table create
5. Create partition table
  5.1. First way is using cfdisk  
user@host $ cfdisk /dev/sda 
  5.2. Second way is using fdisk
user@host $ fdisk /dev/sda 
6. Your partition table can look like below 
/dev/sda
/dev/sda1  # (Primary) Boot / Grub partition
/dev/sda2  # (Primary) Windows
/dev/sda3  # (Primary) Linux ROOT

/dev/sdb
/dev/sdb1  # (Primary) Linux Home
/dev/sdb2  # (Primary) NTFS
/dev/sdb3  # (Primary) NTFS
...
7. After save a partition table you can reboot and insert Windows CD/DVD or plug USB installer.
8. Install Windows on created Windows partition
-----------------------------------------------------------------------------------------------------------------------------------------

Example 4: 
Install Windows after Install Linux - Harder (ONE HDD)
You may installed only Linux or Linux and bad version of Windows and you would like install Windows.
1. Run Linux
2. Prepare partition table (add new partition to existing or move) - you can use gparted/fdisk/cfdisk 
3. Reboot and insert CD/DVD or USB Windows installer drive and run form CD/DVD/USB
5. Install Windows on prepared partition! - Be careful ! Select a correct partition. The best way to be sure that you will select correct partition is create label of this partition while you was creating it.
6. After reboot - please don't afraid that you loose your Linux data, when GRUB User Interface is not loaded. Probably Windows Installer override MBR and you run only Windows. Yes! Linux is still there! Don't panic! 
7. After Windows installation is done in 100% and reboot again and you can log in to the Windows You shuold switch CD/DVD/USB Windows isntaller with Linux Live CD reboot it by Windows -> start -> reboot.
8. Run from CD/DVD/USB Linux Live CD and run terminal
9. Run GRUB
root@host ~ $ grub 
10. Run GRUB Commands
grub> root(hd?,?)
grub> setup(hd?)
grub> quit
-----------------------------------------------------------------------------------------------------------------------------------------
Example 5: 
Install Windows after Install Linux - Harder (Multiple HDD)
You may installed only Linux or Linux and bad version of Windows and you would like install Windows.
1. Run Linux
2. Prepare partition table (add new partition to existing or move) - you can use gparted/fdisk/cfdisk 
3. Reboot and insert CD/DVD or USB Windows installer drive and run form CD/DVD/USB
5. Install Windows on prepared partition! - Be careful ! Select a correct partition. The best way to be sure that you will select correct partition is create label of this partition while you was creating it.
6. After reboot GRUB User Interface is loaded but when we select "Windows" you can see something like this:
BOOTMGR is missing. Press Ctrl+Alt+Del to restart
Probably Windows Installer create a Boot manager in the other HDD. 
7. Run Linux
8. Run Command:
root@host ~ $ fdisk -l
or run
root@host ~ $ cfdisk /dev/sdXY
where X - letter of other than first drive  and Y - number of partition
9. Copy or Move Windows Boot Manager Fiels from other bootable disk to windows installation partition
root@host ~ $ mv /dev/sdXY/Boot /dev/sdZM/ 
root@host ~ $ mv /dev/sdXY/BOOTSECT.BAK /dev/sdZM/ 
root@host ~ $ mv /dev/sdXY/bootmgr /dev/sdZM/ 
where Z - letter of disk where you installed Windows and M - number of partition
10. Reboot and select Windows record from GRUB User Interface.
-----------------------------------------------------------------------------------------------------------------------------------------
Legend:
Green - is describing the easiest operational level
Yellow - is describing easy operational level but contains some harder operation.
Orange -  is describing harder than easy operational level
Dark Orange - is describing hard operational level
Red - is describing the hardest operational level

Brak komentarzy:

Prześlij komentarz