
本帖最后由 Bugsong 于 2012-12-26 11:47 编辑
原创发表于:FBWF安装及使用的若干问题 | 大D综合研究院
原文链接:http://www.dadclab.com/archives/959
本文采用知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议进行许可。
协议查看链接:http://creativecommons.org/licenses/by-nc-sa/2.5/cn/
大D综合研究院以前介绍过FBWF的安装使用,虽然这家伙也来自微软,WES7的内核跟Win7一致,但是也不能说这功能在Win7没有水土不服。在安装和使用中,总会有这样那样的问题,本文将对常见的问题说一下。在FBWF安装过程中,最常见的就是下图的错误
安装完毕之后,命令提示符输入fbwfmgr /enable后返回FbwfMgr: Unable to communicate with the file-based write filter.错误原因一:驱动程序拷贝不正确解决方法:确认关闭UAC,拷贝驱动程序到C:\Windows\System32\drivers,重新启动电脑,然后在管理员权限打开cmd,来执行这个命令。 错误原因二:注册表信息问题解决方法:修改注册表信息(本方法修改注册表,请备份操作系统,谨慎操作)将[HKLM\SYSTEM\CurrentControlSet\ENUM\Root]的注册表键权完全控制限提升为everyone。1、因Win7有注册表关键位置保护,这个主键是不允许提升权限的。先下载PsExec程序(文后提供链接)解压备用。以管理员身份打开CMD。输入 cd 你解压psexec的路径例如 c:\windows\users\bugsong\desktop\psexec\进入到目录后,执行命令。psexec.exe -i -d -s regedit.exe
这时会启动注册表编辑器(修改注册表操作,请备份系统,谨慎操作)修改权限。
修改权限完毕之后,将下列注册表信息手工添加到注册表“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FBWF“Start”, “REG_DWORD”, “00000000″
“Type”, “REG_DWORD”, “00000002″
“ErrorControl”, “REG_DWORD”, “00000001″
“ImagePath”, “REG_EXPAND_SZ”, “system32\drivers\Fbwf.sys”
“Group”, “REG_SZ”, “FSFilter System Recovery”
“DisplayName”, “REG_SZ”, “”
“DependOnService”, “REG_MULTI_SZ”, “FltMgr”
“DebugFlags”, “REG_DWORD”, “00000000″
“EnabledOnAllSkus”, “REG_DWORD”, “00000001″“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FBWF\FBA”“ProtectRegistryRamdisk”, “REG_SZ”, “\RegfData”
“EnablePostFBA”, “REG_DWORD”, “00000000″“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FBWF\Instances”“DefaultInstance”, “REG_SZ”, “Fbwf Instance”“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FBWF\Enum”“Altitude”, “REG_SZ”, “226000″
“Flags”, “REG_DWORD”, “00000000″“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FBWF\FBA\Exclusion”“0″, “REG_SZ”, “Root\LEGACY_FBWF\0000″
“Count”, “REG_DWORD”, “00000001″“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_FBWF”“NextInstance”, “REG_DWORD”, “00000001″“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_FBWF\0000″“Service”, “REG_SZ”, “Fbwf”
“Legacy”, “REG_DWORD”, “00000001″
“ConfigFlags”, “REG_DWORD”, “00000032″
“Class”, “REG_SZ”, “LegacyDriver”
“ClassGUID”, “REG_SZ”, “{8ECC055D-047F-11D1-A537-0000F8753ED1}”
“DeviceDesc”, “REG_SZ”, “Fbwf”“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_FBWF\0000\Control”“ActiveService”, “REG_SZ”, “Fbwf”其中,形如:
“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_FBWF\0000\Control”为创建新的键“ActiveService”, “REG_SZ”, “Fbwf”“ActiveService”为值的名称“REG_SZ”值的类型(SZ为字符串,DWORD就是dowrd类型)“Fbwf”值的数据内容 回收站无法使用的问题。因Fbwf将C盘保护起来了,所以回收站基本等于无用,可以关闭掉。方法请Google。 常用Fbwf命令1.查看FBWF的状态
Fbwfmgr
//查看FBWF的状态。
也可以使用
Fbwfmgr /displayconfig
//查看FBWF的状态。
成功返回:
File-based write filter configuration for the current session:
//当前FBWF状态。
filter state: enabled.
// FBWF现在处在开状态。
overlay cache data compression state: enabled.
//压缩覆盖缓存:开启。
解释一下FBWF拦截的数据放在缓冲区中即覆盖缓存
overlay cache threshold: 1024 MB.
// 覆盖缓存区大小:1024MB。
overlay cache pre-allocation: disabled.
// 覆盖缓存预分配:关闭。开启后会预先分配FBWF的覆盖缓存。
size display: virtual mode.
// 覆盖缓存:虚拟模式。FBWF具有两种模式实际模式和虚拟模式,在虚拟模式下覆盖缓存的可用容量=被写保护驱动器显示的可用容量。
例如C驱动器被写保护,当前(虚拟模式,系统运行)C驱动器还有128MB的可用空间即表示覆盖缓存还有128MB可用。
protected volume list:
\Device\HarddiskVolume1
//当前受写保护的驱动器,这里用驱动器号表示
HarddiskVolume1=C:
HarddiskVolume2=D:
……
注意:有时候不是按顺序排的。例如:HarddiskVolume3=D:例如
write through list of each protected volume:
\Device\HarddiskVolume1:
\Documents and Settings\Administrator\Local Settings\Temp
\Documents and Settings\Administrator\Local Settings\Temporary InternetFiles
\Documents and Settings\Administrator\My Documents
\Documents and Settings\Administrator\桌面
\Documents and Settings\All Users\My Documents
\Documents and Settings\All Users\桌面
\RegfData
\WINDOWS\TEMP
\userdata
//FBWF的豁免写保护列表。在列表中的文件或文件夹不受写保护。\Device\HarddiskVolume3: (none)表示整个驱动器(HarddiskVolume3)又受到写保护。
注意:\RegfData文件如果存在在C:下不要将其从豁免写保护列表中手动删除和添加。同样不要尝试添加和删除\fbwf.cfg
File-based write filter configuration for the next session:
//下次启动系统(系统重起后)FBWF状态。
filter state: disabled.
// FBWF在下次启动被关闭。2. FBWF的开启和关闭。
开启:
FbwfMgr /enable
成功返回:
File-based write filter will be enabled on the next reboot.
关闭:
FbwfMgr /disable
成功返回:
File-based write filter will be disabled on the next reboot.
注意:两条命令都重起后生效3.向FBWF豁免写保护列表添加删除驱动器(添加删除受FBWF控制的驱动器)
添加:
FbwfMgr /addvolume \Device\HarddiskVolume3
//添加\Device\HarddiskVolume3 添加驱动器到FBWF豁免写保护列表,默认列表为空(该驱动器将受到FBWF保护)
也可以这样写
FbwfMgr /addvolume D:
//添加D:驱动器到FBWF豁免写保护列表
正常返回:
Volume \Device\HarddiskVolume3 will be protected after the next reboot.
或者
Volume d: will be protected after the next reboot.错误返回:
Volume cannot be added. Filter is not enabled for the next session.
//下次FBWF为关闭状态,开启才能使用。删除:
FbwfMgr /removevolume \Device\HarddiskVolume3 1
//从FBWF豁免写保护列表删除HarddiskVolume3 驱动器 (该驱动器将不再受到FBWF保护)
也可以这样写
FbwfMgr /removevolume d: 1
//从FBWF豁免写保护列表删除d: 驱动器注意本命令有一个开关
1代表:重起后删除该驱动器豁免写保护列表。
0代表:重起后不删除该驱动器豁免写保护列表。
正常返回:
Volume \Device\HarddiskVolume3 will not be protected after the next reboot.
或者
Volume d: will not be protected after the next reboot.
错误返回:
Volume cannot be added. Filter is not enabled for the next session.
//下次FBWF为关闭状态,开启才能使用。
注意:两条命令都是重起后生效,并且下次重起FBWF为开启状态才能执行。4. 向FBWF豁免写保护列表(不受FBWF写保护)添加文件夹。
添加文件夹:
FbwfMgr /addexclusion \Device\HarddiskVolume1 \Temp
//将Device\HarddiskVolume1\Temp 文件夹添加进FBWF豁免写保护列表。
也可以这样写:
FbwfMgr /addexclusion c: \Temp
//将c:\Temp文件夹添加到FBWF豁免写保护列表。成功返回:
Path \Temp on volume \Device\HarddiskVolume1 will be in the exclusion list after the next reboot.
或者
Path \Temp on volume c: will be in the exclusion list after the next reboot.错误返回:
Path cannot be added. Filter is not enabled for the next session.
// 下次FBWF为关闭状态,开启才能使用。注意:命令中磁盘号和文件夹路径有一个空格。
命令中盘符和文件夹路径有一个空格
例如:正确的表示:Device\HarddiskVolume1 \Temp 或者c: \Temp
错误的表示:Device\HarddiskVolume1\Temp 或者:c:\Temp注意:命令重起后生效,并且下次重起FBWF为开启状态才能执行。
即使路径不存在也可以添加,但是必须先用FbwfMgr /addvolume命令添加驱动器否则会出现错误:FbwfMgr failed: 系统找不到指定的驱动器。5.向FBWF豁免写保护列表(不受FBWF写保护)添加文件。
FbwfMgr /addexclusion \Device\Harddisklume1 \1.txt
//将Device\HarddiskVolume1\1.txt 文件添加进FBWF豁免写保护列表。
也可以这样写
FbwfMgr /addexclusion c: \1.txt
//将c:\1.txt 文件添加进FBWF豁免写保护列表。
成功返回:
Path \1.txt on volume \Device\HarddiskVolume1 will be in the exclusion list after the next reboot.
或者
Path \1.txt on volume c: will be in the exclusion list after the next reboot.
错误返回:
Path cannot be added. Filter is not enabled for the next session.
// 下次FBWF为关闭状态,开启才能使用。
注意:命令中磁盘号和文件路径有一个空格。
命令中盘符和文件路径有一个空格
例如:正确的表示:Device\HarddiskVolume1 \1.txt 或者c: \1.txt
错误的表示:Device\HarddiskVolume1\1.txt 或者:c:\1.txt注意:。
命令重起后生效,并且下次重起FBWF为开启状态才能执行。
即使路径不存在也可以添加,但是必须先用FbwfMgr /addvolume命令添加驱动器否则会出现错误:FbwfMgr failed: 系统找不到指定的驱动器。6.删除FBWF豁免写保护列表(不受FBWF写保护)的文件夹
FbwfMgr /Removeexclusion \Device\HarddiskVolume1 \Temp
//将Device\HarddiskVolume1\Temp 从FBWF豁免写保护列表中删除。
也可以这样写:
FbwfMgr /Removeexclusion c: \Temp
//将c:\Temp文件夹从FBWF豁免写保护列表中删除。
注意:命令中磁盘号和文件夹路径有一个空格。
命令中盘符和文件夹路径有一个空格
例如:正确的表示:Device\HarddiskVolume1 \Temp 或者c: \Temp
错误的表示:Device\HarddiskVolume1\Temp 或者:c:\Temp注意:命令重起后生效,并且下次重起FBWF为开启状态才能执行。7.删除FBWF豁免写保护列表(不受FBWF写保护)的文件
FbwfMgr /Removeexclusion \Device\Harddisklume1 \1.txt
//将Device\HarddiskVolume1\1.txt 文件添加进FBWF豁免写保护列表。
也可以这样写
FbwfMgr /Removeexclusion c: \1.txt
//将c:\1.txt 文件从BWF豁免写保护列表中删除。
注意:命令中磁盘号和文件路径有一个空格。
命令中盘符和文件路径有一个空格
例如:正确的表示:Device\HarddiskVolume1 \1.txt 或者c: \1.txt
错误的表示:Device\HarddiskVolume1\1.txt 或者:c:\1.txt注意:
命令重起后生效,并且下次重起FBWF为开启状态才能执行。8.将FBWF覆盖缓冲区的文件写入磁盘(将改变的文件写入磁盘保存)
FbwfMgr /commit \Device\Harddisklume1 \1.txt
//将Device\HarddiskVolume1\1.txt 从FBWF覆盖缓冲区写入磁盘(重起后1.txt不会复位)
也可以这样写
FbwfMgr /commit c: \1.txt
//将Device\HarddiskVolume1\1.txt从FBWF覆盖缓冲区写入磁盘(重起后1.txt不会复位)
成功返回:
Changes made to file \1.txt on volume C: are committed.
注意:不支持文件夹和通配符(*.*)。
(使用通配符发现返回下列错误:测试的时候发现FbwfMgr failed: Windows 无法找到网络路径。请确认网络路径正确并且目标计算机不忙或已关闭。如果 Windows 仍然无法找到网络路径,请与网络管理员联系。)
不支持在FBWF开启后新建的文件。根目录除外。
不支持在FBWF豁免列表的文件, 9.放弃FBWF覆盖缓冲区的文件缓冲。
FbwfMgr /restore \Device\Harddisklume1 \1.txt
//放弃Device\HarddiskVolume1\1.txt 文件在FBWF覆盖缓冲区的内容(1.txt文件会立即复位)
也可以这样写
FbwfMgr /restore c: \1.txt
//放弃Device\HarddiskVolume1\1.txt文件在FBWF覆盖缓冲区的内容(1.txt文件会立即复位)
成功返回:
Changes made to file \1.txt on volume C: are committed.
注意:不支持文件夹和通配符(*.*)。
(使用通配符发现返回下列错误:测试的时候发现FbwfMgr failed: Windows 无法找到网络路径。请确认网络路径正确并且目标计算机不忙或已关闭。 如果 Windows 仍然无法找到网络路径,请与网络管理员联系。)
不支持在FBWF开启后新建的文件。根目录除外。
不支持在FBWF豁免列表的文件, 10.察看详细的FBWF覆盖缓冲使用情况
FbwfMgr / overlaydetail
成功返回:
Overlay detail for each protected volume:
\Device\HarddiskVolume1:
//驱动器号:\Device\HarddiskVolume1:
file
1: name \Documents and Settings\Administrator\Application Data\Microsoft\Windows\Themes\Custom.theme
cache size 2544, open handle 0
//文件号码、完整路径
//占用缓存大小、是否被打开。
file
2: name \Documents and Settings\Administrator\Application Data\Microsoft\CryptnetUrlCache\MetaData\60E31627FDA0A46932B0E5948949F2A5
cache size 418, open handle 0
file
3: name \Documents and Settings\Administrator\Application Data\Microsoft\CryptnetUrlCache\MetaData\A8FABA189DB7D25FBA7CAC806625FD30
cache size 427, open handle 0
file
4: name \Documents and Settings\Administrator\Application Data\Microsoft\CryptnetUrlCache\Content\60E31627FDA0A46932B0E5948949F2A5
cache size 1133, open handle 0
file
5: name \Documents and Settings\Administrator\Application Data\Microsoft\CryptnetUrlCache\Content\A8FABA189DB7D25FBA7CAC806625FD30
cache size 63014, open handle 0
file
6: name \Documents and Settings\Administrator\Cookies\index.dat
cache size 364, open handle 1
……
file 194: name \WINDOWS\SchedLgU.Txt
cache size 454, open handle 1
file 195: name \WINDOWS\setupapi.log
cache size 48648, open handle 0
file 196: name \WINDOWS\setupact.log
cache size 1264, open handle 0
file 197: name \WINDOWS\Installer\89f0c.msi
cache size 2342814, open handle 0
file 198: name \WINDOWS\Installer\{3B410500-1802-488E-9EF1-4B11992E0440}\ARPPRODUCTICON.exe
cache size 16053, open handle 0
file 199: name \WINDOWS\Installer\{3B410500-1802-488E-9EF1-4B11992E0440}\1033.MST
cache size 7471, open handle 0
file 200: name \1.txt
cache size 428, open handle 1
Memory consumed by directory structure: 1864 KB
Memory consumed by file data: 17897 KB
//目录占用缓存大小。
//文件占用缓存大小。10.改变FBWF覆盖缓冲容量。
fbwfmgr
/setthreshold 128
//设置FBWF覆盖缓冲容量为128MB(16MB-1024MB)。
成功返回:
Overlay cache threshold will be 128 MB after the next reboot.
注意:命令重起后生效11.设置是否压缩覆盖缓存
FbwfMgr /setcompression 1
//开启压缩覆盖缓存
成功返回:
Overlay cache will be compressed after the next reboot.
FbwfMgr /setcompression |0
//关闭压缩覆盖缓存
成功返回:
Overlay cache will not be compressed after the next reboot.
注意:开启压缩覆盖缓存后预分配覆盖缓存自动关闭,命令重起后生效
12.设置是否预分配压缩覆盖缓存
FbwfMgr /setpreallocation 1
//开启预分配覆盖缓存
成功返回:
Overlay cache will be pre-allocated after the next reboot.
FbwfMgr /setpreallocation 0
//关闭预分配覆盖缓存
成功返回:
Overlay cache will not be pre-allocated after the next reboot.
注意:开启预分配覆盖缓存后压缩覆盖缓存自动关闭,命令重起后生效。
13.设置FBWF覆盖缓存容量显示是虚拟模式还是实际模式。
FbwfMgr /setsizedisplay 1
//开启虚拟模式,在虚拟模式下覆盖缓存的可用容量=被写保护驱动器显示的可用容量。
例如C驱动器被写保护, C驱动器还有128MB的可用空间即表示覆盖缓存还有128MB可用。
成功返回:
Size Display set to virtual mode.
//开启虚拟模式
FbwfMgr /setsizedisplay 0
//开启实际模式
成功返回:
Size Display set to actual mode.
注意:改变模式需要重起后才能生效。
14.显示磁盘有效容量。
fbwfmgr /getvirtualsize c:
//显示C驱动器有效容量。
成功返回:
Volume size in bytes: 2,034,651,136
//总容量大小
Volume free size in bytes: 1,055,412,224
//可用容量大小
15.显示磁盘实际可用容量盘。
fbwfmgr /getactualsize c:
//显示C驱动器实际可用容量大小盘。
成功返回:
Volume size in bytes: 8,587,159,552
//总容量大小
Volume free size in bytes: 7,623,450,624
//可用容量大小 psexec下载地址
http://technet.microsoft.com/en-us/Sysinternals/bb897553.aspx