
Today I spent a bunch of time, probably about 12 hours in all given the assorted screwups Windows tossed my way, putting an ailing computer back together for my friends. It’s a family PC, used predominantly by one family member with occasional use from the others. The installation of Windows XP on it had finally taken enough “damage” that it wouldn’t even boot anymore.
The first plan was a fairly simple one:
There’s a reason (a completely shitty one, but a reason nonetheless) Microsoft advises people not to ever bother trying to install Windows XP on anything but a pristine, virgin, blank hard disk: Windows XP crashes and burns horribly if there’s any remnant of a previous incarnation of itself on a disk.
I want to know … nay, I demand to know … how exactly an operating system was constructed like this so that it actually ignores files and data that come along on its own installation to purposely load/use/honor old, very likely broken settings, when it’s explicitly told to install in a new location.
While the reasoning behind a user’s old My Documents folder being inaccessible is at least feasible (it’s still seriously stupid that the default account on a Windows XP Home Edition install doesn’t necessarily have permission to read files created by the default account from a previous installation), it is absolutely and astoundingly idiotic that Windows XP, installed in a location like, say, C:\WINXP, would spontaneously decide “nope, I’m gonna ignore the shiny new registry hive I got installed with, but only for a few settings, mind you, and dig instead into the one I think is in C:\WINDOWS instead.”
Think I’m exaggerating? Here’s what happened:
This round didn’t last long. The new theory:
Well, it couldn’t:
This took awhile, mostly because 802.11b is slow and there was 300MB of data to back up over wireless. However, this round went flawlessly. It went flawlessly because it fucking involved Linux. The plan was, of course, being revised. This time:
Four hours into the project at this point, by the way.
Pay attention here, and read that again if you need to. It took one try to get this thing up and running on Linux to back up shit that even Windows XP itself couldn’t (or wouldn’t) access, for backups or for any other purpose. Also, even though the initial boot was a bit long (5 minutes … yuck), it brought everything with it. It’s a “Live CD,” meaning you can use it as if it were installed. I didn’t have a lame-duck “installer” running … I had the full-fledged operating system purring like a kitten, all from a CD, all auto-detected, and all “just working.”
By now I’d had a refreshing dose of Linux happiness to remind me that yes, computers can actually work right. With the data safely backed up on a computer that was actually being friendly with me (not like that, you perverts
), it was time to clean the slate:
I’m pleased to report that, eventually, this process did result in a “functional” Windows XP-based computer sitting on their desk ready for use. It still took eight fucking hours. Here’s why:
Twelve hours after the ordeal started, my friends finally had a (mostly) usable system again. Overnight it’ll finish downloading the last of its updates and defragmenting its disk, so they’ll be able to start loading applications on it tomorrow and putting it to real, actual use.
It took eight hours and ten reboots to get that machine from “bare metal” to fully-patched Windows XP. That is obscene, and sickening. Also, after those eight hours, the disk was 49% fragmented. It was a 160GB disk, folks, and it had less than 4GB of data on it, yet almost half the files on the disk were fragmented. How the fuck does that happen on a supposedly “production-ready” product (NTFS)?
Just this instant, I started the online defragmenter for my Linux box (running XFS). Low fragmentation (and the volumes are all pretty full, 250GB each, at least three of those, and probably more (I forget and I’m lazy enough that I’m not looking it up right now
)). I’ll note in the text here as we go along when it finishes. I suspect it’ll be in just a minute here.
Eight hours of installing from CD, downloading and installing patches, and rebooting the machine a total of ten fucking times to get it up to Microsoft’s current “standard” platform.
By comparison, I can routinely (and in a repeatable fashion) install Ubuntu Linux (a Debian variant) in under 15 minutes from a CD, have patches for the system downloaded (depending on bandwidth — I’ll use the same bandwidth as was available for this Windows install today for this comparison) in about 45 minutes, and installed in about 10. And the Ubuntu install requires two startups: one boot from CD, and a reboot to bring the main system online. That’s it.
And somehow, even though there may be over a thousand packages to be updated, they each install nearly instantly and seamlessly, so the whole process takes about ten minutes once the download is finished.
I truly don’t get just how Microsoft screwed up their patch system so badly. Ubuntu (Debian) is doing exactly the same basic thing “Microsoft Update” is doing — analyze the current system’s installed files, compare it to the list of new stuff available, download everything that’s changed, unpack and install each archive, running pre-install or post-install scripts as necessary.
Microsoft Update downloads every package it decides it has to download, all at once. So does Ubuntu’s “apt”. Then once they’re all downloaded, Microsoft Update installs each package one-by-one, just like “apt” does.
They both also perform checksum validations on each downloaded file to make sure each one came down the pipe correctly. They both fail gracelessly (Microsoft Update throws an error dialog and forces a browser reload; apt just throws an error and exits back to the command prompt) when a file doesn’t match what was expected.
Why does Microsoft Update take so much damned longer to download each file, though? Apt just tears through the list of every file it needs to suck down, immediately starting each transfer as soon as the previous one finishes. Hell, it uses KeepAlive requests to avoid the overhead of opening and closing connections to the web server hosting the files every time it finishes a file.
Microsoft Update, though, puts on quite a show for every single individual patch it snarfs down:
What preparation is actually necessary? Grab the filename and URI from the server and fucking fetch it! Maybe check disk space beforehand to make sure you’ve got room for the archive. That’s one API call (ask the OS for free disk space available on the path you’re using for temporary storage) and a comparison between two 32-bit unsigned integers (for size), if that. Don’t bother reminding me about 64-bit unsigned integers on 64-bit platforms or systems with big disks (over 136GB if memory serves) — they seem to screw up enough in 32-bit land without stacking another pile of bits on their brainpans.
I also don’t know how they managed to slow down the “verification” process either — you’ve been downloading the damned file, so presumably you could be creating a checksum value as you store pieces of it to disk. Or you could just write it, then read it back from start to finish to generate an MD5 checksum. For even a 90MB file, that should still only take like 6 seconds on a modern system that can read at 20MB/sec off a single disk (gotta include overhead for MD5 checksum calculations).
Somehow apt manages to pull off this check in nearly instantaneous fashion, and does no “preparation” work either. Oh, and even the process of figuring out what to download/update runs much faster with apt than it does in Microsoft Update.
How the hell did Microsoft make this stuff this damned slow? I brought my notebook along today so I could get some of my own work done (not much to do but twiddle your thumbs during those long downloads), but imagine being an IT worker whose job is to rebuild PCs.
The modern corporate IT department does this stuff just once, then they build images of the finished system and deploy that … it takes less time to dump a full disk image to a system than it does to jump through these reinstall hoops all the time. Of course, with Windows XP checking unique volume and system IDs, even with volume licensing, it still bitches if the images aren’t restored just right. And each system ultimately still ends up responsible for its own patches and updates, and is at the mercy of its individual user for getting them installed.
You can do this with Linux, too, of course — it just takes a lot less time. Boot straight over the network if the hardware supports it, or from CD if not; partition the drive, write new filesystems (the newbies call this “formatting”), unpack a tarball (as root) made from the system you built a bit ago, write the bootloader down onto the disk, and reboot. Up you go.
What’s the difference? Hand me a pair of identical, bare-metal PCs with nothing on their disks. Hand me a Windows XP installation CD and an Ubuntu Linux installation CD. In under half an hour, I’ll have a working, stable, up-to-date, patched, ready-to-use workstation up and running with Ubuntu. The Windows installer will still be fucking installing the base system. For the next seven hours, while the Linux box is busying itself with silly tasks like, oh, doing actual work for its user, who is already using the workstation as usual, the Windows box will still be downloading and installing updates. It will still be vulnerable to viral infections until it is protected by a resident scanner. It will still be susceptible to adware and spyware until a resident scanner is installed, along with a competent web browser (like Firefox) that doesn’t just let them all in.
I understand lots of people are tied to Windows because it’s what their employer uses and it’s what their employer makes them use. It’s what people are used to.
People, trust me. Your computers do not have to suck like they do. It’s the operating system they’re running that makes them fragile, flaky pieces of steaming crap, not the equipment.
My desktop just finished defragmenting two 250GB disks, an 80GB disk, and a 120GB disk, in under twenty minutes. My desktop is over five years old, consists of two Pentium 3 1GHz chips, and running a mixture of old and new disks. The 250s are brand new, the 120 is fairly new, and the 80 is growing gray whiskers.
Fragmentation never went above 5%.
Windows fanbois love to complain that in Unix (Linux included), everything is a file. And this is true — a Windows installation may have over 100,000 individual files, while a Linux installation will drop upwards of 500,000 or more files onto the disk for its operation.
How is it, then, that a system this old, with well over a million files (hey, I’m a busy guy), never gets more than 4 or 5% fragmented over years of use, while a freshly installed Windows XP system can generate a filesystem with nearly 50% of its files fragmented?
Don’t mistake this rant for a complaint about the time I spent today, either — I spent it with good, dear friends and had a lot of fun talking/watching Family Guy/Simpsons/American Dad with them.
And finally, please go download Ubuntu Linux and give it a try. You can download it (legally) for free, burn the image to a CD, and boot it to try it out without even installing it on your computer. Note how responsive it is, then realize that whole thing is running entirely from CD. Imagine how fast it would be on the hard disk in your computer. Back up your data from Windows (to an external drive, CDs, tape, network, anything), and install Linux instead. After a day or two of learning how to get around and do your daily work with it, you’ll never even look back. I promise.
Any sufficiently advanced technology is indistinguishable from a rigged demo.
— Andy Finkel, computer guy
Note that Bill Gates hasn’t had a successful “rigged demo” since Windows 95 — both Windows 98 and Vista choked on him during keynote speeches and demos. Heh.
Comments
Post new comment