Offline File Cache Nightmares Resolved

Off-line files are a wonderful thing.  The fact that my users can synchronize the files from a central server (where they are backed up) to their laptop is great.  But what happens when things get out of hand?  In theory, users can save a lot more onto a file server than they can their local machine.  In practice, when the folder is set to synchronize in full to the local hard drive can cause headaches… like waking up one day and realizing that they have 0kb free on their C drive.

Okay, you go to the server and move the offending files to another location.  You log into the affected computer… and nothing doing, still zeroed out. 

The problem is that there is a folder called the Client Side Cache (or Offline Files Cache).  It is stored under the SystemRoot – i.e., it is (by default) c:\Windows\CSC.  Now, this folder can be moved, but it is not a simple process, and I will cover it in a later article.  The issue is that the CSC directory sits on the C Drive, and is completely secured against reasonable attempts to modify it manually… which is good, because trying to do so will cause some pretty serious issues.

So we have fixed the problem on the back-end, and now we have to fix it on the front-end, which means cleaning out the Client-Side Cache.  We can’t simply do this manually, we have to actually clean out the CSC database.  How do we do this:  Here you go:

**VERY IMPORTANT NOTE:

The Windows Registry is not meant to be touched by anyone who does not have a very thorough understanding of how it works, and can cause serious and irrecoverable damage to your Windows installation if handled improperly.  I strongly recommend that you do not do this if you are not extremely comfortable with it.

1. Open the Registry Editor (regedit.msc)

2. Navigate to HKLM\System\CurrentControlSet\Services\Csc\Parameters

3. If there is no Parameters key under CSC then you have to create it. 

4. Under Parameters create a new DWord 32-bit value called FormatDatabase.

image

5. Set the value to FormatDatabase to 1.

SNAGHTML6184ce7

6. Close the registry editor and reboot your computer.

Okay, that is the long way around, but it is also the ‘fewer chances for error’ way.  If you are not afraid of typos, you can do the following:

1. Open a command prompt with elevated privileges.

2. Type: reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Csc\Parameters /v FormatDatabase /t REG_DWORD /d 1 /f

(Where /v is the value, /t is the data type, /d is the data, and /f is force overwrite.)

3. Close the command prompt and reboot your computer.

Once your computer reboots you should be alright.  You shouldn’t even have to enter your Recycle Bin, the disk space should just be there Smile

Good luck, and remember to back it up before you hork it up!

Advertisement

3 responses to “Offline File Cache Nightmares Resolved”

  1. Hi Mitch – we had actually met today at the Microsoft campus and you shared with me the feedback on the same topic of this post. The instructions you’ve provided are great help to the community once someone is already in this situation. I think it’s even better if the situation can be prevented in the first place.

    If you open the ‘Manage Offline Files’ configuration (search for it in the control panel), there is a ‘Disk Usage’ tab which can limit the amount of space offline files uses. It’s possible that lower settings for smaller devices are more appropriate, and could help avoid these problems. Probably our defaults (which were defined long ago) are not as ideal for new devices with smaller drives (especially common due to SSD).

    The real missing feature in the ‘Disk Usage’ tab is a value specifying how much free space to leave on the device (rather than how much space is allowed to be used by Offline Files). This would have 100% prevented Offline Files from ‘using the last byte’ (or last # GBs) of disk space.

    I’ll take that feedback to the team. Also worth mentioning is that our newer file server sync technology, Work Folders, does have this exact protection. It prevents synchronization to the device when the drive has less than 5-6GB free.

    – Jason Shay [MSFT]

  2. Does it remove this registry entry after the Offline Files cache is formatted?

  3. https://learn.microsoft.com/en-US/troubleshoot/windows-client/networking/access-offline-files-file-server-removed-from-network

    According to Microsoft :
    This registry change requires a restart. When the computer is restarting, the shell will re-initialize the CSC cache, and then delete the registry key if the registry entry exists.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: