Archives

Windows Vista crcdisk.sys – System Won’t Boot

I recently had a friend call me in need of computer repair assistance. I’ll save you the many hours of troubleshooting and simply list the fix here.

The Dreaded crcdisk.sys

I found this symptom of the problem by booting into Safe Mode and watching the drivers load. I noticed that it always hung for a long time on the crcdisk.sys file. Well, if you perform a search on Google for “windows vista crcdisk.sys” you will find a plethora of woes from computer users desperately trying to regain the functionality of their PC. There are also a plethora of fixes, advice and this worked for me posts. I tried many of these to no avail.

The Road To Recovery

The laptop I was working on was a Toshiba laptop and it had a system restore disk. Great! Sort of. Restoring the system to factory condition from the disk (after the owner had backed up their data of course) resulted in a system that was broken and still had the problem listed above. Hmmm.

Another operating system perhaps? I installed Windows XP from scratch. Worked great. I installed Windows Vista SP2 from scratch (another disk). Worked great. Re-tried the system restore from Toshiba. No good.

At this point I figured I was just going to install Vista from scratch. So I reinstalled Vista and downloaded the Toshiba drivers from their website. One by one I started installing the drivers. Until I got to the driver for a flash media card reader (front of laptop). Bam! It froze up during the install. So I rolled that change back using Windows System Restore and then continued with all of the other drivers. No problems. I tried the flash media driver one more time just to be sure, and sure enough it failed again. That’s good! Predictability is key in diagnosing computer problems.

Continue Reading

Building ChromiumOS (The Google OS)

googlechrome1
I’ve been watching all of the hype about downloading and running the latest Google creation, ChromiumOS this week so yesterday I decided to take a stab at it myself. I did not however want to simply grab a VMWare image and run it. I’m a software engineer for Pete’s sake! I should build it myself. So how did it go? Read on.

System Preparation

First I upgraded my Ubuntu installation to the latest release (9.10 – karmic), which is actually the suggest/preferred build environment for ChromiumOS. Following that I checked the system requirements and made the appropriate adjustments. msttcorefonts did not show up in the Synaptic Package Manager so I just ran the following command and that did the trick:

freetype-dev was also not listed but I had libfreetype6-dev installed and figured that would cover it.

Next I installed version control clients Subversion and Git. I followed that up with installing the Google Chromium Depot Tools. This is basically a group of scripts that Google uses to managing syncing the code repositories and whatnot.

Obtaining the Code

Next I grabbed the code for the Chromium browser. This is actually optional and you can just download a binary instead, but since I’m going this route I figured I’d go all the way. You can follow the instructions here, which include download a huge tar ball that includes the code, extracting it and then syncing the code with the online repository. The first time I synced:

I received some warnings about third party libraries that were no longer a part of the client so I removed them as suggested. Then I remembered that there was a specific way to run the sync when building the OS so I reviewed the website and re-ran the sync (which I would have done anyway since I modified the code base by removing some directories):

.
So I ended up with the Chromium code base in /usr/local/chromium.

Next I needed to grab the ChromiumOS code, so I created a directory for that at /usr/local/chromiumos and grabbed the code like this:

Now obviously you wouldn’t be able to run the above as a normal user, you’d need to sudo right? I actually created the directory initially using sudo and then gave my local user ownership of the directory to complete the rest of the steps.

Now the code sync ran for about 10 minutes and then ended in errors. Uh oh… this isn’t looking good if I have errors in the check out phase. The error was:

After that it appeared to try and get an alternates list and recover but it was unable to do so. I figured since it was trying to recover then there might be a good chance that running it again would solve the problem. So I reran the sync and it got a little farther before it stopped with failures. Then on the third run it finally grabbed all of the code. I guess the third time really is the charm!

Building Chromium OS

The steps in the build process are all pretty straightforward and I didn’t have many problems. Initially if you are going to build the browser portion, you do that before building the OS. During this phase I actually ended up in an infinite loop. After going back to the docs I set the following environment variable:

and that fixed the problem.

Then the building… and building… and building… process took a looooonnnng time. Other than that it was pretty uneventful.

Running Chromium OS

Having gone all the way through I now had a VMWare image of the Google Chromium OS. Awesome! So how did it run? I’m not exactly sure. I was able to create a VM for it and attach the image and boot it up. After that I get the login screen. I put in my Google account login credentials and then…. nothing. I just get a blank blue screen with nothing on it and no activity. I’ll admit, it really is a nice shade of blue but generally I’d like a little more functionality in my operating system. Anyway, I guess I did something wrong or I am running it in some way that is incompatible. I’ll try to figure that one out and post the results as soon as I can.

Revolution OS – The Linux Story

Revolution OS is a 2001 documentary which traces the history of GNU, Linux, and the open source and free software movements. It features several interviews with prominent hackers and entrepreneurs (and hackers-cum-entrepreneurs), including Richard Stallman, Michael Tiemann, Linus Torvalds, Larry Augustin, Eric S. Raymond, Bruce Perens, Frank Hecker and Brian Behlendorf. The film begins in medias res with an IPO, and then sets the historical stage by showing the beginnings of software development back in the day when software was shared on paper tape for the price of the paper itself. It then segues to Bill Gates’s Open Letter to Hobbyists in which he asks Computer Hobbyists to not share, but to buy software. (This letter was written by Gates when Microsoft was still based in Arizona and spelled “Micro-Soft”.) Richard Stallman then explains how and why he left the MIT Lab for Artificial Intelligence in order to devote his life to the development of free software, as well as how he started with the GNU project. Linus Torvalds is interviewed on his development of the Linux kernel as well as on the GNU/Linux naming controversy and Linux’s further evolution, including its commercialization. Richard Stallman remarks on some of the ideological aspects of open source vis-á-vis Communism and capitalism and well as on several aspects of the development of GNU/Linux. Michael Tiemann (interviewed in a desert) tells how he met Stallman and got an early version of Stallman’s GCC and founded Cygnus Solutions. Larry Augustin tells how he combined the resulting GNU software and a normal PC to create a UNIX-like Workstation which cost one third the price of a workstation by Sun Microsystems even though it was three times as powerful. His narrative includes his early dealings with venture capitalists, the eventual capitalization and commodification of Linux for his own company, VA Linux, and ends with its IPO. Frank Hecker of Netscape tells how Netscape executives released the source code for Netscape’s browser, one of the signal events which made Open Source a force to be reckoned with by business executives, the mainstream media, and the public at large. (this text is available under the terms of the GNU Free Documentation License)

This is the full length feature, so block off some time or bookmark it if you want to watch the whole thing. Enjoy!

* Click through to the site if you cannot see the video

How Can I Recover My Lost MySQL root Password?

Many people use the MySQL open source relational database server. Mostly for websites, but I’ve also seen it used elsewhere. One problem that I recently ran into with my local development installation is… “what was my root password again?” Aaaggghh!

OK, sorry. Don’t panic; it can be recovered. A quick survey of the internet and I found this very simple and very useful how-to Recover lost MySQL root password mini-HowTo. Is is very well written and easy to follow… but, it only covers the process from a Linux installation. The basic trick here in either platform is to restart your MySQL server in and tell it to skip the grants table. So here is my addition on the Windoze platform.

Recover Your Lost root Password In MySQL (Windows)

  1. Stop the MySQL server
    1. You can accomplish this by opening the Services control panel applet, finding the MySQL service listing and clicking the Stop icon.
    2. Alternately you can open up the command line and type > net stop MySQL
  2. Start the MySQL server and skip grants
    1. Go to the MySQL installation directory and then the \bin directory under that (in the console)
    2. Type > mysqld-nt --skip-grant-tables
    3. Now the MySQL server should be running wide open (ie. every user that logs in has full access)
  3. Change root password
    1. Now from another console open the mysql client
    2. Run the following SQL query replacing the dots (…) with your new password
  4. Flush the privileges
  5. Quit mysql
  6. Stop MySQL server
    I tried actually doing a CTRL-C in the console that was running mysqld… but that did not work. So I just opened up the handy-dandy task manager, found the mysqld-nt.exe listing and clicked on it and finally clicked the End Process button
  7. Restart MySQL server normally
    1. You can accomplish this by opening the Services control panel applet, finding the MySQL service listing and clicking the Start icon.
    2. Alternately you can open up the command line and type > net start MySQL

There you have it! All should be well in the world once again and you should now be able to login to MySQL with your new root password. If not… umm… reinstall? lol

How Can I Tell If My Bash Script Is Already Running? – Part 2

Master LockIn my first posting on this topic I outlined a manual method by which you could code Bash scripts to check to see whether or not an instance of the script was already running. This is very useful in scripts that might cause adverse affects if more than one instance runs at the same time. I have since started using a built-in Linux command to accomplish this in a much easier fashion. The command I’ve started using is called flock. This simple command creates and maintains file locks from scripts and/or the command line. So now I can do something like this:

So what does this do? Well, the -x option tells flock to create an exclusive lock. On what? On the lock file you specify: /var/lock/myscript. The -n option tells flock to exit if it cannot not obtain a lock, instead of waiting to acquire one. The last argument is the script or command that you want to run while holding the file lock. Pretty easy, right?

Finally, you may not actually have the flock command in your Linux distribution. One of my Linux servers did not have it while another did. The CentOS server that I run has it listed under the util-linux package. Of course the server that did not have the flock binary had the flock function call in a C header file, so if I were motivated enough I imagine I could right a flock program for that server (or compile one from source obtained from elsewhere on the internet).

Arbitrary Command-Line Arguments In Bash

Have you ever wanted to be able to process an arbitrary number of command-line arguments in your Bash scripts? Well, fear not! It is actually quite easy. All you need is one of the special built-in variables of the Bash shell. The “$@” variable gives you the parameters passed on without any expansion and seen as separate words. This means you can iterate through them without much fuss.

The first part of this script uses the “-z” test to see if the first positional command-line argument is null. If it is then the script simply outputs a usage statement and exits with a non-zero return value. Otherwise the script goes into a for loop which simply outputs the value of each command-line argument in turn. Notice I also used the “$#” internal variable which simply gives you the number of command-line arguments passed.

So as a side-note I could actually have used this variable to test for the existence of command-line arguments instead of “-z”. I would just do it like this instead:

Well, happy Bashing!

Bash Script To Backup Your Website

I thought I’d share another one of my personal scripts. This one is a script that I use to backup this website including files and the MySQL database. It is very simple and straightforward so I won’t bother with long explanations. If you have any questions about it please feel free to comment. On tip I’ll leave you with is… schedule this (or your own) backup script to run regularly. I’m hosted on a linux server so it is an easy thing to setup a cron job to run this script once a week. Plus if you are really snazzy you could setup a local script to login to your server and download the backup files to your home system where you could archive them off to DVD-R or some other media. Anyway, here is the script… enjoy! 🙂

PC Problems – The End In Sight

As per my last couple of blogs I have been having some problems using my PC… I can’t use it. I have been receiving the error “A problem is preventing Windows from accurately checking the license for this computer. Error code 4: 0x80090006“. This is one of those elusive problems that has many postings on the internet with very few good resolutions. I think the big problem is there seems to many several solutions. That means this error occurrs because of a number of reasons… just like my migraines. 🙂

So, what was the solution that worked for me? I found a list/forum entry here that provided the fix that worked. Basically there are three cryptography DLLs that may have become corrupt so the author specified that you should obtain fresh copies of those libraries and copy them to your C:\WINDOWS\System32 directory. The DLLs in question are rsaenh.dll, dssenh.dll and sccbase.dll. So I used my Windows XP CD to boot into recovery console mode (from drive E:) and issued the following commands:

After rebooting… it worked! So as I’m writing this (on my iMac) my PC is busy performing a full backup. I’ll probably finish out the week using it and then do a clean install over the weekend.

A problem is preventing Windows from accurately checking the license for this computer

Well, the saga of the broken PC continues. I’ve tried running Windows recovery console from my Windows XP disc, but have not been able to get back up and running. The computer still boots fine and I can see all of my files there at the console, but no login in normal Windows mode. I am getting the error “A problem is preventing Windows from accurately checking the license for this computer. Error code: 0x80070002.” when I try to login and then it just logs off again.

So this morning I did some searching the internet and found two separate fixes for this particular error message. They can be found here and here. I’m going to try these tonight and hopefully get my PC back. It really sucks being down because I usually blog from home in the evenings (not to mention playing World of Warcraft!). Wish me luck!

PC Woes

Well my PC took a huge dump this weekend. It’s an odd sort of problem as you can actually boot the computer up. There are a few unknown exception errors that popup as the login screen appears. Then when I try to login it gives me some strange error about validating my Windows license and then promptly logs me off. I was able to open up in safe mode and run a full virus scan which did not find anything. I haven’t yet tried a Windows repair yet, but that’ll be the next step. Thankfully I still have my trusty iMac which just hums along fine.