saikee
10-26-2007, 04:10 AM
When multi-booting different operating systems it would be useful to arrange them in such a way so that they can be easily maintained or requiring the minimum attention. Preferably should one system go down it should not affect the operation of the others. The system in trouble should be independent, isolated and easily rescued.
The following scheme is designed for such purposes and is simple enough for a newbie to Linux.
Step 1 - Prepartition a hard disk with 4 partitions
This should be done with a Linux Live CD using terminal program cfdisk. The commands aare
sudo su
cfdisk /dev/sdaCreate the following partitions. All partitions created in Linux are automatically Type 83. You need to use the "Type" option to change to another type. Remember you do not have to use up all the hard disk space.
sda1 of primary partition type 7 for xp, size 15 to 20Gb or more as required
sda2 of primary partition type 7 for Vista, size 15 to 20Gb or more as required
sda5 of logical partition type 82 for a swap, size 1Gb (for simplicity)
sda6 of logical partition type 83 for Linux, 10 or more as required
Write the partition table, confirm with "yes", quit cfdisk, reboot and check the partition details with this terminal command
fdisk -l.
In Linux the first logical partition created is always the 5th one. The creation of which will automatically use up a primary partition by converting it into an extended partition. Thus the "fdisk -l" will show up sda3, as an extended partition, even you have not created it and that is the reason I recommend using cfdisk because it teaches you about hard disk partitioning.
Step 2 - Install XP.
Tell its installer to use the first partition for installation. Have it working before proceeding to the next step. XP installer will place XP's own boot loader NTLDR inside sda1 or the "C" drive.
Step 3 - Hide the sda1
This can be done by a Live CD with Grub. Commands are
sudo su
grub
geometry (hd0)
hide (hd0,0)
geometry (hd0)
quitGrub counts from 0 so 1st disk is called (hd0) and its first partition is named (hd0,0) which corresponds to the sda1 in Linux and the "C" drive in XP. The "geometry (hd0)" statements before and after the "hide" command are to show the change of the first partition, from type 7 to Type 17, in front of your eyes. MS system does not support partition types not used by the MS so the XP partition, with type 17, is temporarily foreign to MS systems even though not a single byte has been changed in the partition interior.
Step 4 - Install Vista
Just a normal installation as its installer will find sda2 and use it as the "C" drive. It will place its own boot loader bootmgr inside the "C" drive (or sda2 this time). Have it working before proceed to the next step. XP is not available temporarily.
Step 5 - Install Linux of your choice (I assume it is booted by Grub)
Just a normal installation but make sure the installer uses only the sda6 for the installation. The installer does not needed to be told about the swap as it will use it regardless. Let the boot loader Grub takes over the MBR.
It is not necessary if it dual-boots Vista/XP or not at the installation stage, just make sure it is operational.
Step 6 - Amend Grub to triple boot
Edit Linux's /boot/grub/menu.lst to include these two choices for booting XP and Vista
title xp pro @ sda1
root (hd0,0)
unhide (hd0,0)
hide (hd0,1)
makeactive
chainloader +1
title Vista @ sda2
root (hd0,1)
unhide (hd0,1)
hide (hd0,0)
makeactive
chainloader +1Save the file and on the next reboot you can fire up any of the three systems.
--------------------------------------------------------------------------------------------------
Theory
You let Grub hide XP when booting Vista.
When you boot Vista Grub hides XP.
The booting MS partition is made "active" on-the-fly (not needed by Linux but required by XP & Vista)
Hiding a ntfs type 7 changes it to type 17 (see observed PC standard (http://www.justlinux.com/forum/showthread.php?t=149828&highlight=hidden) for extra details)
unhiding a type 17 reverts back to type 7
Not much to it really.
-------------------------------------------------------------------------------------------------
The above is my preferred method. The standard method is don't do any hiding. With the above sequence of installation Vista will install its boot loader in sda1 to dual boot XP and itself and there will be no boot loader inside sda2. Therefore in a standard arrangement you do not triple-boot but only dual-boot; Choice (1) To Windows and Choice (2) to Linux. Inside Choice (1) you then select XP or Vista.
My preferred method does have the disadvatage of each MS system cannot see another. For that you gain the following advantages
The order of installation of different systems has no consequence.
The scheme is not only suitable for two MS systems it can cope any number of them (I use it to boot 3 Dos and 5 Windows)
Each system can be maintained/reinstalled without affecting the others
The scheme is suitable for any number of Linux plus any number of non-MS systems like Solaris and BSD.
Each system always has its own boot loader and able to survive idependently.
Grub can be replaced by Lilo if desired.
For different operating systems using the same personal data, like photos, Mp3 etc, it is a good practice to put it in a "neutral" partition like in fat32 accessible by all the other systems.
The following scheme is designed for such purposes and is simple enough for a newbie to Linux.
Step 1 - Prepartition a hard disk with 4 partitions
This should be done with a Linux Live CD using terminal program cfdisk. The commands aare
sudo su
cfdisk /dev/sdaCreate the following partitions. All partitions created in Linux are automatically Type 83. You need to use the "Type" option to change to another type. Remember you do not have to use up all the hard disk space.
sda1 of primary partition type 7 for xp, size 15 to 20Gb or more as required
sda2 of primary partition type 7 for Vista, size 15 to 20Gb or more as required
sda5 of logical partition type 82 for a swap, size 1Gb (for simplicity)
sda6 of logical partition type 83 for Linux, 10 or more as required
Write the partition table, confirm with "yes", quit cfdisk, reboot and check the partition details with this terminal command
fdisk -l.
In Linux the first logical partition created is always the 5th one. The creation of which will automatically use up a primary partition by converting it into an extended partition. Thus the "fdisk -l" will show up sda3, as an extended partition, even you have not created it and that is the reason I recommend using cfdisk because it teaches you about hard disk partitioning.
Step 2 - Install XP.
Tell its installer to use the first partition for installation. Have it working before proceeding to the next step. XP installer will place XP's own boot loader NTLDR inside sda1 or the "C" drive.
Step 3 - Hide the sda1
This can be done by a Live CD with Grub. Commands are
sudo su
grub
geometry (hd0)
hide (hd0,0)
geometry (hd0)
quitGrub counts from 0 so 1st disk is called (hd0) and its first partition is named (hd0,0) which corresponds to the sda1 in Linux and the "C" drive in XP. The "geometry (hd0)" statements before and after the "hide" command are to show the change of the first partition, from type 7 to Type 17, in front of your eyes. MS system does not support partition types not used by the MS so the XP partition, with type 17, is temporarily foreign to MS systems even though not a single byte has been changed in the partition interior.
Step 4 - Install Vista
Just a normal installation as its installer will find sda2 and use it as the "C" drive. It will place its own boot loader bootmgr inside the "C" drive (or sda2 this time). Have it working before proceed to the next step. XP is not available temporarily.
Step 5 - Install Linux of your choice (I assume it is booted by Grub)
Just a normal installation but make sure the installer uses only the sda6 for the installation. The installer does not needed to be told about the swap as it will use it regardless. Let the boot loader Grub takes over the MBR.
It is not necessary if it dual-boots Vista/XP or not at the installation stage, just make sure it is operational.
Step 6 - Amend Grub to triple boot
Edit Linux's /boot/grub/menu.lst to include these two choices for booting XP and Vista
title xp pro @ sda1
root (hd0,0)
unhide (hd0,0)
hide (hd0,1)
makeactive
chainloader +1
title Vista @ sda2
root (hd0,1)
unhide (hd0,1)
hide (hd0,0)
makeactive
chainloader +1Save the file and on the next reboot you can fire up any of the three systems.
--------------------------------------------------------------------------------------------------
Theory
You let Grub hide XP when booting Vista.
When you boot Vista Grub hides XP.
The booting MS partition is made "active" on-the-fly (not needed by Linux but required by XP & Vista)
Hiding a ntfs type 7 changes it to type 17 (see observed PC standard (http://www.justlinux.com/forum/showthread.php?t=149828&highlight=hidden) for extra details)
unhiding a type 17 reverts back to type 7
Not much to it really.
-------------------------------------------------------------------------------------------------
The above is my preferred method. The standard method is don't do any hiding. With the above sequence of installation Vista will install its boot loader in sda1 to dual boot XP and itself and there will be no boot loader inside sda2. Therefore in a standard arrangement you do not triple-boot but only dual-boot; Choice (1) To Windows and Choice (2) to Linux. Inside Choice (1) you then select XP or Vista.
My preferred method does have the disadvatage of each MS system cannot see another. For that you gain the following advantages
The order of installation of different systems has no consequence.
The scheme is not only suitable for two MS systems it can cope any number of them (I use it to boot 3 Dos and 5 Windows)
Each system can be maintained/reinstalled without affecting the others
The scheme is suitable for any number of Linux plus any number of non-MS systems like Solaris and BSD.
Each system always has its own boot loader and able to survive idependently.
Grub can be replaced by Lilo if desired.
For different operating systems using the same personal data, like photos, Mp3 etc, it is a good practice to put it in a "neutral" partition like in fat32 accessible by all the other systems.