Wednesday, May 18, 2005

Windows 98 and Wi-Fi / WPA encryption

So, it turns out that my Linksys Instant Wireless Network Card (WPC11 ver.3) does not support 802.11b WPA encryption under Win98; only 2000 and XP. There is a free WPA add-in program for 98 available from Wireless Security Corporation, but so far I haven't been able to even get my wireless adapter to see the access point with or without it (unless I set it to flawed WEP encryption).

I'm thinking I might just upgrade to Windows 2000 to get better support and avoid this junk of not being able to get WPA to work. Further updates as discoveries/conditions warrant.

Update 11:00PM: I did get my laptop to connect at last using WEP (but not WPA). I had to uninstall the Wireless network card (I also uninstalled the wired network card, but that's probably irrelevant), reboot, install the drivers with the card out of the machine, then insert the card after the drivers were installed. I also installed a 98 networking hotfix, but I don't have the number handy right now - will post it later.

I noticed I had to set the access point to broadcast the SSID; otherwise the Linksys Wireless Configuration Utility couldn't connect to the AP, even if it had been connected a moment ago. For the time being, I've restricted wireless access to the MAC address of my wireless card, but that just means that the wireless AP will reject any communications from other cards; my communications are still out there, protected by inherently insecure WEP encryption, and readable by anybody willing to do some wireless packet sniffing. Maybe I'll just run an encrypted VPN session through the WAP to one of my wired desktop computers.

Sunday, May 15, 2005

Gradual Hard Drive Failure

I have two matching Maxtor DiamondMax Plus 40 7200RPM ATA-66 30GB hard drives that I've been running for a little over five years now. Just last night, I was running into some problems with one of them - Windows 2000 was refusing to upgrade it to a dynamic disk, and kept giving me a LDM Configuration Write Error (iirc). So I copied all my data over to the other one and tried reformatting the first one - didn't do any good, but it's a good thing my data was able to copy over.

I downloaded and ran Maxtor's PowerMax drive-testing utility on the flaky drive, and I didn't find anything until I ran the complete test, at which point it reported that it had found bad sectors, the drive was failing, and gave me diagnostic code ce97917c. I then tried doing a complete low level format on the drive, which took half the night. When I got up in the morning, it had finished the low level format. Running another complete scan on it didn't turn up any errors this time.

So I rebooted into Windows 2000, and tried to write a signature to the drive in preparation for upgrading it to a dynamic disk and writing partitions to it. It wouldn't even write the signature. However, I was able to run Simpli Software's HDTach3 on both drives, and then superimpose the graphs. The results are interesting...


(click image to enlarge)

...Guess which graph belongs to the failing drive. :)

Monday, May 09, 2005

Restoring Athene to Operational Condition - Mirroring Disks

Athene, the computer I tend to do most of my work on, had a problem with its OS hard disk - it had been making a progressively louder high-pitched whining noise over the past couple of weeks. The noise was most noticeable at night when I was going to sleep. This weekend I decided to replace its hard disk with a "new"* Micropolis Tomahawk 4345AV 4GB 7,200-RPM SCSI HDD I had lying around. It turned out to be a bit trickier than I expected.
* - New to this computer, anyway.

Note: this is a two-drive system, with an 8GB IDE drive C:, and a 2GB SCSI drive D: (before I upgraded it), running Windows 2000. Drive C: is considered a "System" disk by the OS, but drive D: is the "Boot" disk according to the OS. IDE devices get lettering priority over SCSI devices, at least on my systems.

To avoid reinstalling my operating system and all my programs, I decided to mirror the operating system to the new drive using PowerQuest DriveImage 2002. I installed the new drive as SCSI ID 2, leaving the OS drive at ID 0 for the time being, booted up, and started the mirroring process (direct disk-to-disk copy). It required a reboot, since it couldn't mirror the OS drive if it was in use (DriveImage was installed on another drive in the system).

Everything seemed to go fine with the mirroring process, but when I booted up again, the new (destination) drive was blank. So I tried to create an image file from my operating system disk. This time, it gave me a CRC error 98% of the way through the process of creating the mirror. After extensively checking the destination disk, and finding nothing wrong, I decided to sleep on it. I should mention at this point that the old (source) disk actually had a dent in it from falling off a shelf in storage.

The following morning, I decided to check the old disk using the SCSI host adapter's built in surface scan. It turns out that the old disk had a few bad sectors within 98% of the end of the disk. I remapped those, tried DriveImage's disk-to-disk copy again, and lo and behold, it worked! I had assumed that DriveImage would be more robust and check the source disk for errors and work around them if so - apparently that is not the case.

I verified that I could see the mirror image on the new disk when I loaded up Windows, so I removed the old disk and tried to boot off the new disk at SCSI ID 0 - but it didn't work. Hmm. Checking with PartitionMagic 6.0 (iirc) for DOS, it turned out the partition was hidden. I tried to unhide it, but PartitionMagic reported "Error 627 Drive geometry obtained from windows environment does not match that seen from boot mode" or something like that. I've run into this problem in the past and I haven't seen any solutions to it using PartitionMagic, except perhaps to upgrade.

However, while searching, I ran across this thread that mentioned using a free utility called Gdisk to unhide the partition. I downloaded it and ran it from a DOS bootdisk using first the /? switch for a listing of commands, then /STATUS to see the drive listing, which told me that disk 2 was the SCSI drive. Running "Gdisk.exe 2 /status" showed me the partition info for disk 2, and I found out that partition 2 was the NTFS partition (yes, I had another partition on the disk - more on that in a moment). Finally, running "Gdisk.exe 2 /-HIDE 2" (the first number refers to the disk, the second to the partition) unhid the partition, and lo and behold, it worked perfectly! Take that, PartitionMagic for DOS!

Then I tried to boot again, and it still didn't work. Remember that other partition I mentioned on disk 2, partition 1? It was a 500MB Primary partition I'd created for a swapfile on the disk, before the 3.5GB I intended as my main partition, completely forgetting that the computer would be expecting the first Primary partition to be the one with the OS. So, once I realized this, I loaded up fdisk (I probably could have used Gdisk again, but I'm more familiar with fdisk), and deleted the 500MB Primary partition. Upon rebooting, it found the 3.5GB Primary partition that had been mirrored (and resized) from the other disk, and the operating system began loading. Oh, happy days!

At this point, I had everything working again, but I wanted my high-performance beginning-of-hard-disk swap partition, so I created a 500MB Extended partition at the beginning of the disk, with a ~500MB Logical drive inside it for the swapfile. Rebooting convinced me that this worked fine (since the bootloader skips over Extended partitions to the first Primary partition when looking for an operating system).

Tip: if you already have your disk formatted and software installed, you may be able to use Powerquest PartitionMagic, if you have a copy, to move the partition up a bit, and free up some space at the beginning of the disk to create a swapfile partitition. I can rarely be bothered to plan ahead, so I usually do this.

Then, it occurred to me that I could have two 500MB partitions, one at the beginning of my 8GB IDE disk and one at the beginning of my "new" 4GB SCSI disk, and stripe the two partitions together using the Disk Manager under Win2K (right-click My Computer -> Manage -> Disk Management). I just had to convert both drives to Dynamic disks. I did that, and I was able to create a new Striped volume between the two disks (with 256K cluster size, if you're curious - I figure it's a big swap file, and hard disks read faster in larger chunks), assign it drive letter W:, and put a near-1GB striped RAID 0 swapfile on it.

So, there you have it. If you're running into problems with PartitionMagic for DOS, try Gdisk. Want an unfragmented swapfile? Give it its own partition at the beginning of the hard disk.