zoukankan      html  css  js  c++  java
  • Linux搭建NFS提供磁盘给Windows使用

    在Windows2008系统下设置挂载Linux服务器磁盘


    一、系统环境

    系统平台:CentOS release 5.8 (Final)

    NFS Server IP:X....X...153.157

    防火墙已关闭

    [root@htuidc ~]# setenforce 0

     

    [root@htuidc ~]# service iptables stop

     

    /iptables: Firewall is not running.

    SELINUX=disabled


    二、安装NFS服务

    [root@htuidc ~]# yum install nfs-utils-* portmap-* rpcbind
    -y
    [root@htuidc ~]# vi /etc/exports 

    /aaa *(rw,no_root_squash)
    /aaa 42.51.0.0/16(rw)

    [root@htuidc aaa]# /etc/init.d/rpcbind restart
    Stopping rpcbind:                                          [  OK  ]
    Starting rpcbind:                                          [  OK  ]
    [root@htuidc aaa]# /etc/init.d/nfs restart
    Shutting down NFS daemon:                                  [  OK  ]
    Shutting down NFS mountd:                                  [  OK  ]
    Shutting down NFS services:                                [  OK  ]
    Shutting down RPC idmapd:                                  [  OK  ]
    Starting NFS services:                                     [  OK  ]
    Starting NFS mountd:                                       [  OK  ]
    Starting NFS daemon:                                       [  OK  ]
    Starting RPC idmapd:                                       [  OK  ]

    设置NFS服务器的自动启动状态
    [root@htuidc /]# chkconfig --level 35 portmap on
    [root@htuidc /]# chkconfig --level 35 nfs on
    [root@htuidc /]# chkconfig --list portmap
    portmap         0:off 1:off 2:off 3:on 4:on 5:on 6:off
    [root@htuidc /]# chkconfig --list nfs
    nfs             0:off 1:off 2:off 3:on 4:off 5:on 6:off

    三.Windows2008开启NFS功能

     
     



        可以看到UID=-2由于在存储设备上共享出来的NFS文件系统归属于root权限,并且无法修改该所属用户,而Windows通过UID=-2的用户去写,肯定写不进去。
        
        解决办法就是让Windows 7在挂载NFS的时候将UID和GID改成0即可:打开注册表:HKEY_LOCAL_MACHINESOFTWAREMicrosoftClientForNFSCurrentVersionDefault,增加两项:AnonymousUid,AnonymousGid,如图:


       重新启动计算机,重新mount即可。此时就能在Windows 7下对nfs文件系统进行读写操作了,跟本地磁盘一样。


    卸载:
    umount X:
    查看帮助:
    mount -t

     





  • 相关阅读:
    201911320《信息安全专业导论》第二周学习总结
    20191330自我介绍
    20191218 实验四《Python程序设计》实验报告
    20191218 2019-2020-2 《Python程序设计》实验三报告
    20191218 实验二《Python程序设计》实验报告
    20191218 实验一 《Python程序设计》实验报告
    2019-2020-1学期 20192420《网络空间安全专业导论》第四周读书笔记
    2019-2020第一学期小组讨论--程序设计层6、7章
    20192415 2020-2021-2 《Python程序设计》实验4报告
    20192415 2020-2021-2 《Python程序设计》实验3报告
  • 原文地址:https://www.cnblogs.com/yangxiaofei/p/5021207.html
Copyright © 2011-2022 走看看