开始使用这个:
mount -t nfs 192.168.119.138:/root/work /share
报错:
cat /var/log/messages | grep mount
Nov 4 15:16:09 air02 rpc.mountd[19139]: Caught signal 15, un-registering and exiting.
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission denied
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission denied
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission denied
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission denied
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission denied
Nov 4 15:16:34 air02 rpc.mountd[19202]: Could not bind socket: (13) Permission denied
Nov 4 15:16:34 air02 rpc.mountd[19206]: Version 1.2.7 starting
换成这个ok:mount -t nfs air02:/root/work /share
辅助:
1. 使用的命令:
yum install portmap nfs-utils
service nfs start
exportfs -a
service nfs restart
service nfs start.如果在启动之后需要修改exports,可以exportfs -rv重新输出.
2. 文章:
Configure as a NFS Client(http://www.server-world.info/en/note?os=Fedora_19&p=nfs&f=2)[root@www ~]# yum -y install nfs-utils[root@www ~]# vi /etc/idmapd.conf# line 5: uncomment and change to your domain nameDomain = server.world[root@www ~]# systemctl start rpcbind.service [root@www ~]# systemctl start nfs-lock.service [root@www ~]# systemctl start nfs-idmap.service [root@www ~]# systemctl start nfs-mountd.service [root@www ~]# systemctl enable rpcbind.service [root@www ~]# systemctl enable nfs-lock.service [root@www ~]# systemctl enable nfs-idmap.service [root@www ~]# systemctl enable nfs-mountd.service [root@www ~]# mount -t nfs dlp.server.world:/home /home [root@www ~]# df -h Filesystem Size Used Avail Use% Mounted on/dev/mapper/fedora-root 27G 979M 25G 4% /devtmpfs 996M 0 996M 0% /devtmpfs 1002M 0 1002M 0% /dev/shmtmpfs 1002M 276K 1002M 1% /runtmpfs 1002M 0 1002M 0% /sys/fs/cgrouptmpfs 1002M 8.0K 1002M 1% /tmp/dev/vda1 477M 77M 375M 17% /bootdlp.server.world:/home 27G 982M 25G 4% /home# home directory on NFS is mounted[root@www ~]# vi /etc/fstab/dev/mapper/fedora-root / ext4 defaults 1 1UUID=61085d0b-960b-4835-8c0e-6f036fe7a623 /boot ext4 defaults 1 2/dev/mapper/fedora-swap swap swap defaults 0 0# add at the lat line: change home directory this server mounts to the one on NFSdlp.server.world:/home /home nfs defaults 0 0Configure as a NFS Server [root@dlp ~]# yum -y install nfs-utils[root@dlp ~]# vi /etc/idmapd.conf# line 5: uncomment and change to your domain nameDomain = server.world[root@dlp ~]# vi /etc/exports# write like below *note/home 10.0.0.0/24(rw,sync,no_root_squash,no_all_squash)# *note/home ⇒ shared directory10.0.0.0/24 ⇒ range of networks NFS permits accessesrw ⇒ writablesync ⇒ synchronizeno_root_squash ⇒ enable root privilegeno_all_squash⇒ enable users' authority[root@dlp ~]# systemctl start rpcbind.service [root@dlp ~]# systemctl start nfs-server.service [root@dlp ~]# systemctl start nfs-lock.service [root@dlp ~]# systemctl start nfs-idmap.service [root@dlp ~]# systemctl enable rpcbind.service [root@dlp ~]# systemctl enable nfs-server.service [root@dlp ~]# systemctl enable nfs-lock.service [root@dlp ~]# systemctl enable nfs-idmap.service