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
/bootonHDA1, and put a tiny (40 MiB or so)FAT16BonHDA2orHDA3for Windows to boot from. SetHDA1"active". - Install Linux, but, put the bootloader on
HDA1, 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 WindowsHDA2orHDA3. 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
HDA1boot 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'HDA1/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*| |Prim 83 LinuxNatv| 1|EXT2 |GRUB | 101.9| |02 | |Hide 11 FAT12 | 2| | | 7.8| |03>|C:|Prim 06 FAT16 | 3|FAT16 |MSWIN4.1| 39.2| |04 | |Log 82 SunS/SWAP| 5|SWAP |Linux | 768.7| |05 | |Log 83 LinuxNatv| 6|EXT3 |Linux | 4800.6| |06 |D:|Log 0c FAT32-Ext| 7|FAT32 |MSWIN4.1| 3506.3| |07 |E:|Log 0c FAT32-Ext| 8|FAT32 |MSWIN4.1| 4000.5| |08 | |Log 83 LinuxNatv| 9|EXT3 |Linux | 6243.9|
And your Grub bootloader configuration could look similar to:
default 1 timeout 60 color cyan/blue white/blue title Windows 2000 root (hd0,2) # makeactive chainloader +1 title Ubuntu, kernel 2.6.15-23-386 root (hd0,0) kernel /vmlinuz-2.6.15-23-386 root=/dev/hda6 ro vga=0x120 nosplash initrd /initrd.img-2.6.15-23-386 # savedefault boot title Ubuntu, kernel 2.6.15-23-386 (recovery mode) root (hd0,0) 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 Professional" /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/hda1 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.
Related Links
- Disk Partitions, OS/2, & Multiboot FAQ
- Notes on using logical volumes and the Logical Volume Manager (LVM), by Bob Eager
- LVM, FDISK and Partition Magic, by Eirik Overby on OS/2 Voice
- Installing OS/2 with FAT32 around, by Darryl Sperber on OS/2 Voice
- Linux Partition HOWTO, from The Linux Documentation Project
- Hard Disk Upgrade Mini How-To, from The Linux Documentation Project
- Large Disk HOWTO, from The Linux Documentation Project
- Managing Multiple Operating Systems 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
- Booting with LILO, from The Linux Documentation Project
- Win95 + WinNT + Linux multiboot using LILO mini-HOWTO, from The Linux Documentation Project
- Linux Partitions: A Primer by Dee-Ann LeBlanc on Linux Planet
- Ranish Partitioning Primer
- Hard Disk Drives, from PC Guide/Storage Review
- Gary Field's SCSI Info Central, home of the SCSI FAQ
- Prefixes for Binary Multiples at Everything2
- Knoppix - Rescue via Linux, or simply run Linux from CD
- Recovering Ubuntu After Installing Windows
- Ultimate Boot CD - Many ways to rescue
- Bart's Windows/DOS Boot CD - M$ rescue from CD
- Windowshelp Multiboot
- Microsoft Knowledgebase Vista Multiboot
- Installing Linux after Vista on APC Magazine
- Installing Vista after Linux on APC Magazine
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 | |||||