My experiences with Windows XP on USB stick (and Linux)
Posted: Thu Mar 22, 2007 3:04 pm
I really got started about putting my system on an USB stick because my current 2,5" Fujitsu ist the "loudest" piece of my PC.
Around 1 - 1,5 years ago, the internet learned that booting Windows XP from USB is possible. I used www.usboot.org for my experiments, which basically sets everything up and leaves some choices to you. Thank you to Gerd Rös for his great work and providing it for free at the moment!
Now let's look at the decisions to make.
FAT32 vs NTFS
NTFS would be great because of the reliability and security. But when I checked the writes and saw 1-2x more writes compared to FAT32 because of the jounaling and more management. One can block the writes with EWF, but this would require to flush contents from RAM to disk every shutdown. On reset or power outage, your changed (system partition) data is lost. I tried EWF on my setup with 2 primary partitions and is chrashed on flushing with a bluescreen. This left FAT32 as the only option.
Here a post about reducing writes. Additional, you can move the browser cache, the TEMP directories and disable NtfsDisableLastAccessUpdate.
Standby and hibernation
This is NOT possible without hacking!
Every USB mass storage device has some configuration bits set, which describe it as "removable". Every manufacturer has a utility which is able to change this to "fixed disk", but they are not available for the public. There exists an utility for the older Ultra-II and Extreme I CF cards.
There are existing filter drivers e.g. from Hitachi, which fools Windows to think the disks are fixed, but standby and hibernation still does not work.
Page file
Though not recommended because of the writes, USBoot provides experimental support for page file on USB.
CF vs USB stick
Since the fast CF mediums can't be set to "fixed disk" and USB sticks are a lot cheaper and portable. So the decision was easy
CF and RAID
Tough it is possible to use 2+ IDE/SATA adapters and use RAID 0, there are many incompatibilities. One advantage of RAID is, that Windows sees the drives as fixed. On the 3DCenter.de forum someone got 4x PowerRAM CF cards working (40 MB/s) with NTFS, Transcend Sandisk Extreme III failed to boot. Compatible host adapters: Promise FastTrak TX4310 PCI and Promise FastTrak S150 TX4. Not working: Promise FastTrak SX4300 8x RAID PCIX, nForce4 and VIA chipsets.
Formatting
I use the "HP USB Disk Storage Tool" which offers FAT32 and NTFS. My revision is SP27608.exe. Once formatted, I boot Knoppix and set the partition to active then I copy the data with USBoot.
Portability
USBoot tries to make it as portable as possible. In step II, you have to decide wether to use your default HAL with multi CPU support or an older HAL to support PCs without APIC.
Speed
The installation of the USBoot filter driver ("driveguard") gave a write speed boost. Don't know why, though.
My sticks are a Buffalo Firestix-R 4 GB and a Buffalo Firestix-S 1 GB for all my applications which don't rely on a particular Windows installation.
Some basic benchmarks for the Firestix-R.
read access time: 0,5 ms
write access time: 17 ms
sequential read: 32 MiB/s
sequential write: 19 MiB/s
c:\program files -> read: ~12 MiB/s
c:\program files -> write: ~5 MiB/s
very small files read: 1,5 MiB/s
very small files write: ~1 MiB/s
The Firestix-S was examined here by xbitlabs.com.
Boot time is double the time compared to the hdd, but this seems to be specific to my PC and USBoot since it needs ages to show the Windows XP splash screen. On other PCs it's about as fast as the hdd.
Bottom line
For 70 EUR I have Windows XP (thanks to nlite!), all my programs and my dokuments on USB and can switch off the hdd as described here. Disadvantages are no standby, and no NTFS.
Questions are welcome
Linux
The missing standby/hibernation and the missing security because of FAT32 caused me to switch over to Linux. I installed Ubuntu 6.10 on my 4 GB stick and it worked right out of the box. Ok one problem: You have to add "rootdelay=5" (or more) to the kernel boot line, since the USB device discovery is a seperate thread and has a builtin delay which causes the kernel to miss it's root device.
I used ext2 and mounted /tmp and /var/log to tmpfs. You have to recreate the directories in /var/log on every reboot by a script. When you have more than one stick in your PC there is some sort of race condition. The device name the device gets assigned is different on reboots (sda, sdb), so you have to adjust the root device. Perhaps there is a switch letting the kernel search for root on several devices.
When my hdd is switched off with hdparm, it stays off. This is an improvement compared to Windows (see above).
Around 1 - 1,5 years ago, the internet learned that booting Windows XP from USB is possible. I used www.usboot.org for my experiments, which basically sets everything up and leaves some choices to you. Thank you to Gerd Rös for his great work and providing it for free at the moment!
Now let's look at the decisions to make.
FAT32 vs NTFS
NTFS would be great because of the reliability and security. But when I checked the writes and saw 1-2x more writes compared to FAT32 because of the jounaling and more management. One can block the writes with EWF, but this would require to flush contents from RAM to disk every shutdown. On reset or power outage, your changed (system partition) data is lost. I tried EWF on my setup with 2 primary partitions and is chrashed on flushing with a bluescreen. This left FAT32 as the only option.
Here a post about reducing writes. Additional, you can move the browser cache, the TEMP directories and disable NtfsDisableLastAccessUpdate.
Standby and hibernation
This is NOT possible without hacking!
Every USB mass storage device has some configuration bits set, which describe it as "removable". Every manufacturer has a utility which is able to change this to "fixed disk", but they are not available for the public. There exists an utility for the older Ultra-II and Extreme I CF cards.
There are existing filter drivers e.g. from Hitachi, which fools Windows to think the disks are fixed, but standby and hibernation still does not work.
Page file
Though not recommended because of the writes, USBoot provides experimental support for page file on USB.
CF vs USB stick
Since the fast CF mediums can't be set to "fixed disk" and USB sticks are a lot cheaper and portable. So the decision was easy
CF and RAID
Tough it is possible to use 2+ IDE/SATA adapters and use RAID 0, there are many incompatibilities. One advantage of RAID is, that Windows sees the drives as fixed. On the 3DCenter.de forum someone got 4x PowerRAM CF cards working (40 MB/s) with NTFS, Transcend Sandisk Extreme III failed to boot. Compatible host adapters: Promise FastTrak TX4310 PCI and Promise FastTrak S150 TX4. Not working: Promise FastTrak SX4300 8x RAID PCIX, nForce4 and VIA chipsets.
Formatting
I use the "HP USB Disk Storage Tool" which offers FAT32 and NTFS. My revision is SP27608.exe. Once formatted, I boot Knoppix and set the partition to active then I copy the data with USBoot.
Portability
USBoot tries to make it as portable as possible. In step II, you have to decide wether to use your default HAL with multi CPU support or an older HAL to support PCs without APIC.
Speed
The installation of the USBoot filter driver ("driveguard") gave a write speed boost. Don't know why, though.
My sticks are a Buffalo Firestix-R 4 GB and a Buffalo Firestix-S 1 GB for all my applications which don't rely on a particular Windows installation.
Some basic benchmarks for the Firestix-R.
read access time: 0,5 ms
write access time: 17 ms
sequential read: 32 MiB/s
sequential write: 19 MiB/s
c:\program files -> read: ~12 MiB/s
c:\program files -> write: ~5 MiB/s
very small files read: 1,5 MiB/s
very small files write: ~1 MiB/s
The Firestix-S was examined here by xbitlabs.com.
Boot time is double the time compared to the hdd, but this seems to be specific to my PC and USBoot since it needs ages to show the Windows XP splash screen. On other PCs it's about as fast as the hdd.
Bottom line
For 70 EUR I have Windows XP (thanks to nlite!), all my programs and my dokuments on USB and can switch off the hdd as described here. Disadvantages are no standby, and no NTFS.
Questions are welcome
Linux
The missing standby/hibernation and the missing security because of FAT32 caused me to switch over to Linux. I installed Ubuntu 6.10 on my 4 GB stick and it worked right out of the box. Ok one problem: You have to add "rootdelay=5" (or more) to the kernel boot line, since the USB device discovery is a seperate thread and has a builtin delay which causes the kernel to miss it's root device.
I used ext2 and mounted /tmp and /var/log to tmpfs. You have to recreate the directories in /var/log on every reboot by a script. When you have more than one stick in your PC there is some sort of race condition. The device name the device gets assigned is different on reboots (sda, sdb), so you have to adjust the root device. Perhaps there is a switch letting the kernel search for root on several devices.
When my hdd is switched off with hdparm, it stays off. This is an improvement compared to Windows (see above).