也许为时已晚,但在Arch中,我通过以下方式完成此任务:
/etc/modprobe.d/cifs.conf
-------------------------
# Disable caching and the CIFS oplog for stable NTFS network shares
options cifs enable_oplocks=0
install cifs /sbin/modprobe --ignore-install cifs $CMDLINE_OPTS && echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled && echo 0 > /proc/fs/cifs/LookupCacheEnabled
remove cifs /sbin/modprobe -r cifs
这是一个确定有效模块选项的便捷功能.
# Shamelessly ripped the Kernel_Modules ArchWiki entry:
# https://wiki.archlinux.org/index.php?title=Kernel_modules&oldid=286087#Bash_function_to_list_module_parameters
function aa_mod_parameters ()
{
N=/dev/null;
C=`tput op` O=$(echo -en "\n`tput setaf 2`>>> `tput op`");
for mod in $(cat /proc/modules|cut -d" " -f1);
do
md=/sys/module/$mod/parameters;
[[ ! -d $md ]] && continue;
m=$mod;
d=`modinfo -d $m 2>$N | tr "\n" "\t"`;
echo -en "$O$m$C";
[[ ${#d} -gt 0 ]] && echo -n " - $d";
echo;
for mc in $(cd $md; echo *);
do
de=`modinfo -p $mod 2>$N | grep ^$mc 2>$N|sed "s/^$mc=//" 2>$N`;
echo -en "\t$mc=`cat $md/$mc 2>$N`";
[[ ${#de} -gt 1 ]] && echo -en " - $de";
echo;
done;
done
}
有关modprobe.d语法的更多信息,请参见man 5 modprobe.d.
此外,CIFS安装遵循缓存选项.根据the mount.cifs manual,设置cache = none应禁用缓存,而默认值为cache = strict.