linux nfs 修复文件,linux nfs Read-only file system

root@pts/4 # touch 1

touch: cannot touch `1': Read-only file system

mount没有权限?

root@pts/0 # mount

/dev/sda2 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)

192.168.0.71:/vol/vol2 on /share type nfs (rw,addr=192.168.0.71)

/dev/sdb1 on /backup type xfs (rw)

nfsd on /proc/fs/nfsd type nfsd (rw)

192.168.3.150:/tmp/sem on /tmp/sem type nfs (rw,vers=4,addr=192.168.3.150,clientaddr=192.168.2.127)

是rw权限。什么情况?

看下权限,755,没有问题啊

root@pts/4 # ll

total 16

drwxr-xr-x 4 root root 4096 Dec  3 11:30 client

drwxr-xr-x 2 root root 4096 Dec 25 15:17 flash

drwxr-xr-x 6 root root 4096 Dec  3 16:46 touch

drwxr-xr-x 7 root root 4096 Dec  3 15:47 web赋值777权限试试?

root@pts/4 # chmod -R 777 /tmp/sem/

chmod: changing permissions of `/tmp/sem/client': Read-only file system

chmod: changing permissions of `/tmp/sem/flash': Read-only file system

chmod: changing permissions of `/tmp/sem/web/model2': Read-only file system

服务器的文件系统损坏了?验证下

root@pts/1 # mkdir 1

192.168.3.150 [/tmp/sem] 2014-12-26 12:08:18

root@pts/1 # ls

1  client  flash  touch  web

服务器端没有问题啊。

难道是nfs问题吗?

root@pts/1 # vim /etc/exports

/tmp/htdocs/sem * (rw)

没有看出来,重启下nfs试试?

192.168.3.150 [/www/youyuan.com.1/htdocs/sem] 2014-12-26 12:49:59

root@pts/1 # /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  ]

Starting NFS services:  exportfs: No options for /www/youyuan.com.1/htdocs/sem *: suggest *(sync) to avoid warning

exportfs: No host name given with /www/youyuan.com.1/htdocs/sem (rw), suggest *(rw) to avoid warning

exportfs: incompatible duplicated export entries:

exportfs:       *:/www/youyuan.com.1/htdocs/sem (0x424) [IGNORED]

exportfs:       *:/www/youyuan.com.1/htdocs/sem (0x425)

[  OK  ]

Starting NFS quotas:                                       [  OK  ]

Starting NFS mountd:                                       [  OK  ]

Starting NFS daemon:                                       [  OK  ]

报配置文件有误,*和(rw)之间不能有空格。

修正下吧,“*”范围太大了

root@pts/1 # vim /etc/exports

/tmp/htdocs/sem 192.168.0.0/22(rw,sync,no_root_squash)

重启nfs:

root@pts/1 # /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  ]

Starting NFS services:                                     [  OK  ]

Starting NFS quotas:                                       [  OK  ]

Starting NFS mountd:                                       [  OK  ]

Starting NFS daemon:                                       [  OK  ]

客户端在试一下?

root@pts/4 # touch 1

touch: cannot touch `1': Permission denied

这次报访问拒绝,这个是与权限相关的,再次赋值777试试?

root@pts/4 # touch 1

192.168.0.193 [/tmp/sem] 2014-12-26 13:01:47

root@pts/4 # ls

1  client  flash  touch  web

root@pts/4 # rm 1

可以了,修正权限为755

root@pts/4 # touch 1

192.168.0.193 [/tmp/sem] 2014-12-26 13:02:14

root@pts/4 # ls

1  client  flash  touch  web

问题解决;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值