System File Checker

A Windows tool worth digging for

SFC is an invaluable tool in Windows. It checks that all Windows files are where they should be and that they’re uncorrupted, it then puts things right. If you’ve done all your virus checking, error checking and defragging, but Windows is still doing strange things, then SFC can be your saviour.

SFC in Windows XP

In XP it was thought by many to be extinct. Not so, for some inexplicable reason, Microsoft changed the default command:

  1. Click Start,
  2. Click Run,
  3. Type sfc /scannow,
  4. Then click OK and follow the instructions.

Starting with Vista they made it even more obtuse. You need to open a Command Window in Administrator mode:

SFC in Windows 7 and Vista

run-as-admin

  1. Click Start,
  2. Click All Programs, then Accessories,
  3. Right click on the Command Prompt option,
  4. On the drop down menu which appears, click on the “Run as Administrator” option.
  5. If you haven?t disabled User Account Control (and you shouldn’t!) you will be asked for authorisation. Click the Continue button if you are the administrator or insert the administrator password.
  6. In the Command Prompt window, type: sfc /scannow,
  7. press Enter.

You’ll see the system scan will begin. The scan may take some time and Windows will repair/replace any corrupt or missing files. You will be asked to insert your Vista DVD if it’s needed. Close the Command Prompt Window when the job is finished.

One caveat:

You may need a Windows CD or DVD to enable SFC to make repairs. Try not to get suckered into buying any Windows computer with just a Recovery or Restoration disc, if you can’t avoid it, copy, or borrow somebody else’s disc or download a Windows ISO file from the Internet and create your own disc. If System File Checker can’t fix it, the next step is a repair installation or if your system’s really messed up, a clean install from scratch. More on these coming soon.

Quick drive removal

Setting up a drive for Quick Removal

In a previous post I explained the implications of disc write caching. There’s an easy way to reduce the likelihood of data loss when removing an external drive connection. You can ensure that its Removal Policy is set up for Quick Removal. Some drives are set up in this way by default in Windows 7, but you need to check. The procedure below is for Windows 7, but it’s very similar in Vista or XP.

  • Open Windows Explorer (keyboard shortcut: Windows Key+e).
  • Click on the Computer icon in the left panel if it’s not already selected.Windows Explorer in Windows 7
  • Scroll down to the drive in question and right-click on its icon. You’ll see something like this:

right click menu

  • Then click on Properties.
  • In the new window click on the Hardware tab.
  • Click on the name of the relevant drive. As in my example, it’s not always clear which one it is!
  • Drive Properties hardware tabClick on the line for the drive in question.
  • Click on the Properties button.
  • Click on the Policies tab.
  • You’ll see this:

Drive Properties

  • Click on the Change settings button.
  • You’ll see this:


Removal policy tab

  • Click on the ‘Policies’ tab as shown above.
  • Ensure that the Quick removal radio button is selected.
  • Click the OK button.

That’s it!

Disk write caching

The old vanishing data trick

Trust me—you really need to know about disk write caching

Take care when removing your external drives. This applies to USB and firewire external drives, to flash cards and to flash drives – otherwise known as pen or thumb drives. If you don’t follow the rules, one of these frosty Fridays your safely backed up data will be toast.

Yeah? Why?

OK, this is mildly complicated. When Windows, or any other operating system, writes stuff onto your storage drives—hard disk drives, DVD and CD drives, or flash drives for instance—there’s a hurdle to jump.

Your computer can process data at speeds which are orders of magnitude faster than the rate at which it can write data to your disks. If Windows sat around and waited for those data to be written, your fancy new 4GHz processor would be spinning its quad-core wheels and your computer would slow to a crawl until writing was completed.

“The cheque’s in the mail”

Clever techie folk solved this problem a long time ago by introducing “write caching”.

The principle is quite simple: you disconnect the fast computer from the slow disk writing process. Instead of writing the data directly to disc in real time, the information is sent to temporary storage in a (fast) memory cache, the cache then reports back to Windows that the data have been written.

This is the IT equivalent of “the cheque’s in the mail”.

You and your computer can get back to playing Space Invaders and writing the great 21st Century novel. Unfortunately however, just like the mythical cheque, the data have quite possibly not arrived at their intended destination. Windows just thinks they have. Under the hood the data are still sitting in the volatile memory cache waiting for a quiet moment to be written to the target drive.

“OK, So what?” I hear you cry

If the postman steps on a landmine, the cheque in the mail will be dog tucker. Same with your cached data. If your PC is in the process of writing stuff (which it often does, whether you initiated it or not) and you:

  • remove a flash drive from its USB socket or;
  • turn off or disconnect an external hard disk or CD-R drive or;
  • have a power cut and you don’t have a UPS (uninterruptable power supply) or even worse;
  • turn off your PC without shutting down Windows first;

you have a significant risk of data corruption because file writing has not been finalised. If this happens you will probably trash the data and possibly your external disk or, if it’s an operating system file being written to, you can corrupt your Windows installation.

Oh dear, that’s a bit of a worry

Too right it is. But never fear, you can protect yourself.

Don’t turn off your PC without closing down the operating system first. In the case of Windows follow the usual routine to shut down, hibernate or sleep. Never—repeat, never—turn off power to your PC before the machine has shut itself down.

Hot tip

Keyboard shortcut for XP users: Windows key » U » U to shut down, Windows key » U » H to hibernate, Windows key » U » S to sleep.

safely remove iconClick on the icon (like the one shown on the right) in the notification area to the right of your taskbar to “safely remove” an external drive before removing it from its socket, turning it off, or removing its connecting cable from its socket. The icon may be hidden and you’ll need to click on the up arrow to reveal it.

To be 100% safe you should also follow that procedure before your computer goes into hibernation or sleep mode if you intend to remove the device.

  • Get a UPS – plug your PC, your monitor and your powered external drive (i.e. if it has its own power supply separate from the USB port) into it. In the event of power failure the UPS’s battery will keep your PC running while you or the USB’s bundled software shut down the PC properly. Not so necessary for laptops because you have a built-in battery.
    As a bonus the UPS will provide additional protection to your PC and connected devices in the event of power spikes and lighting strikes.
  • You can change the properties of individual external drives to disable write-caching. Then you may remove or turn off the device without going the “Safely Remove Hardware” route. Caveats:
    • Setting a drive up in this way affects the performance of your computer during the writing process to a greater or lesser degree dependent upon exactly what you’re doing.
    • But it’s safer for data security on external drives.
    • I set my external drives up with “Quick Removal” enabled, but I still use the “Safely Remove Hardware” icon to be on the safe side. I’ve been bitten.
    • XP can be flaky with this procedure and tell you that you can’t remove the drive because it’s still in use. This can happen even when you think writing is finished. In that case leave the drive connected or shut Windows down before removal. Vista is better in this regard and Windows 7 is better still.
  • The whole process is much less hassle on Apple’s Macs and on Linux computers. Usually you just need to right-click on a drive’s icon and select “unmount” to kill the drive.

Go to the next page to find out how to change the drive properties we’ve discussed.

Hard to get good help

When your computer packs up, and you’re not a techie type, you’re stuck with taking it to someone who’ll charge you an arm and a leg. Many quite simple repairs take so long that the cost of repair (at $100 an hour and counting) comes to more than your old beige box is worth. And if it’s a printer, forget it: to the recycling centre, go.

It’s not necessarily the fault of the repair person. Often a problem may be easy to repair, but difficult and time-consuming to identify. If it involves reinstalling Windows, your data, and your software it’s going to take a while.

And I just know you don’t have backups.

If it’s a compatibility problem or an intermittent fault, the techie may, justifiably, take the easy route and tell you that you need a new motherboard, and a complete re0installation of Windows. That may not be totally true, but it’s a cheaper option than spending hours locating an obscure fault.

If your computer’s more than 5 years old, even replacing the motherboard may cost more than your machine is worth unless you’re willing and able to do your own Windows re-installation. On top of that, your old memory and video card may be incompatible with the new motherboard.

“What the fuck’s a motherboard!” I hear you cry.

The $1000 router repair

I had problems with my Belkin wireless router a while back. It wouldn’t play nicely with a Windows upgrade on my desktop. It took me several days and a lot of stress to sort out.

In the navy we gave such pestilential devices the always effective “float test”; but with current laws on pollution of the ocean, that’s probably not a goer anymore. :o)

Ask the experts

So I asked the maker for help. I’d have had more joy asking my maker.

Firstly, Belkin suggested updating the firmware. I’d already thought of that, but couldn’t find it on the Net. Unfortunately the experts at Belkin couldn’t either: they gave me the wrong link for it. Following their incorrect advice and loading the wrong firmware graduated me from a medium level problem to a total catastrophe.

If I hadn’t been on a tight budget, at that stage I’d have bought a new router, but I persevered and the nice Indian lady at their help desk (I use the term help loosely) told me that I had to change the router from automatic to a specific DNS address.

Which, of course, was totally incorrect. I wasn’t absolutely sure that she was wrong so I went off on another wild goose chase.

Finally finding the right firmware fixed the problem, no thanks to Belkin, but it took me days to get to that point. Google to the rescue. If I’d been charging the job out at commercial rates the fix would’ve been several times the cost of a new router. That wouldn’t be acceptable to a client so I’d have taken a big loss or, knowing that this compatibility issue wasn’t going to be straightforward, I’d have recommended a new router early on in the drama.

Life is fraught.