Mounting an Installable File System as the Root Directory
An addition to the ROM-only file system component allows an external file system to be mounted as the root of the entire file system. This means that files and subdirectories of the external file system appear directly off the root directory. Other external volumes, such as \NETWORK or \Hard Disk, will retain those names and calls into those volumes will be routed as they have always been.
Mounting an external file system as the root directory has two advantages:
- The ability to store files and directories off the root directory, as if it were the RAM-based file system. Other external volumes still have the same paths. Files in ROM are stored in the Windows directory.
- The choice of shadowing the Windows directory. The file shadowing is accomplished by routing all Windows calls to the mounted root file system. The ROM then becomes unavailable.
When drivers are loaded and file systems are mounted, the desired file system is registered in a special way to indicate that it should become the root. Before that point, all file API calls accessing files or directories in paths off of the root, except those in ROM, will fail.
To register a file system as the root, set the following flag in the registry to specify the file system.
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\<Your File System>]
"MountFlags" = dword:4
Only one file system may be registered as the root file system. After one root file system is registered, any subsequent file system making the attempt will still be registered, but will not become the root file system. A different file system may be registered as the root file system by first deregistering the previous root file system. At that point, there will be no root file system and the directory Windows will no longer be shadowed.
The file system has the option of shadowing the Windows ROM directory. In this case, all files from the FILES section of ROM should be copied onto the mounted file system before it is mounted as the root file system. Files from the MODULES section, typically executable and DLL files, will still be accessed directly from ROM by the loader, if they are not present on the mounted root file system.
To cause the root file system to shadow the Windows directory, the MountFlags registry setting must be set to the bitwise OR of the root flag (4) and the shadow flag (8). The following code example shows how the value is assigned.
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\<Your File System>]
"MountFlags"=dword:C
Last updated on Wednesday, April 13, 2005
© 2005 Microsoft Corporation. All rights reserved.