linux怎样访问windows共享文件和文件夹
Ameliye
2024-05-27 14:14:17
最佳回答
在开发linux程序中,经常会使用windows的编辑器进行编辑,这样还要拷贝到linux服务器,如果有这种开发习惯的同学,可以使用这种方式进行开发。当然除了这种方法之外,可以再windows安装nfs服务器,但是我的是64位的win7系统,好多nfs服务器不支持,所以就只能使用这种共享文件夹的方式了。windows侧:1:在windows下建立共享文件夹。2:确保windows用户设置了密码。linux侧:1:安装cifs-utils包,安装后,系统出现mount.cifs命令。或者有的发行包里的mount支持 -t cifs参数。2:mount.cifs -o username="共享用户",password="密码" //ip/sharing_folder /mountpoint问题1:在共享虚拟机的文件,编译时会出现如下错误:arm-none-linux-gnueabi-gcc -lpthread -o beep beep.c beeplib.ccc1: error: beep.c: value too large for defined data typecc1: error: beeplib.c: value too large for defined data typemake: *** [beep] error 1修正方法:sudo mount -t cifs -o username=wx,passwd=wx,nounix,noserverino //192.168.1.108/vm_share /mnt/share添加了,nounix,noserverino问题2:unable to umount, device ** busyif you get th** error ** and the 'umount' as well as 'umount -f' commands don't work, try a "lazy" umount:umount -l /mnt/badmountthen mount the share again, as shown below:mount -t cifs //hostname/goodmount /mnt/goodmount -o username=,password=note - using the "cifs" keyword instead of the smbfs keyword after -t will result in fewer problems like th**.问题3: mount error 12 = cannot allocate memory当通过mount.cifs命令对windows下的文件进行映射时,若文件太大,便会产生这种错误,解决方法是:修改注册表 hkey_local_machine\system\currentcontrolset\services\lanmanserver\parameters\irpstacksize项的值大于等于15,若irpstacksize项不存在,就新建一个dword值,点击弹出窗口的的进制为十进制,值写个18就ok了,还要重启一 20210311