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
服務器的文件系統(tǒng)損壞了?驗證下
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
問題解決;
總結
以上是生活随笔為你收集整理的linux nfs 修复文件,linux nfs Read-only file system的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: head在linux命令中什么意思,Li
- 下一篇: linux目录表及功能n鸟哥,鸟哥lin