How to run 126 Xp in a hard disk - with a bit of help from Linux


Results 1 to 15 of 20

Thread: How to run 126 Xp in a hard disk - with a bit of help from Linux

Threaded View

  1. #1
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978

    How to run 126 Xp in a hard disk - with a bit of help from Linux

    How to run 126 Xp in a hard disk - with a bit of help from Linux

    Introduction

    This thread is a demonstration of a PC user learns a little bit of Linux can make a M$ system run miles. I did it to satisfy my own curiosity too see if such thing could be done.

    Basically I boot any one of an activated Xp from the 126 partitions. Being poor the Xp is the same license in everyone of the 126 partitions but the scheme obviously works if each partition hold a different license of Xp. Win2k uses the same boot loader so it can be a mixture of both. The scheme is a demonstration but can be extended to several hard disks.

    I run different operating systems in one PC and have a need to move around the M$ systems which I found irritating because an accidental mistake can trash the system and I have to re-activate with M$ again. Thus I tried to install Win2k, Xp, Vista and several Win7 systems onto a backup disk so that I can have a copy to go back to when I lose one of them. As the number of M$ systems are more than the 4 primary partitions available in a hard disk I was forced to install them in logical partitions and to use the boot loaders ntldr and bootmgr together. By accident I discovered Xp can be moved freely around the logical partitions and between hard disks. Seeing the way how Vista/Win7’s bootmgr treats the Win2k/Xp’s ntldr. I became convinced that I could extract the Xp (or W2k) off the disk and move it anywhere I want.

    Linux has traditionally supported 63 partitions in a Pata/IDE disk and 15 on a SCSI/Sata/USB disk. A couple of years back at kernel release 2.6.20 the maximum number of partitions was standardized to 15 for all hard disks. This limit has been breached recently after a break through in the dynamic detection/assignment of the block devices. The improvement, available in the current 2.6.28 and 2.6.29 kernels, is so new that no one knows exactly how many partitions Linux can support. The reason I run 126 Xp is because I could create 130 partitions in a hard disk and then put Xp in the 126 logical partitions, just by writing short scripts in Linux. So it was one installation and 126 clones.

    This thread is putting one and one together to make two.

    The scheme in a nutshell

    I have an activated Xp installed in a logical partition of a hard disk. It is booted by a Dos partition located at the first partition of that disk. The disk has a couple of Win7 (32 and 64 bit) so the booting was controlled by the bootmgr (same boot loader as Vista). All I did was

    (1) To resize Xp to a 5Gb so that it takes less time to duplicate/clone
    (2) Use a boot up Linux to write a script to automatically partition a new/spare hard disk for the number of partitions I want.
    (3) Clone the system partition (Xp) into a new hard disk, format a fat16 partition in its first partition and fix the booting manually.
    (4) Install/clone a Linux in the new hard disk as working tool.
    (5) Verify Xp and Linux all operating normally in the new hard disk as the sole disk in the PC.
    (6) Use the resident Linux to clone the number of Xp I desire in the new hard disk
    (7) Configure the boot loader in Linux to select any of the Xp partitions for booting.
    (8) Write in the Dos partition a selection routine to select which partition I boot the next Xp
    (9) Reboot and boot to the Xp in the newly designated partition.

    Why such scheme works?

    Xp or any M$ system does not support foreign systems so partition types not recognised by a M$ system will not get mounted. If a user has 100 Xp partitions he/she can change the partition ID temporarily for all the Xp partitions except the one to be booted. A ntfs partition has an partition ID No. 7. To hide that partition the ID is changed to 17. To unhide it is to change back to Type 7. Hiding and unhiding is a standard technique used by all boot loaders. A partition ID is a standard entry occupying one of the 16 bytes in a partition table. It is used by operating system to select the appropriate driver to read the different filing system inside the partition.

    In the booting process a NT versions of M$ Windows, of either Win2k or Xp, the MBR is normally responsible to fetch the boot code residing in the boot sector of the booting partition. That boot code loads the ntldr program which also resides in the same booting partition. The loaded ntldr checks a text file called boot.ini, which must be in the booting partition also, to determine which partition contains Xp and then proceeds to load the OS.

    Thus to select from a multiple choices of which Xp partition to be booted up a user needs

    (A) To amend the boot.ini to change the target partition number.

    (B) Hide the unwanted Xp partitions and unhide the one to be booted.

    The above operations (A) can be executed inside or outside a M$ system. I shall provide both alternatives in this thread.. For selecting which Xp to boot and amending the boot.ini file I wrote a simple Basic program executable at a command prompt within Xp. Outside Xp it is a trivial task to write a small script to amend the boot.ini stored in a M$ partition.

    To accomplish the Task (B) above I have to use a boot loader capable of altering the partition ID so I chose Grub. Grub is an Open Source program that can be installed without a Linux. I place Grub in a second Dos partition to control the first boot.

    The boot up sequence is Grub is loaded first for being in the MBR. It hides and unhides the appropriate partition before handing over the control to the boot sector code in the first Dos partition. The boot sector code of the first partition then loads ntldr which fires up Xp at the required partition.

    How do I know I am booting to several Xp and not the same one over and over again?

    Good question.

    My answer is

    (i) I have to change the desktop screen background with a different photo in each partition.
    (ii) Also in the XP’s disk management program I can see the drive letter referring the physical position in the hard disk as a confirmation.
    (iii) I labelled each partition so by clicking “My Computer” I can see which partition has been booted.

    The details of the scheme

    As readers are not all interested in the full details but only the selected parts I have arranged the thread broken down into small number of posts as follow

    Contents

    (1) Introduction – Post #1
    (2) How to resize a XP partition to a designated size. – Post #2
    (3) How to partition a hard disk with a large number of partition by a BASH script - Post #3
    (4) How to clone one partition to anther in the same or different hard disk. - Post #4
    (5) How to control the booting of Dos, Xp and Linux - Post #5
    (6) How to control the booting of multi copies of Xp - Post #6
    (7) Things I learned from the scheme – Post #7
    (8) Conclusions - Post #2

    Applications and usages

    Possibly none except to those who has a need to subject a large number of Xp to different tests.

    A Xp user nervous of losing the OS due to virus attacks or accidental damages may wish to keep a working and bootable copy that can fire up in seconds. Thus information of this thread could be of interest to some.

    For over 30 years working with M$ systems I never understood how they boot. The few years into Linux gave me an enormous education on how things work in a PC. I did this scheme because I thought technically it should be possible.

    Conclusions

    (A) One can easily break up a Xp in a logical partition from a Vista/Win7 boot loader and take it to any hard disk by manually assemble the booting files.
    (B) Xp can operate successfully anywhere (or any partition) in a hard disk.
    (C) Multiple copies Xp can be stored in the same hard disk ready for replacing a damaged or virus-infested version.
    (D) Linux has a huge amount of functionalities. It can be used beneficially to help a M$ Windows user.
    (E) There is so much fun in writing a script to create 130 partitions in a hard disk, then another script to clone Xp into 126 partitions and finally using a script (or a Basic program) to select the booting of Xp in different partitions.
    Last edited by saikee; 05-09-2009 at 03:38 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •