/tmp/ 192.168.133.0/24(rw,sync,no_root_squash)
[root@hf-01 ~]# umount /mnt/
[root@hf-01 ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda3 18G 6.5G 12G 37% /
devtmpfs 483M 0 483M 0% /dev
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 493M 6.7M 486M 2% /run
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/sda1 197M 109M 88M 56% /boot
tmpfs 99M 0 99M 0% /run/user/0
[root@hf-01 ~]#
[root@hanfeng ~]# exportfs -arv
exporting 192.168.202.0/24:/home/nfstestdir
[root@hanfeng ~]#
[root@hanfeng ~]# vim /etc/exports
在配置文件中加入
/tmp 192.168.202.131(rw,sync,no_root_squash)
结果如下
/home/nfstestdir 192.168.202.0/24(rw,sync,all_squash,anonuid=1000,anongid=1000)
/tmp 192.168.202.131(rw,sync,no_root_squash)
保存退出
[root@hanfeng ~]# exportfs -arv
exporting 192.168.202.131:/tmp
exporting 192.168.202.0/24:/home/nfstestdir
[root@hanfeng ~]#
[root@hf-01 ~]# showmount -e 192.168.202.130
Export list for 192.168.202.130:
/home/nfstestdir 192.168.202.0/24
/tmp 192.168.202.131
[root@hf-01 ~]#
[root@hf-01 ~]# mount -t nfs 192.168.202.130:/tmp/ /mnt/
[root@hf-01 ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda3 18G 6.5G 12G 37% /
devtmpfs 483M 0 483M 0% /dev
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 493M 6.7M 486M 2% /run
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/sda1 197M 109M 88M 56% /boot
tmpfs 99M 0 99M 0% /run/user/0
192.168.202.130:/tmp 18G 3.2G 15G 18% /mnt
[root@hf-01 ~]#
[root@hf-01 ~]# ls /mnt/
hanfeng.sock mysql.sock php-fcgi.sock test.com.log
[root@hf-01 ~]#
[root@hanfeng ~]# ls /tmp/
hanfeng.sock mysql.sock php-fcgi.sock test.com.log
[root@hanfeng ~]#
[root@hf-01 ~]# vim /mnt/1212.txt
[root@hf-01 ~]# ls -l /mnt/
总用量 8
-rw-r--r-- 1 root root 12 1月 17 2018 1212.txt
srw-rw-rw- 1 root root 0 1月 17 2018 hanfeng.sock
srwxrwxrwx 1 mysql mysql 0 1月 17 2018 mysql.sock
srw-rw-rw- 1 root root 0 1月 17 2018 php-fcgi.sock
-rw-r--r-- 1 root root 2383 1月 8 19:41 test.com.log
[root@hf-01 ~]#
[root@hanfeng ~]# ls -l /tmp/
总用量 8
-rw-r--r--. 1 root root 12 1月 17 21:53 1212.txt
srw-rw-rw-. 1 root root 0 1月 17 18:44 hanfeng.sock
srwxrwxrwx. 1 mysql mysql 0 1月 17 18:44 mysql.sock
srw-rw-rw-. 1 root root 0 1月 17 18:44 php-fcgi.sock
-rw-r--r--. 1 root root 2383 1月 8 19:41 test.com.log
[root@hanfeng ~]#