Disclaimer: Dont hold me reponsible if you loose data on your hard disk, by following the outlines given here. This is just a detailed explanation of your different options and how I would go about it, if I were you.
- Hard Disk Connectivity Terminology: hda - primary master, hdb - primary slave, hdc - secondary master, hdd - secondary slave. When you boot your machine, the BIOS will identify all your hard disks and CDROM drives. The device listed as primary master is hda, primary slave is hdb, and so on. If you have only one hard disk, then it is hda.
- Some of the hd* may not be connected to any device. Others may be connected to CDROM/DVD/CDRW drives.
- Identify which hard disk is in which slot and the capacity of each hard disk, by noting down what the BIOS displays during your boot process.
- Choosing the layout
- First decide how much space you want to allocate to each operating system.
- You may want to create two partitions per operating system, one holding the software and the second the data files. This facilitates easy backups as well as sharing data files between multiple operating systems.
- Always have a small (suggest 2GB) FAT partition, to act as intermediary if you want to transfer data from one OS to another (Not all OS's read all file systems, but most OS's understand FAT-12,16 and 32).
- If you have an old motherboard then the /boot should be within the first 1024 sectors of your hard disk (i.e. within the first 8GB). If your motherboard is old, then your first partition in hda, i.e. hda1 should be a linux partition. A size of 100MB should be more than enough. If you dont want to do this, lilo has a "lba32" workaround, which should work. But I can't guarentee that it will. If you have a recent motherboard (say less than a couple of years old), forget about 8GB and 1024 sector limits.
- Partitioning the harddisks
- First insert a Linux bootable CD (an installation CD)
- Once it has booted, when it asks you to Press Enter to install, press Alt-F2. You will be taken to a root shell.
- Partition your hard disk(s), using fdisk /dev/hd*. Remember to set the file system type for each partition: Win95'lba for Win 9*, NTFS/HPFS for WinNT/2K/XP (type 7), FAT32 for intermediary partition (type b), linux swap for linux swap space (type 82), ext2/ext3 for linux itself (type 83). If you have a separate /boot, it should also be an ext2/ext3.
- Take the linux install CD out and reboot your machine. So now, you have a blank partitioned hard disk. However, the partitions have not been formatted yet.
- Insert the first OS you are going to install and start up your machine.
- Insalling the Operating systems:
Choosing the file system
- On Win9* you don't have any choice. But on Win2000, WinXP choose NTFS file system. It is a much better file system than any in the FAT family and supports journalling. It is because of journalling that in case of an unclean shutdown, you dont have to spend 15 minutes waiting for scandisk to finish.
- For linux choose ext3 if you are given the option, other wise it will be ext2. ext3 supports journalling unlike ext2.
- Installation order: Install all windows OS's first, old to new. and finally install Linux. More specifically, install in this order: MSDOS,Win 3.1, Win 95, Win 98/98SE, Win Me, Win NT/2000/XP, Linux.
- Finally when you install linux, it will ask you whether it should install the boot manager in /dev/hda or in /dev/hda* where * in (1..6). Choose /dev/hda. It will ask you identify the operating systems in other partitions in the same hard disk. If it did not ask you to identify OS's in the other hard disks, or you forgot or whatever, you can modify LILO/GRUB later.
- Modifying LILO/GRUB
LILO and GRUB are the two boot managers which come with linux. GRUB is supposed
to be more advanced and allows you to "change" the partitioning of the
hard disk depending on which OS you want to boot.... On the other hand
LILO is simple and easy to understand. Unless you feel like experimenting
or you know what you are doing choose LILO as your boot loader.
- LInux LOader: Its configuration is stored in /etc/lilo.conf. To modify it boot into linux, login as root, and modify the /etc/lilo.conf file. man lilo gives you help on the syntax. If you can boot into some operating systems but not the others, try adding lba32 on its own line, right after the root= and the boot= lines. After you have modified it, dont forget to run /sbin/lilo for the changes to take effect.
- GRand Unified Bootloader: Its configuration file is stored in /etc/grub.conf. Check out man grub for help on config file. Unlike LILO you dont need to run any /sbin/lilo equivalent here. At boot time the GRUB boot loader reads and parses the /etc/grub.conf file.
I already have linux installed. What do I do?
First partition your hard disk using linux fdisk and set the types of the partition correctly. Ofcourse, dont delete the partitions which linux is using. Dont forget to have atleast one FAT partition if you want to transfer data between Windows and Linux. So right now you have Linux and may be windows installed, and your master boot record is controlled by LILO/GRUB and (if you have windows installed) when you choose windows, either you boot into windows or the windows boot loader shows up.
Reboot your system and install the new Windows in the appropriate partition. If the new Windows does not ask you which partition to install to, then I don't know what to do. If you already have some version of Windows (henceforth called old windows), then this new windows will attach itself to the old windows' boot.ini (Windows equivalent of lilo.conf / grub.conf) file. Then depending on which version of Windows you are installing, it may or may not over write the Master Boot Record. (Windows 2000 does not seem to overwrite the MBR, but Windows XP Home edition is known of overwrite the MBR). If your new windows did not overwrite the MBR you are in great shape. Next time you reboot, LILO/GRUB will come up and when you choose windows, the Windows boot loader comes up, and you should see both the old and the new windows. However, if the new windows did overwrite the MBR (which will surely happen if there was no old windows to start with), then you cannot get to linux by booting through the hard disk. There are two options for you now.
- Simple but time consuming Reinstall linux. This time dont ask it to reformat your partition and just ask it to install the very bare essentials (the stuff you want is already there and it will not be deleted). Then when it installs LILO/GRUB again, it realises there is already an MBR, and overwrites it with its MBR. Now when you boot LILO gives you a menu of Linux/DOS, and choosing DOS takes you to your old MBR.
- Not so simple Takes less time, but involves a little more messing
around. First copy the current MBR to a different partition. So if /hda1
has your old windows (not your new windows), execute
dd if=/dev/hda of=/dev/hda1 count=1
This copies first sector of /dev/hda (i.e. the MBR) into the boot record of /dev/hda1. Then edit /etc/lilo.conf (or /etc/grub.conf) and tell it that there is Windows operating system installed in /dev/hda1. If you use LILO, just execute /sbin/lilo and you are all set. If you use GRUB, you need to install it again using /sbin/grub-install. I couldn't get grub-install to work because it was asking for some /dev/root to have some BIOS drive information or somesuch thing. Any way if you can run grub-install you are all set. If not dont worry, there is always the first option.