December 14, 2004
Booting Windows XP off of a Compact Flash Card
With the cost of solid state disks like Compact Flash and USB thumb drives coming down in price, they have become an attractive option to use as a replacement for hard drives on home entertainment PCs. They are noise free and generate very little heat. This article describes how I was able to get BeyondTV Link, a .Net application, running Windows XP Home using an inexpensive compact flash card. As a disclaimer, please not that your mileage may vary when doing this procedure so please don't blame me if things go badly, your spouse leaves you, and/or your dog bites you as a result of this article.
My first attempt was to do this with a USB thumb drive, given the motherboard I was using, a Via Epia M10000, has an option in BIOS to boot to a USB drive. After many failed attempts and investigation, I believe Windows XP does not support booting off of a USB drive no matter how much wishful thinking, so I took an alternative road using a compact flash card and an IDE adaptor. Please let me know in the comments if you have found a way to get USB drives to boot into Windows XP.
I used a cheap 1 gig Compact Flash card but depending on your skill level and tolerance of repeated attempts, I believe this can be done on a 512MB card as well. BeyondTV Link (and the associated Firefly remote software) use .Net which increases the disk usage significantly, so if you are using a different application, I think 512MB is adequate. I also used a compact flash ide adaptor which is pretty easy to find both online and at electronics stores.
I used two applications in the process. One I think is essential to the cause for anyone who isn't an expert, XPLite from the LitePC.com, a very handy application that will help you remove components from the Windows OS. The other is Partition Magic, which makes it easy to resize and copy one hard drive to another. I believe there are open source projects that can do some of this, but I find Partition Magic easy and dependable so it's worth the cost to purchase it.
Step 1 - Build system using a hard drive
Windows XP Home requires a minimum of 1.5Gigs of hard drive space, so the first step is to build the system using a standard hard drive. I created a partition of 2 Gigs but found it inadequate to installing Service Pack 2, so I suggest putting the OS on a 3 Gigs or bigger drive to start. I installed a fresh copy of the OS using NTFS since it has a handy "compress files" option which I use later. I then added the VIA drivers and spent a good deal of time in Windows Update getting all the latest patches. I also installed BeyondTV Link and the Firefly Remote software. I then verified everything was working properly. At this point, it wouldn't be a bad idea to back everything up using a tool like Partition Magic in case you need to come back to this point (I learned this the hard way)
Step 2 - Turn off Virtual Memory
The first thing you’ll want to do is turn off virtual memory so it doesn't create a paging file on the drive. This can be found by right clicking "My Computer" and selecting "Properties". It's under the Advanced Tab, buried in another dialog by selecting the "Settings" button under Performance. From there, it's under yet another "Advanced" tab and it's labeled Virtual Memory. Make sure that when you select "No paging file" you hit the "Set" button or it won't actually adjust the settings.
Step 3 - XPLite from LitePC The next step for me was pruning back the OS using XPLite from LitePC. The first thing you should do is "disable" Windows File Protection in the aptly named "Window File Protection" tab. If you don't, you'll find windows constantly complaining about missing files. I removed most components including those Advanced Components you can get to show up by changing the default settings. Be careful though, since you'll likely remove the System Restore feature which gobbles up a lot of space, but prevents you from doing something completely irreversible. See our review on XPLite for more information on how to use the product. Make sure you reboot a couple times afterwards to remove any system restore points.
Step 4 - Clean up
The next thing I did was to boot into Windows Safe Mode (hold down the F8 key) to do some basic clean up of the system. Make sure you have changed file explorer to show hidden and system files. This can be found in the "Folder Options" menu in the "View" tab. Your final system will likely be different from mine, but here are a few good things to remove or change to get more disk space:
- Delete anything in the Windows directory that starts with $NTUninstall.
- Delete anything I the Windows/SoftwareDistribution/Download directory.
- On larger directories, go to the properties dialog and select the "Advanced" button and pick "compress contents to save disk space". Note that this is only available if you formatted your drive using NTFS. I did this to the following folders: Program Files, Windows/Microsoft.NET, Windows/.inf, Windows/system32.
Doing just that, I got the system down to 750MB or so. Being more aggressive, at one point I had a working system under 500MB.
Step 5 - Resize and Copy
I ran the floppy boot disks for Partition Magic to resize and move the OS to the compact flash card. Make sure you resize the hard drive partition small enough to fit the compact flash card, and then from within Partition Magic, copy the drive over to the compact flash drive.
Final Step - Remove original Drive and put Compact Flash Drive in its place
The final step is to remove the original hard drive and switch the connectors so it puts the compact flash drive in its place. Make sure it's in the same location on the ID Bus (e.g Master Drive, Primary IDE channel) or you'll quickly run into a "NTloader is Missing" error. With any luck, it will boot up as it did before, albeit a lot more quietly than that squeaky old disk you were using before.
UPDATE: Based on a comment from Andy, I want to point out that Compact Flash speeds vary greatly, as this article points out. This is considerably slower than a typical IDE hard drive. In my test with BeyondTV link, I found the difference in speeds neglible; a few seconds slower booting and launching the application, but the application itself operated as fast as before. This would not be the case if the application you are using does a lot of disk i/o.
I also have 512MB of RAM, making it much easier to run without a paging file. If anything my system, while still running from an IDE hard drive, ran more quickly when I turned off virtual memory. I've read that applications like Adobe Photoshop make good use of virtual memory, so depending on the app, it could also have an impact of performance.
UPDATE 2: This article has been reprinted at eHomeUpgrade.com and commenter Jaxun brings up another point to consider in regards to solid state devices; each sector has a limited number of rewrites before the sector goes bad. In an article he link to in his comment, Tundraware.com states:
"Although many flash memory products automatically map bad blocks, and although some even distribute write operations evenly throughout the unit, the fact remains that there exists a limit to the amount of writing that can be done to the device. Competitive units have between 1,000,000 and 10,000,000 writes per sector in their specification. This figure varies due to the temperature of the environment."
When I have a bit more time, I'll try to determine how many writes my system does during typical usage running BeyondTV link to estimate the life span of the card, but it's yet another thing to consider when building a similiar system.
Posted on December 14, 2004
TrackBack URL for this entry:
Great post, always thought and wanted to do this kind of thing, just wondering, what kind of performance gain/lost do you get using a CF instead of a Hard Disk?
Posted by: Andy at December 16, 2004 11:46 AM
Andy, you bring up an excellent question. I added an update to the column, but it should be pointed out that Compact Flash, in general, is a slower medium than a typical IDE drive. I have added a link to a column comparing Compact Flash cards, and the cards themselves vary significantly speed-wise.
I found booting perhaps slightly slower and launching the application seemed a bit slower as well, but once loaded into memory, BeyondTV Link behaved as fast as before (perhaps even a bit quicker since virtual memory was turned off and litepc strips off a lot of system processes). I think a lot depends on the apps you will be running; things that require a lot of disk i/o will be impacted by performance but client software that accesses network resources won't feel much impact as well.
Posted by: Will at December 16, 2004 01:02 PM
Tell me is there any reason to stop you using a microdrive CFII card instead of a flash card. There would then not be a limit due to the number of writes. There is also the speed of microdrives, although not as fast as the best flash, it is higher that that of flash cards of a similar price/MB.
You also get a bit more storage for useful apps, on a 2.2GB microdrive at least.
Posted by: Tim at December 23, 2004 03:47 PM
You have the option to get rid of components at install time using WinNT.sif file on a floppy.
Posted by: at December 23, 2004 11:43 PM
Would you happen to know it it is possible to boot from a compact flash card inserted in one of those pcmcia Memory Adapters on a laptop?
I own a 701c ibm thinkpad (butterfly) with no hard drive floppy or cd.
Posted by: Tudor at December 24, 2004 01:11 PM
I don't know much about microdrives, but it sounds like a good solution. If you get one that is 2Gigs or bigger, you can install XP directly without monkeying around to get the whole thing to fit. I'd still recommend turning off virtual memory because the drive speed would likely make it counterproductive for performance.
Posted by: Will at December 24, 2004 03:57 PM
I think you'll have trouble accomplishing that. Particularly if you are running linux, you might be able to boot off of a floppy and then finagle it to load it off a pcmcia card, but it would probably take some effort, and like you pointed out, you don't have a floppy for it. I noticed a floppy for sale on eBay for $10 FWIW.
I'm sure you saw this page called Cyrus's 701 Page, which seems to have some good info on that particular computer (I hadn't heard of that particular laptop, it sounds pretty cool). Your best bet might be scouring ebay in search of a docking station for it which would give you some more flexibility.
Posted by: Will at December 24, 2004 04:08 PM
Here's the link to the 701 page:
Posted by: Will at December 24, 2004 04:09 PM
Great tutorial, have you tried using EWF from XP CE which will stop writes to the compact flash card and leave the card in a Read-Only state, and if changes need to be made to the operating system it can be disabled and then re-enabled very easily. I am using this on a hard drive at the moment for my car pc.
Posted by: Aminder Athwal at April 1, 2005 01:28 AM