Server 2008

Both Windows Vista and Windows Server 2008 include the System File Checker (SFC) tool. Previous operating systems included this tool also. This discussion is specific to Windows Vista and Windows Server 2008. If you would like more information on previous operating systems see the following KB article: http://support.microsoft.com/kb/310747.

SFC scans and checks all Windows Resource Protected (WRP) resources. Windows Vista adds the following new functionality to the SFC tool:

  • Ability to scan a single file
  • Ability to scan a Windows installation offline

Common SFC Command Line Options

Here are some of the common commands you would use with SFC. Note you need to run SFC from a elevated command prompt

Scan entire system
SFC.EXE /scannow

Scan a specific file
SFC.EXE /scanfile=c:\windows\system32\kernel32.dll

Verify. This scans all protected files but does not repair them
SFC.EXE /verifyonly

Help for Sfc.exe
SFC.EXE /?

One of the new features of SFC in Windows Vista/2008 is the ability to run SFC against a offline windows directory. This is most useful when you are unable to start Windows and suspect file corruption. Generally you should always try safe mode first before doing this to see if Windows can start. To use SFC in offline mode you do the following

  1. Boot from your Windows Vista or Windows Server 2008 DVD
  2. On the first screen of Setup choose Next
  3. In the lower left of the screen choose “repair your computer”
  4. On the System Recovery Options screen choose your installation of Windows and then click next
  5. Click “Command prompt”
  6. Type in the following command: SFC.EXE /scannow /offbootdir=c:\ /offwindir=c:\windows
  7. When complete type in exit to see if Windows starts up now.

Advanced users may want to see what SFC is repairing on a system. When SFC runs it logs it’s actions to C:\WINDOWS\LOGS\CBS\CBS.LOG. You can find SFC specific entries by searching on [SR]. See http://support.microsoft.com/default.aspx/kb/928228 for more information.

Example of How SFC Can Fix Issues

The following is a example of how the system file checker was able to resolve a issue on my own computer. The issue I encountered was that When I would go into disk management my disks would show up but none of the information such as the type of disk, size, active/boot/system, healthy, etc… would show up. I checked the system event log and found the following

Capture

FMIFS.DLL is obviously a file used by disk management to display this information. If I look up the error code C1 it resolves to ERROR_BAD_EXE_FORMAT. So at this point I suspect that this file is corrupt. From within Windows I run the following command:

SFC.EXE /scannow

It runs and says that it has repaired files. To verify I look in the C:\WINDOWS\LOGS\CBS\CBS.LOG and see the following entries

Capture2

From this you can tell that SFC compared the hash for fmifs.dll and found it wasn’t correct. It restored the backup from c:\windows\WinSxS\x86_microsoft-windows-fmifs_31bf3856ad364e35_6.0.6000.16386_none_54d7af8934ac24f1. After running SFC I was now able to open disk management and see my disk information.

Hopefully this helps explain how SFC can help you resolve problems on your computer and shows how Microsoft is committed to making Windows easier to fix when issues do occur.

Author:
Scott McArthur
Support Escalation Engineer
Enterprise Platforms Support

Mac OS X RAM Test

Whenever I get a new stick of RAM for my Mac or PC, I’m always eager to just plug it in and start using it to its fullest, but having worked on hundreds of computers and encountering dozens of bad memory modules has convinced me that thorough testing is a must. While off-the-shelf PCs can run a copy of the free Ultimate Boot CD tool to perform RAM tests, Macs are a little bit more complicated in this respect. If you’ve purchased AppleCare for your Mac, it comes with a bootable TechTool Deluxe disc, but you’re otherwise left to your own devices when it comes to hardware tests.

Fortunately, with a little preparation right now, you can boot your Mac into Single User Mode and do a complete RAM test in the future. While you can run the necessary software in a fully-booted system, I recommend doing testing in Single User Mode where there are far less programs loaded in memory, and less chance of an important system component getting corrupted if your machine freezes or kernel panics — common symptoms of bad memory. A modified Mac OS X boot CD would be ideal, but that’s another post for another day!

DOWNLOAD MEMTEST

The testing setup isn’t terribly complex; I’ve taken the liberty of putting together an installable package which will put the Memtest utility into your /usr/bin/ folder. Memtest is a Unix command-line program that does the memory testing, and is the Mac equivalent of MemTest86.

MEMTEST USAGE

To run memtest on a new memory module, first shut down your computer and install the new chip. (Some helpful guides for doing this can be found at iFixit, if you’re unsure of the exact steps.) Ensure the chip is firmly in place, close up your machine (or don’t, if you’re a pessimist), and power it on while holding down the Command and S keys to force Mac OS X to boot into Single User Mode. Once you see a black screen with white text, you can release the key combination. After all the system logging is done scrolling past, type memtest all 2 to test all memory two times. Two passes should be enough to detect any blatant problems, but I wouldn’t hesitate to let it run for hours on end if I suspected an intermittent memory problem (memtest all). When complete, you should be greeted with “All tests passed” if your new RAM is in good condition. If your system locks up or freezes indefinitely during the test, you may have a bad memory module on your hands.

Thanks to OSXDaily and Command-Tab for the article.