Saturday, March 31, 2007

Broken Windows (XP)

This is probably my fault. Here's what I think happened: the main disk on our Windows XP machine filled up. Windows decided to fix this by deleting some system files. Result: the system won't boot, even in safe mode. Nothing, NADA. Just a list of files that scrolls by so fast you can't see the error message at the top of the list, followed by a blue screen of hopeless and utter despair. I'm not positive that the cause is correct, but the result is. In any case, it's probably my fault as much as Windows, because I wasn't watching disk usage on that machine.

So currently I'm pulling off the files from that disk onto an external USB disk. The idea is to backup everything, restore Windows (which will be difficult, since this is an old machine and the restore disk only comes with Service Pack 1), and then copy over the relevant files from the backup. We'll see if that works.

The immediate problem is to get the files onto the USB disk. Obviously you can't boot into Windows.

So here's the procedure I used. I lifted most of it off the web. Ordinarily I'd link back to where I found the information, but that was late last night, and I was working on a machine which at the time had no internet access. So my apologies to all concerned.

  • First, we need some way to access the computer. A Linux Live CD is the obvious way to go. I had an old version of Knoppix on hand, but it hung up when trying to find the USB ports. I finally got it running in fail-safe mode, but decided that wasn't a really viable option. Since I'm running Ubuntu on my own machine, the choice was to go get the Edgy Live CD. This booted up immediately (where, in this context, “immediate” == 5 minutes). For some reason it couldn't, or wouldn't, use WPA encryption through the wireless card, but it did everything I needed it to do.
  • Except find the disks on the Windows machines. How to do that? Well, the Edgy Live CD has my new favorite command, lshw, which tells you all about the hardware. This says that there is a disk at /dev/hda. I've only seen one partition on this disk, which would be named /dev/hda1. This machine came with XP pre-installed, so we know the partition will be NTFS.
  • This means we have to enable Edgy to read the NTFS disk. We'll work with read-only mode for now, since I believe write access under Linux is a bit flaky. First, go in to superuser mode. Since there's no password on the live CD, just enter the command
    $ sudo -i then load the NTFS module into the kernel with
    # /sbin/modprobe ntfs
  • Now create a mount point for the partition
    # mkdir /mnt/win
  • and mount the disk
    # mount -t ntfs /dev/hda1 /mnt/win
  • But Wait!!! This gives a bunch of error messages, most of which say that /dev/hda1 isn't an NTFS partition. Huh. Since the other dominant file-system in WindowsLand is vfat, try
    # mount -t vfat /dev/hda1 /mnt/win
  • That worked. But what's in that directory?
    ls -l /mnt/win
    Examining the list of files, this seems to be called the Utility Partition. OK. Nothing to see here right now, though maybe it will help us restore things later.
  • Well, logically, if the ntfs partition isn't in /dev/hda1, we should try
    # umount /mnt/win
    # mount -t ntfs /dev/hda2 /mnt/win
  • That works. Now we plug an external drive into the USB port and merrily copy away:
    # cp -rv /mnt/win/* /media/usbdisk

OK, the files are all saved, tucked nicely away on a disk that can be read by any computer. The next step is to try to revive Windows XP on the target machine, or persuade the family that they don't really need to run Photoshop or Maple Story. (Yeah, I know about GIMP, they know about GIMP, and they prefer Photoshop. There's faint hope for Maple Story.)

Sunday, March 25, 2007

Adding a Hard Drive

A few weeks ago, at the same time I bought that 2 GB memory key, I bought a Maxim “200 GB” drive. The 200 GB is in quotes because the drive formats out to exactly 196,907,134,976 bits, which is several bits short of a load even if you believe that 1 GB = 109 bytes. (Actually, of course, 1 GB = 230 bytes.)

So I have this big-but-not-200 GB drive that I want to a) install, b) reformat as an ext3 file system, and c) make my /home directory.

Installing the drive wasn't too much of a problem. It went into the second CD drive bay. Not where it was supposed to go, but then I didn't have a lot of choice. Ideally, the drive should go on the same cable as the original hard drive. Unfortunately, drive cables are only 18 inches, max, and the geometry of the situation is that the second drive would have to be duct-taped to the case to make that work. So instead of hooking up the second drive in series with the first drive, I'm hooking it up in series with the DVD-drive. I suspect that this could cause a performance hit when I'm writing DVDs and CDs. I also suspect that I've just voided the warranty on this Dell, but that's OK, because the machine is now almost four years old, and I think the warranty has long expired.

The other problem with doing things this way is that the drive and drive-bay screw holes are mismatched, so the drive can either be screwed in and lean at an angle, or just sit loosely on the shelf. Since this is a floor-based tower model, I just let the drive sit there. This may cause problems if we ever get an earthquake, but then there's still the duct-tape option.

Anyway, the drive is installed, however precariously. So how do I save it from its Windows formating and convert it into a real disk drive? Follow:

  • First I have to find the thing, meaning, where does the computer think it is. Boot the system, and up comes the drive. Open an xterm, or go straight to the console, and issue the extremely useful command:
    $ lshw
    This gives you a complete description of your hardware. Examining the output, I see that there is a Maxtor 186 (real) GB hard disk at /dev/hdd. (If I'd hooked up the drive correctly it would have been at /dev/hdb.)
  • I got the formating directions from Jeff Hunter. I'll just list the steps I took, and refer you to his page for more information:
    $ su (become root)
    # fdisk /dev/hdd (partition the disk. Use the defaults on Hunter's page)
    # mkfs.ext3 -b 4096 /dev/hdd1 (create an ext3 file system)
  • Now add a new line to /etc/fstab:
    /dev/hdd1  /home2  ext3 defaults   0    2
  • Create a mount point for it:
    # mkdir /home2
  • Mount it:
    # mount /home2
  • Copy the files from /home to /home2:
    # cp -r /home/mike /home2
    (do this for every user directory in /home)
  • The owner of all the files you just copied is root. Fix that:
    # chown -r mike:mike /home2/mike
    (and repeat as needed)
  • Now I want to perform a bit of magic. I want to make /home2 my /home directory. Since I'm not absolutely positively sure this will all work, I'll rename the old /home to /home2 for now. Later I'll delete those files and use that partition for scratch, or another Linux distribution (maybe a “real” one).
    Right now my /etc/fstab file has the lines:
    /dev/hda3  /home    ext3    defaults    0   2
    /dev/hdd1  /home2   ext3    defaults    0   2
    I'm going to edit this so it reads:
    /dev/hda3  /home2   ext3    defaults    0   2
    /dev/hdd1  /home    ext3    defaults    0   2
  • I suppose you could then do:
    # umount /home
    # umount /home2
    # mount /home
    # mount /home2
    but I just hit Ctrl-Alt-Delete and rebooted to get the OS to read the new mount points.

So far no stability issues, no power problems, and a nice big drive.

The Madness of March (Part III)

Some years ago I created a “Top Ten” list called The Top Ten Reasons You Know You're a Jayhawk. The top reason was:

1. You spend a week or two every March crying.

That about sums it up.

I'm trying to install a 200 GB HD for my /home directory. I'll post my experience, good or bad, sometime this week.

Friday, March 23, 2007

The Madness of March (Part II)

If you write something that says Part I in the title, then you've got to do a “Part II”. Unless you're Mel Brooks, of course. So let's talk about last night's Kansas – Southern Illinois game:

God, it was ugly. I know, that's the way SIU plays, and I say “more power to you,” except when I actually have to watch the thing. There was no offensive flow on either side. Bodies flew frequently. No one was seriously hurt because, most likely, he was falling on someone who was already down on the floor.

The officiating contributed to this, I think. Off the ball the game was called very tightly. I don't think I've ever seen so many illegal screen calls in a major game. However, near the ball, you could practically assault people with a pipe wrench and not get a call. This helped SIU more than it hurt, but that's not their fault.

KU did just enough to win. They had a very few near-transition baskets. Several times they tried to score off transition in a 2-on-3 3-on-4 situation, and they'd inevitably get stuffed. SIU did everything that they needed to do to win, except get the ball in the basket two more times. KU was lucky, without a doubt. But just about every winning team needs a bit of luck, so they say.

Maybe this is the year?

Aaagh! I've violated the pessimism rule! We're doomed!

Sunday, March 18, 2007

The Madness of March (Part I)

Well, here I sit, watching the Kentucky-Kansas game on my computer. Currently it's 15-14 for the good guys.

Historically, of course, this series has not been a lot of fun for KU. However, the last two years have been OK. Of course, during the last two years the season ended before this weekend.

(19-19 at the 8 minute TV timeout.)

Anyway, I want to take this opportunity to continue to break all the basic rules of blogging, go completely off topic, and give you one of those bullet-lists of thoughts about the tournament:

  • The ACC, as even Billy “Duke University” Packer, admits today, was over-rated. Duke especially. Seven teams in, only one remains. Of course, if I had my druthers, no league would get more than four teams into the tournament. I mean, really, if you can't finish in the top three/four or win you conference tournament, why should we think you can win the Big Dance?
  • 28-25 KU at the four minute timeout
  • The other 3 number-one seeds had some nervous moments getting out of the second round. Eventually we'll see a number 16 seed beat a number one, and even get into the final four. Things are that balanced.
  • CBS's March Madness On Demand (MMOD) works well on the Linux box, using the mplayer plugin. Oddly, it doesn't work on the Mac, because OS X doesn't support Windows Media Player, and I'm not going to search around for the appropriate plugin. So I'm typing this stuff up on the Mac while I watch the game on Hal. This also allows me to avoid watching when it gets too tense: I just work on this entry.
  • Sports Illustrated picked KU to win it all. Well, I guess I won't have to worry then.
  • 36-30 KU at the half. Kentucky's basically keeping KU from running, and KU had some early frustration charging fouls. Nevertheless, KU isn't playing badly, and Billy thinks UK is getting tired. We'll see. Hopefully KU learned enough from the two Texas games so they don't fold (see the Texas A&M game) if the 'Cats make a run. If you asked me at the beginning if I'd take a 6 point lead at half, I'd have said “hell yes”, of course.
  • KU 54 UK 42 with 14:11 left in the half. No idea how. I spent halftime and the first few minutes of play vacuuming rabbit-droppings off the back porch — don't ask.
  • Irritatingly, the CBS live scoreboard and play-by-play are now about 80 seconds game-time ahead of the video. So I know what's about to happen. Actually, when I think about it, this is a good thing, since I know when not to look.
  • If I was going to really reform the NCAA tournament, I'd let everyone in. Make it like a state high-school tournament. It's almost that way now. Is there a conference that doesn't have a tournament? If not, then the only teams that don't have a final chance at the dance are independents. Even Notre Dame, the most famous independent of them all, plays in the Big East for the basketball tournament.
  • 56-43 at the 12 minute timeout.
  • Another thing I'd do is take the money out of the equation. Teams should only get expenses for the players (plus parents and siblings), coaches (ditto), cheerleaders, band, and a few VIPs (A.D., President, Governor, etc.). All the other money goes into the NCAA pot, and it's divided equally among all the teams in Division I. That way there's not as much pressure to cheat to win. Of course, this has about as much chance of happening as Arnold has of becoming President.
  • One of the irritating things about MMOD on the Linux box is that the mplayer-plugin doesn't play unless it's visible. So I can't move to another area of FVWM's virtual desktop, nor can I completely cover the video part of the browser window. Which is why I'm typing this on the Mac.
  • 64-51 at the 7:38 TO, but Kentucky's at the line. Still waiting for them to make a run.
  • In baseball, it's often the case that the winning team will score more runs in one inning than the losers score in the whole game. Basketball, too, is a game of streaks. I haven't seen a study of it, but I'd guess that in most games the winner has one or more runs where they score 8+ points in a row. It's partly talent, partly luck. The example is the Syracuse-KU title game in 2003, where KU was the superior team, but Carmelo and company kept running off streaks that force Kansas to keep coming back.
  • Scoreboard says that Kentucky only has 6 team fouls to KU's 8, which is a bit surprising, considering UK has so many players in foul trouble.
  • In other games, looks like Texas is going home, which means that Kevin Durant is playing his last college game. He's going to be a great one in the NBA if he gets on a team with some support.
  • 71-56 at 5:46. KU now has 10 team fouls, which Billy and Jim somehow haven't noticed. If Kentucky gets on a run, they get two shoots on all fouls. Of course, the 'Cats show no sign of making a run, but that doesn't mean they don't have one in them. KU hasn't exactly broken away, and a 15-point lead is only a five-possession game.
  • Speaking of Billy and Jim, who decided that Chicago was the prime site this weekend? Not that I don't think so, but doesn't Billy ACC really belongs in Carolina. They aren't really talking about the game, anyway, just the tradition of the teams. Which is fine, but there's a friggin' game going on, and it's not totally out of reach for UK, at least not yet: 76-61 at 4:12, and Randolph Morris has 18 points to go with his three fouls.
  • KU stops a 7-0 Kentucky run (see?) with a Collins FG. 78-63 with 2:52 left. Maybe? I keep flashing back to the 1978 game at Lexington, where KU was ahead by about 6 points with a minute to play, no three-point shot, no shot clock, clock keeps running after a basket — and lost anyway. 6 points/1 minute/old rules < 15 points/3 minutes/new rules. It's still a five possession game, and I don't like KU's historic freethrow shooting.
  • OTOH, now it's 81-66 with 1:50 left. KU basically blew a minute off the clock without losing ground. Not bad.
  • CBS, having learned nothing from the 2000 election, has put KU into the regional finals with 1:32 left. Of course, now it's 83-66.
  • The Chant is going through the crowd. Funny, when I was at KU we never did this during the game. I guess it's sort of like Red Auerbach's cigar.
  • Finally, it's over: KU 88, UK 76. And KU's now 6-19 in the series, with the last three in a row.
  • And they're waving the wheat. Nor more than four more nights of agony left this year.

Well, thanks to all of you that stayed through the whole entry. Sometime next week we'll get back to the Linux part of the blog.

Saturday, March 17, 2007

And We're Back

... from Denver. Actually, I've been back for a week, but I've had a bad cold for all of that time and just haven't been up to posting.

I want to talk about the NCAA tournament (KU plays Kentucky on Sunday, Joy.), but first I want to mention a few things about the trip, which, as you may recall, took me from DC to Denver to Holyrood (KS) back to Denver to DC.

  • The trip started out uneventfully, as I walked up to the United Counter at Former-Republican-President-Capital-City-National-Airport, where I was informed that my flight had been canceled and that I was a really bad boy because I was too late arriving to board the flight which left an hour before my scheduled flight. So they gave me a $58 cab voucher and sent me on my way to Dulles, where I got a direct flight to Denver, meaning I didn't have to stopover in Chicago. It also gave me time to have a leisurely breakfast at Dulles, rather than a quick lunch at O'Hare, so I was more than satisfied. United, I suspect, lost out on the deal.
  • Acre for acre, the flattest country in the world is in — Eastern Colorado. Denver, famously, is 5,280 feet above sea level. So, claims its sign, is a town 100 miles to the east on I-70. (Sorry, forgot the name.) On any 100 mile stretch of I-70 in Kansas you're going to change altitude by at least 1,000 feet. So don't give me any of this flatter than a pancake crap.
  • Nevertheless, I love the plains. When I picked up my rental car at DEN, the clerk looked at my driver's license, saw I was from Maryland, and said, “I lived there, once. Too many trees.” I agree. Between Denver and Salina, when you do get to the top of a hill, even an overpass, you can, indeed, see for miles and miles and miles and miles and miles.
  • Kansas was windy — how windy, you ask? So windy that everyone complained about it. I don't think the wind dropped below 30 mph from Thursday through Saturday. Sunday was a bit better, but I was driving back to Denver, then.
  • Just after you pass the “Denver 100” sign on I-70, you can see Pike's Peak. Impressive. It's only 50-60 miles away, but still. Then you get to see the whole front range all the way into the airport.
  • Denver's not a bad town. 16th Street is set up as a mile-long open mall, and it's reasonably easy to walk. The best restaurants, though, are off of 16th. Ask where they are at your hotel, because if you wander too far off of 16th you get into some pretty rough areas really quickly.
  • Denver has one of the greatest innovations in city planning I've ever seen: the caddycorner cross walk. At busy four-way intersections, once in every stoplight cycle all traffic lights turn red. Then, if you look across to the far street corner, you'll see one of those little white men shinning at you. You're then allowed to walk directly across the center of the intersection to that corner. This cuts down dramatically on jaywalking. I hope other cities adopt the practice.
  • The meeting went pretty well. The session where I gave my talk was populated by old friends, so we had a lot of friendly discussion, back-and-forth, and catfighting. A fun time was had by all, and we might even get a few papers out of the deal.
  • Flying back was surprisingly uneventful, except that I couldn't watch the movie (A Night at the Museum, I believe) because the headphone connection on my armrest didn't work. Oh well, it will be out on pay-per-view shortly, anyway.
  • Of course, the DST time change meant that I went through a 3-hour time change, meaning that I was totally jet-lagged. On top of that, a came down with the aforementioned cold, so I've been completely wiped out for the last week. I only revived about 10 minutes into the first half of the KU-Niagara game, when it became apparent that KU was actually going to get to play on a weekend in March for the first time in three years.

So that's what I've been doing lately. More on basketball tomorrow, and maybe we'll even get to computing sometime next week.