Saturday, January 02, 2010

Solution for "A disk read error occurred."

This is one of the most frustrating error messages you can ever deal with. Sometimes the fix is simple, sometimes it's a complete pain. Having recently dealt with this again, I thought I'd post my thoughts in the hopes that it helps someone else out there.

So you receive the dreaded "a disk read error occurred. Press Ctrl+Alt+Del to restart". Multiple restarts result in the same error message.

If you put your drive into another computer, or connecting it as a slave on your own computer, it will typically work fine, and no data is missing.

Because this error is not usually associated with data loss, DO NOT RE-PARTITION THE DRIVE. Your data is likely safe and sound.

Here's how we'll recover your data. Try each step below, in order, and see if your drive becomes accessible after each step. In my experience, you won't start seeing results until step 5 or so.

  1. Run CHKDSK /R /P from the recovery console (it will typically find no error)
  2. run FIXBOOT from recovery console (typically has no result)
  3. run FIXMBR from recovery console (typically has no result)
  4. Run the manufacturer's diagnostic utility, downloaded from their website (it will typically find no error)
  5. Changing the drives from cable select to Master/Slave may fix it.
  6. Replacing the data cable may fix it, but usually not.
  7. Setting the BIOS to use defaults may fix it, but usually not.
  8. Changing the BIOS drive settings from auto to user-specified, ensuring that LBA is selected may fix it.
  9. Pulling the CMOS battery to let the BIOS lose it settings may work.

At this point, you may be feeling some frustration. :-)

If all that fails, here's what will usually work:

Ghost your data to a new drive, and use the original one as a slave. It will work. And all of your data will still be accessible. Your computer should boot normally. If it doesn't, or it there are errors, run the Repair Installation option from your Windows boot CD.

But why does this happen? Nobody seems to know why. The problem typically evades all forms of analysis.

Here's what I've learned: this error message likely has more to do with a hardware interaction between the drive and your system than any actual issues with the drive. To put it one way, your motherboard and drive are no longer on speaking terms.

I don't know why the original disk has no problems being a slave. Perhaps it got tired of running the show. Perhaps it's preparing for retirement.

UPDATE! Performing a low-level format on the drive may be able to restore it to fully working condition, including the ability to be the master drive. A low-level format is not the same as a regular format. Typically, you'll need to download a utility for the drive manufacturer's website. Beware, as a low-level format will definitely delete your data, so only do this after you have copied your data to a new drive.

Labels: ,

Thursday, December 03, 2009

Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

If you're getting this message in your event log, here's all you have to do to fix it: Locate your MySQL data directory and and delete the files "ib_logfile0" and "ib_logfile1" contained therein. The files will be recreated after your restart the MySQL service (or simply reboot if you don't know how to restart a service). You will NOT lose any data. It will very likely fix your error. Your MySQL data directory is typically something like C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\Data although it may be located in an entirely different place, such as W:\wamp\bin\mysql\mysql5.1.36\data If you can't find it, search your drive for one of those two files. If that doesn't fix the problem for you, check to see if the directories exist for the environment variables TEMP and TMP.

Labels: , ,

Thursday, April 02, 2009

How to remove Logitech Easy Synchronization and bluetooth

To bypass my rant, scroll to the bottom of this post to see the quick solution.

I've quickly learned to dislike how Logitech engineers their software for their wireless keyboard and mouse systems.

Once again, this is a case of yet another software "suite" that does so much more than we want or need. Adding a mouse and keyboard apparently requires several services and background tasks running that do provide more clutter. It seems that everyone wants to jump on this bandwagon. I dare you to install a Logitech device, Roxio CD/DVD creator, Apple iTunes, and Norton Antivirus. You'll have at least a dozen system processes running everywhere, slowing things down.

(Wait for it... can you hear it? The hoofbeats of several company men who work for one of the above-mentioned firms to pick apart every comma and period above to inform us all that their software is really great, despite all the crap it loads? Wait for it... they show up like a cloud of bees every time.)

It's high time that software manufacturers STOP MAKING "SUITES" and begin putting together highly-focused, simple software that simply does the job well. Rather than several individual processes designed for every possible scenario (I'm talking to you, Apple) just give us a program that works only when it's open, and unloads itself when we're done. Please?

Okay, there's my rant. Here's the promised solution to removing that infernal "Easy Synchronization" program.

1. Copy this line:

RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\0701\Intel32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{AC134D03-97F1-45B9-B32A-52E885AFA895}\setup.exe" -l0x9

(make sure it copies all as one line, and not several individual lines.)

2. Now press Windows-R on your keyboard (or go to the start menu and click "Run".

3. Paste the line you just copied into the Run box and hit enter. The uninstall process will begin.

4. Yay!

Labels: , ,

Tuesday, July 29, 2008

PHP Startup: Unable to load dynamic library --- Specified module could not be found.

Another WAMP error to deal with.

In this case, seeing the PHP error "Fatal error: Call to undefined function: mysql_connect() in some_random_script.php"

Turns out that under PHP 5, the MySQL libraries are no longer included by default. However, the installer package can add them in for you, no problem.

There are multiple reasons this issue shows up, and many of them are explained in the comments section of the official PHP Installation of Extensions on Windows page.

The problem is likely due to one (or both) of the following reasons: 1) You've had a previous installation of PHP or MySQL, and you have older .DLL files scattered about your hard drive, or 2) PHP doesn't know where to find the DLL's.

Here are the fixes:

For the first issue, remove the following old files from your Windows\System32 folder:

  • libeay32.dll
  • ssleay32.dll
  • libmysql.dll

You'll already have the newer versions of those file in your PHP installation folder.

The next step is to make sure that the PHP installation folder is in your system's PATH variable. It doesn't matter if you don't know what that means... simply follow these instructions:

  1. Bring up the "System Properties" window by either pressing Windows-Break on your keyboard, or by right-clicking on "My Computer" and selecting properties.

  2. Select the "Advanced" tab.

  3. Click the "Environment Variables" button at the bottom.

  4. Under "System Variables" at the bottom, scroll down to "Path" and click "edit".

  5. Look for the location of your PHP installation (something like C:\PHP, C:\Program Files\PHP or C:\Progra~1\PHP.

  6. If you don't see your PHP installation folder, add a semi-colon ";" and then the folder of your PHP installation folder.

  7. Close out of all those windows and reboot

Note that this will not fix things until you reboot. As far as I know, there's no way to get Windows to reload the System Variables without a reboot.

Thursday, July 24, 2008

Apache vs. Skype

After upgrading my my PHP installation from 4.4.6 on my windows box to 5.2.6, Apache wouldn't start.

I finally determined that it was because Apache was still trying to load the old PHP4 SAPI module, which no longer existed because I renamed the old PHP4 directory.

So after fixing this, Apache should fire right up, correct? Not so fast... I received another error:

(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. :make_sock: could not bind to address 0.0.0.0:80

Okay, so something else has bound itself to port 80? Why all of the sudden? I didn't have this problem before I upgraded to PHP5, and I know that it's not binding to any ports...

So what's up?

A quick netstat -ao shows me the processes that are bound to each port (the -o option shows the PID). I fired up task manager (make sure that you have the "PID" column checked under "View / Select Columns...") to see who the culprit was ...

... Skype.

So here's the problem (and solution)...

Apparently, my Apache service has been starting up before Skype loads, claiming port 80 (and 443) for itself. When Skype finally loads, it gets a clue and binds to a different port.

But this time, because Apache wasn't able to load (because of my missing PHP4 module), ports 80 and 443 were still available when Skype loaded up. And Skype grabbed them up for itself, which, of course, causes Apache to fail.

Problem is fixed easily by shutting down Skype, re-starting Apache, then re-loading Skype. If Apache loads without problem after a reboot, this shouldn't ever be a problem.

However, if Apache does fail at some point in the future, we don't want our troubleshooting process bogged down with having to figure out the Skype problem again, so let's tell Skype to leave our ports 80 and 443 alone.

Load up Skype, and under Tools -> Options... -> Advanced -> Connection -> uncheck "Use port 80 and 443 as alternatives for incoming connections"

Sunday, June 04, 2006

Easy CSS Delimited lists

Any easy menuing system in CSS. As a list of links, a menu should rightly be included in an HTML list.

What we need is a simple way to display <li> elements as a flat, delimited list. Take, for exampe, the simple menu at the top of this page. It consists of a simple <ul> list:

<ul class="menulink">
  <li>home</li>
  <li><a href="/pb/port/">portfolio</a></li>
  <li><a href="/pb/contact.html">contact me</a></li>
</ul>

First, we turn off the dots before our list item and remove the indentation. Remember that Firefox and Safari use the padding space to specify the space for the dots, but most other browsers use the margin space for this. Unfortunately, CSS specifications don't exactly say which it should be. So to cover our bases, we're going to zero out both the margin and the padding:

ul.menulink {
  list-style: none;
  margin: 0;
  padding: 0;
}

Next, we flatten it into a line with:

ul.menulink li {
  display: inline;
}

Now we add our delimiters by using the pseudo-selector :after (and give it some space to breath):

.menulink li:after {
  margin-left: 3px;
  margin-right: 3px;
  content: "|";
}

That adds our vertical bar after each item. But what about the last one? We don't need it, so let's remove it with:

.menulink li:last-child:after {
  content: "";
}

The key to understand this is to remember that the :last-child pseudo-selector refers to the last element of it's own kind (i.e., the last <li> tag).

This is great CSS, but Internet Explorer 6 doesn't recognize these pseudeo-selectors.

Thursday, September 01, 2005

Why are more developers moving from .NET to PHP?

  1. Developers - It's difficult to find .NET web developers. And those few tend to have specialized skills (e.g., backend, data access layer, etc). PHP developers tend to have a wider focus.
  2. Complexity and speed of development - .NET is a beast. .PHP is much better for punching out code quickly.
  3. Cost - PHP and MySQL are free. SQL Server, Windows Server, Visual Studio, MSDN, etc are quite expensive.
  4. Get in running/keep it running - I've never had PHP shut down on me. But IIS needs to be rebooted every few weeks.
  5. Security/viruses - no new news here.
  6. Platform independence - coders can use Windows, Mac, Linux, or whatever, enjoying their favorite editors and tools. Not so with .NET
  7. Community - Greater quantity and quality of help on the net, not to mention open source tools and code for free. Speeds up development.
  8. Browsers - Firefox is the future. Or at least "having a browser choice" is the future. Why be tied to IE?