Partager via


File Replication for Persistent Storage (Windows Embedded CE 6.0)

1/6/2010

Systems configured for persistent storage implement a file allocation table (FAT) file system or extended FAT (exFAT) as the root file system. However, unlike the RAM-based file system, FAT and exFAT do not provide native support for file replication.

Using a file system filter, you can configure support for file replication for any external file system, including the FAT or exFAT. The file system filter stores object identifier (OID) file mappings in a database volume referred to as the replication store.

As of Windows CE 5.0 and later, Windows Embedded CE-based devices use persistent storage by default. Other Windows Embedded CE system may implement persistent storage as an option.

The file replication file system filter can be configured through the registry. The registry key must be added in the boot hive section.

The following table shows the registry values that can be set under HKEY_LOCAL_MACHINE\System\StorageManager\Filters\Fsreplxfilt.

Registry value Description

ReplStoreHostVolume

Required. Specifies the mount point for the volume that contains the replication store. For example, if the replication store is located on an external file system, such as a hard disk drive, set this value to \\Hard Disk.

ReplStorePath

Required. Specifies the path of the replication store on the specified volume. This value is set to \\ReplStoreVol by default. If the replication store does not exist, it is created by the file system replication filter. The replication store is inaccessible from the file system.

ReplStoreName

Required. Specifies the name of the database used to store OID file mappings. This value is set to \\ReplStor by default.

ReplStoreDoImmaculate

Optional. Specifies whether the replication store should be cleaned when the file replication file system filter is loaded. If power is lost during deletion or renaming of a file or directory, the replication store might contain stale records. This procedure iterates through the replication store and removes any OID file mappings that do not correspond to actual files. This value set to 0 by default, which disables this feature. This procedure can significantly increase boot time if the file replication file system filter is attached to the root file system.

ReplStoreCacheSize

Optional. Specifies the number of OID file mappings to cache. To reduce the number of queries to the replication store, the file replication file system filter caches recently referenced OID file mappings. This reduces the total number of accesses to flash memory. This value is set to 0 by default, which disables this feature.

NumDirsToExclude

Optional. Required if the DirsToExclude value is set. Specifies the number of directories to exclude from replication. This value is set to 0 by default.

DirsToExclude

Optional. Required if the NumDirsToExlude value is set. Specifies the set of files or directories to exclude from replication. All sub-files of an excluded directory are not associated with an OID and do not have an entry in the replication store. In general, not all files must be replicated. For example, system files do not need to be replicated. Unnecessary files can be excluded from replication to reduce the size of the replication store and improve file system access performance. For example, setting this value to \\temp\\directory\\ excludes all files and directories under the \temp\directory folder from replication. To exclude a specific file from replication, set this value to the location of the file. For example, \\temp\\directory\\file.txt.

The file replication file system filter is attached to a specific storage profile stored in Platform.reg. The following registry key example shows the entry to the Platform.reg file required to implement the file replication file system filter:

;Hive Boot Section
;@CESYSGEN IF CE_MODULES_FSREPLXFILT [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\<storage profile associated with the root file system>\FATFS\Filters\fsreplxfilt]
   "Dll"="fsreplxfilt.dll"
   "Order"=dword:1 ; must be loaded after other filters
;@CESYSGEN ENDIF CE_MODULES_FSREPLXFILT
;End Hive Boot Section

Note

The file replication file system filter should only be applied to the storage profile associated with the root file system. It is not possible to replicate files on multiple volumes, such as both the root file system and an SD memory card. Applying the file replication file system filter to a storage profile associated with a non-root file system has no effect.

Note

FSREPLXFILT must be the lowest-number order filter on the file system stack, and loaded after all the other filters, so that it accurately reflects the current state of the file system as the user sees it. If you add a filter driver, its corresponding registry setting must have an order value that is greater than 1, such as 100. Otherwise, do not set an order value for the filter driver, so that it will default to 0xFFFFFFFF.

See Also

Concepts

Implementing Persistent Storage on Flash Media