Installing XP/Server 2003 without using a CD Drive
I just built a low-end server for testing and backup purposes, out of an old motherboard, an Antec case and a 640gb hard disk. I made a decision to not include an optical drive in my system, not necessarily because of price (a Pioneer SATA DVD-RW is $35 at CentreCom right now! </shameless-plug>) but because I didn’t really need it. This server is mainly going to sit underneath my desk and store my backups, and maybe run a web server for when I’m doing things with web applications. Therefore I didn’t really need one. Plus from what I had read on the internet, it wasn’t too hard to launch setup from a network or a USB key. However, after trying these, both didn’t seem to work very well. Perhaps if I had a USB2.0 device handy it would have worked better, but I only had a USB1.1 device, so it was painfully slow to boot into even the text-mode part of Windows Setup.
After a bit of research I found a better way to do this: install Windows from the hard disk it’s installing onto. I tried this a few times*, and found that after refining my process, it works really well. Even if you have a CD drive in your new computer, installing from the hard disk will be faster, and since we will be automating the installer, you can leave it to install while you go and do other things.
You Will Need:
- Your new computer
- A computer already running Windows
- A Windows XP/2003 CD (whichever OS you want to install on your new machine)
- A USB-IDE or USB-SATA adapter, depending on the hard disk in the new computer. For this an external HDD enclosure is fine. Personally I use a USB-IDE+SATA adapter, which works brilliantly.
- A copy of the latest service pack for your copy of Windows, if it isn’t already slipstreamed into your CD.
Partitioning
Firstly we need to partition the hard disk. Take the hard disk out of the new computer, and connect it to your USB-SATA/IDE adapter. Windows should detect your hard disk.
Right-click My Computer, click Manage, then open the Disk Management snapin. Then select the drive you connected (it should contain all unallocated/free space). We need to create two partitions: a partition that will become the system partition, and a partition which will hold the setup files (which can later be a data partition, or you can delete it).
WARNING! Partitioning your hard disk using Disk Management means you will LOSE all your DATA. Just so you know.
The first partition we will create will be the system partition. This will be a FAT32 partition (it will be converted to NTFS later). Make sure this is a Primary partition. Most importantly, do not assign it a drive letter. This is so during Windows Setup you don’t end up with a drive letter like F: as your system drive. Make sure this partition is at least about 20GB, or however much you estimate that a install of Windows will be when all of your applications are installed.
Now we need to create a partition for the setup files. Create a Primary NTFS partition, and assign it a drive letter. It doesn’t matter what this drive letter is, you can change it later. Make this partition at least 2GB.
Now right-click the setup partition, and select Mark Partition as Active.
Copying the setup files
The second NTFS partition you created should show up in Windows Explorer after it has finished formatting. Create a new folder on this partition called "install". Now copy the entire contents of your Windows XP/Server 2003 CD to this folder.
Slipstreaming the latest service pack
If your Windows install CD doesn’t contain the latest service pack, you really should slipstream the latest service pack into the install files. This will save you time as you won’t have to install the service pack after you have installed Windows. Obtain the full (network) install packages of either Windows XP SP2 (note: this will be replaced by SP3 in a few days!) or Windows Server 2003 SP2. Now open up a command prompt and run the EXE you just downloaded, with the Integrate parameter like this:
WindowsXP-KB835935-SP2-ENU.exe /integrate:X:\install
(where X is the setup partition)
After a few minutes, your install files will contain the latest service pack.
Unattended Install
We will be automating the install by entering in all of the data. This is mainly to save time, but also because we need to create an unattended install script anyway to tell the installer to convert the first partition to NTFS. In the SUPPORT\TOOLS folder in the Install folder, there is a file called deploy.cab. Extract the contents of this to a folder, and run SetupMgr.exe. This is Windows’ unattended install script generator. You could also use nLite, which is actually a whole lot nicer, but this is sufficient. Make sure you select Fully Automated as the install method, otherwise you will need to click through the install, which defeats the purpose. Enter in all of your details such as your timezone, product key, etc, and save the unattended script as Unattend.txt in the Install folder on the setup partition.
Now open up Unattend.txt in Notepad, and under the [Unattended] heading, add the following line:
FileSystem = ConvertNTFS
This will ensure that the FAT32 partition is converted to NTFS during the text-mode phase of setup.
Copying the setup files
We now need to run the Windows Installer, and tell it to copy the installer boot files to the setup partition. Open up a command prompt to the i386 folder in the Install folder on the setup partition. Now type the following:
winnt32 /unattend:..\unattend.txt /dudisable
/syspart:X /tempdrive:X /makelocalsource /noreboot
(where X is the setup partition. This should be all on one line.)
When you run this command, Windows Setup will run, and create $WIN_NT$.BT and $WIN_NT$.LS folders on the Setup partition. The next time a computer boots from this partition, Windows Setup will run and install Windows automatically.
Interesting Sidenote: What do the switches mean?
/unattend: Tells the Windows Setup program to use the unattended install script in the folder above the i386 folder
/dudisable: Tells the Windows Setup program to not check the internet for updates
/syspart:X Tells the Windows Setup program to copy the setup files to the specified partition instead of the partition that the system is currently running from (usually C). If you don’t include this, then next time you reboot your old computer, it will boot into setup.
/tempdrive:X Tells the Windows Setup program to place temporary files on the setup partition.
/makelocalsource: Tells the Windows Setup program to create a copy of all of the setup files in the $WIN_NT$.LS folder. This is the most crucial step, as this means that setup will not look for files on the CD drive.
/noreboot: Tells Windows Setup to not reboot after it copies the files. Since usually when winnt32 is run, it is performing an install on the computer it is running on, it will reboot to start the text-mode phase of setup.
Installing Windows
Safely remove the new computer’s hard disk and connect it to the new computer. Boot the new computer. Provided that it doesn’t try to boot to the network or a USB device, the system should boot straight into Windows Setup. It will continue without needing any user intervention, unless something goes wrong. It will also be considerably faster than a normal Windows install, as installing from a hard disk is a lot faster than installing from a CD.
In about 20 minutes, you should be faced with a Windows logon screen, or the annoying Windows Out-Of-Box-Experience (Let’s Activate Windows!) screen.
Copying the boot loader
Windows is ready to go, however the setup program will have most likely put the boot files on the second partition. To make everything self-contained, it is better if these are on the system partition.
Open up Windows Explorer to the system partition. Go to Tools -> Folder Options -> View, and select Show hidden files and folders and untick Hide protected operating system files (Recommended).
As well as the Install folder we created, you will notice that there are three files, ntldr, ntdetect.com and boot.ini. Copy these three files to the root of the C:\ drive.
Now right-click My Computer, click Manage, then open the Disk Management snapin. Right-click the C: partition, and select Mark Partition as Active. Close Disk Management, and reboot. Your computer should boot as normal.
Now you can change the drive letter on the second partition, or delete the second partition if you want. You do not need to keep the install files that are on this partition. If you want to extend the C: partition to fill the drive, you could use either Windows’ built-in Diskpart tool, or the excellent GParted+ Linux livecd (though in this case if you have no CD drive, you would probably boot it from a USB drive).
Other nice things to try
You can slipstream the latest service pack and set up the unattended install using nLite. nLite will also give you a lot more options with regards to tweaking the system, and it also allows you to slipstream all of your drivers and software into the install, so you don’t have to install them later. If you do it using nLite, make sure you don’t create an ISO file on the final setup. You don’t need it, unless you want to burn your new nLited install to a CD.
Why not use Ghost/Sysprep/RIS/USB/Floppy?
Ghosting/imaging a SysPrepped copy of Windows requires you to have a somewhat-similar PC already set up with Windows to clone onto the new drive. RIS achieves the same thing as we did here, but you have to have a Windows Server 2003 machine handy. You can install Windows XP from a USB drive, but I didn’t have a USB2.0 device with enough space on it available. You cannot feasibly install Windows from a USB1.1 device, because it is too small. You cannot feasibly install Windows from a floppy disk either.
–Ben
* A few times is more like about 10 times … I reinstalled Server 2003 quite a few times on my machine, trying to figure out why it would bluescreen at random points during and after setup. Then I realised that one of the sticks of RAM I had was bad. *smacks head*.
Explore posts in the same categories: Computing
July 15th, 2008 at 2:15 pm
Excellent guide!
You mentioned not to assign a driver letter to the system partition. I followed and finally landed with the installation being done on the setup drive itself. The drive letter was never assigned to the system drive and thats why it never appeared as a drive after the installation.
Would you please suggest at which stage I must name the drive
Thanks
Kapsban