Installing Windows® After Something Else
Modern lore often leads the naive to believe that Windows should always be installed first on any system on which it must co-exist with some other operating system, for instance, Linux. The problem with that is that inevitably Windows will need to be reinstalled. The better approach is to install such that Windows changes nothing at all, or nothing that isn't dead easy simple to undo. Then it doesn't matter what gets installed when.
How? Here's the condensed procedure for an empty single PATA HD system on which a dedicated boot manager that requires its own partition will not be used:
- Partition completely first, preferably with a cross-platform and/or
OS-agnostic tool, to prevent booby traps from unruly installers getting in your way. Reserve for Linux
/bootonHDA3, and put a tiny (40 MiB or so)FAT16BonHDA1orHDA2for Windows to boot from. SetHDA3"active". - Install Linux, but, put the bootloader on
HDA3, not theMBR. Starting with a HD with no installed OS, the installer may not give you this option. If it does not, after installation is complete, install the bootloader to/bootyourself by running your choice ofgrub-installorlilo. - Add a stanza to
menu.lstorlilo.conffor the WindowsHDA1orHDA2. Do not include "makeactive", unless you want to always start boot from the NTLoader menu on the successive boot. - Set the
FATpartition "active". -
- Install Windows.
- (optional) Add the Linux
HDA3boot partition to Windows'boot.ini. Reboot to see if the initial boot menu is NTLoader's. If it is not, use aDOSor Windows utility likeFDISKto install genericMBRcode in place of the non-generic code set there by the Linux installer.
- Use any of countless
DOSor Windows or open source tools to change the "active" partition back to Linux'HDA3/boot(changing 2 bits in theMBRpartition table).
At this point you're ready to boot either OS from the Grub or Lilo menu,
with a fallback to booting either Windows or Linux using NTLoader if you
chose option 5.B. And, you're doing it with pure generic MBR code,
which simply transfers boot control to the boot record of whichever primary
partition is set "active".
When you're done doing as above, your disk layout might be logically arranged as follows:
|ID |Dr|Type, description|hd|Format |Related |Size MiB| +---+--+-----------------+--+--------+--------+--------+ |01>|C:|Prim 06 FAT16 | 1|FAT16 |MSWIN4.1| 39.2| |02 | |Hide 11 FAT12 | 2| | | 7.8| |03*| |Prim 83 LinuxNatv| 3|EXT2 |GRUB | 101.9| |05 | |Log 82 SunS/SWAP| 5|SWAP |Linux | 768.7| |06 | |Log 83 LinuxNatv| 6|EXT3 |Linux | 4800.6| |07 |D:|Log 0c FAT32-Ext| 7|FAT32 |MSWIN4.1| 3506.3| |08 |E:|Log 0c FAT32-Ext| 8|FAT32 |MSWIN4.1| 4000.5| |09 | |Log 83 LinuxNatv| 9|EXT3 |Linux | 6243.9|
And your Grub bootloader configuration could look similar to:
default 1 timeout 50 color cyan/blue white/blue title Windows root (hd0,0) # makeactive chainloader +1 title Kubuntu Linux root (hd0,2) kernel /vmlinuz-2.6.15-23-386 root=/dev/hda6 ro vga=0x317 nosplash initrd /initrd.img-2.6.15-23-386 # savedefault boot title Kubuntu (recovery mode) root (hd0,2) kernel /vmlinuz-2.6.15-23-386 root=/dev/hda6 ro single initrd /initrd.img-2.6.15-23-386 boot
If you performed step 5.B., your Windows' boot.ini would be something like:
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(6)\WINNT [operating systems] multi(0)disk(0)rdisk(0)partition(6)\WINNT="Microsoft Windows 2000" /fastdetect C:\grubboot="Grub Boot Menu"
Assuming your Windows C: drive in Linux is mounted on /disks/C, and the disk
partitioning above, you would create C:\grubboot above like so:
dd if=/dev/hda3 of=/disks/C/grubboot bs=512 count=1
Any OS installations beyond the first two are easily added to the
boot.ini and/or lilo.conf or menu.lst menus. For additional
versions of Windows the installer will do boot.ini automatically. Just remember
during additional Linux installations to place their boot loaders on their respective /boot or / partitions,
and set the Windows primary "active" before every Windows (re)installation.
Caution: Contrary to common folklore, Windows 9x, 2K & XP are all perfectly happy to use a primary partition other than the first for its C:. However, if you use the first primary for something other than C:, and install Grub on the first primary, then the WinXP installation program may not continue after displaying "Setup is inspecting your hardware configuration..."
Related Links
- Disk Partitions, OS/2, & Multiboot FAQ
- Installing Vista after Linux on APC Magazine
- Installing Linux after Vista on APC Magazine
- SUSE on Grub
- Hard Disk Upgrade Mini How-To, from The Linux Documentation Project
- Large Disk HOWTO, from The Linux Documentation Project
- HOWTO: Multi Disk System Tuning, from The Linux Documentation Project
- Multiboot with GRUB Mini-HOWTO, from The Linux Documentation Project
- Win95 + WinNT + Linux multiboot using LILO mini-HOWTO, from The Linux Documentation Project
- Managing Multiple Operating Systems HOWTO, from The Linux Documentation Project
- Linux Partition HOWTO, from The Linux Documentation Project
- Booting with LILO, from The Linux Documentation Project
- EasyBCD Vista compatible boot loader
- Hard Disk Drives, from PC Guide/Storage Review
- Microsoft Knowledgebase Vista Multiboot
- Windowshelp Multiboot
- Prefixes for Binary Multiples at Everything2
- Knoppix - Rescue via Linux, or simply run Linux from CD
- Linux Partitions: A Primer by Dee-Ann LeBlanc on Linux Planet
- Multibooters - Dual/Multi Booting With Vista
- Bart's Windows/DOS Boot CD - M$ rescue from CD
- Installing OS/2 with FAT32 around, by Darryl Sperber on OS/2 Voice
- LVM, FDISK and Partition Magic, by Eirik Overby on OS/2 Voice
- Ranish Partitioning Primer
- Gary Field's SCSI Info Central, home of the SCSI FAQ
- Notes on using logical volumes and the Logical Volume Manager (LVM), by Bob Eager
- Ultimate Boot CD - Many ways to rescue
- Recovering Ubuntu After Installing Windows
Partitioning Tools
| License | Executable runs on platform | |||||||
|---|---|---|---|---|---|---|---|---|
| Tool | GPL | Non-Free | DOS | Linux | Mac | OS/2 | Win | Notes |
| CFDisk | X | X | ||||||
| DiskDrake | X | X | Mandriva | |||||
| Disk Druid | X | X | RedHat/Fedora | |||||
| DFSee | X | X | X | X | X | X | compiled to run on all popular platforms | |
| FDisk | X | X | X | X | X | X | X | several apps go by same name (not cross-platform) |
| Free FDisk | X | X | ||||||
| FIPS | X | X | resizer only | |||||
| GParted | X | X | ||||||
| LVM | X | X | ||||||
| Partition Logic | X | no OS required | ||||||
| Partition Magic | X | X | X | |||||
| Partman | X | X | Debian | |||||
| QParted | X | X | ||||||
| QTParted | X | X | ||||||
| Ranish Partition Manager | X | X | ||||||
| SPFDisk | X | X | ||||||
| XFDisk | X | X | ||||||
| YaST | X | X | SUSE/OpenSUSE | |||||