菜鸟学习--- linux下nfs Read-only file system
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了菜鸟学习--- linux下nfs Read-only file system相关的知识,希望对你有一定的参考价值。
[[email protected] alidata]# touch 24 touch: cannot touch `24‘: Read-only file system
一、查看mount 是否有权限
[[email protected] /]# mount /dev/sda3 on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0") /dev/sda1 on /boot type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) 10.10.10.11:/sharedata on /alidata type nfs (rw,vers=4,addr=10.10.10.11,clientaddr=10.10.10.12) [[email protected] /]# ll total 106 drwxr-xr-x. 2 nfsnobody nfsnobody 4096 Oct 18 22:51 alidata dr-xr-xr-x. 2 root root 4096 Oct 18 21:32 bin dr-xr-xr-x. 5 root root 1024 Jul 14 21:44 boot drwxr-xr-x. 2 root root 4096 Nov 23 2013 cgroup
二|、尝试赋予777权限
[[email protected] /]# chmod 777 /alidata/ chmod: changing permissions of `/alidata/‘: Read-only file system
三、重启nfs
[[email protected] /]# /etc/init.d/nfs restart Shutting down NFS daemon: [ OK ] Shutting down NFS mountd: [ OK ] Shutting down NFS quotas: [ OK ] Shutting down NFS services: [ OK ] Shutting down RPC idmapd: [ OK ] Starting NFS services: exportfs: No options for /sdata 10.10.10.0/24: suggest 10.10.10.0/24(sync) to avoid warning exportfs: No host name given with /sdata (rw,sync), suggest *(rw,sync) to avoid warning [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] Starting RPC idmapd: [ OK ]
注:提示在24和( 之间有空格;终于找到原因
[[email protected] /]# cat /etc/exports ##share data for 20171018 /sharedata 10.10.10.0/24 (rw,sync)
然后编辑,删除空格,重新启动nfs
[[email protected] /]# /etc/init.d/nfs restart Shutting down NFS daemon: [ OK ] Shutting down NFS mountd: [ OK ] Shutting down NFS quotas: [ OK ] Shutting down NFS services: [ OK ] Shutting down RPC idmapd: [ OK ] Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] Starting RPC idmapd: [ OK ]
检查出什么问题,然后在重新建立文件
[[email protected] alidata]# touch asd [[email protected] alidata]# ll total 72 -rw-r--r--. 1 root root 0 Oct 18 23:53 ad -rw-r--r--. 1 nfsnobody nfsnobody 0 Oct 19 00:11 asd -rw-r--r--. 1 nfsnobody nfsnobody 46850 Mar 23 2016 log.txt -rw-r--r--. 1 nfsnobody nfsnobody 14476 Mar 23 2016 mytlv-20160119.log -rw-r--r--. 1 nfsnobody nfsnobody 4537 Sep 5 22:12 qzj.txt
终于解决,原因是因为自己在配置/etc/exports的时候没有注意,中间添加了空格,
本文出自 “菜鸟八哥” 博客,请务必保留此出处http://cainiaibage.blog.51cto.com/5307589/1973964
以上是关于菜鸟学习--- linux下nfs Read-only file system的主要内容,如果未能解决你的问题,请参考以下文章