您的位置:首页 > 运维架构 > Linux

NFS basics

2012-12-26 00:00 393 查看
NFS (Network File System)

==========================

Basics

------

Network File System (NFS) is a distributed file system protocal originally

developed by Sun Microsystems in 1984, allowing a user on a client computer

to access files over a network in a manner similar to how local storage is

accessed.

A filesystem which supports the mapping between filehandle fragments and

dentries will be termed "exportable".

A filesystem must be "exportable" to be accessed from a remote computer.

/etc/exports: the access control list for filesystems which may be exported

to NFS clients. See exports(5).

How to make an nfs mount?

server: modify /etc/exports to export some directories

client: mount <server_ip>/<exported_dir> <local_dir>

Q & A

-----

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

nfsd file system?

2. "Permission denied" problem on nfs client.

'no_root_squash' is not specified in the corresponding config item in /etc/exports.

3. What does 'no_root_squash' mean?

'no_root_squash' is a setting that allows nfs clients to connect as root.

Terminology

-----------

distributed file system

Open Network Computing Remote Procedure Call (ONC RPC)

filehandle fragment

exportable filesystems

NFS in yocto

------------

1) Problem

starting 8 nfsd kernel threads: rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).

Please try, as root, 'mount -t nfsd nfsd /proc/fs/nfsd' and then restart rpc.nfsd to correct the problem

done

2) Status

root@qemux86:/etc/rc5.d# ls -l | grep nfs

lrwxrwxrwx 1 root root 19 Dec 19 06:03 S20nfsserver -> ../init.d/nfsserver

It seems that our yocto-based image could only be used as an nfs client. /proc/fs/nfsd is empty.

Then why is nfsserver in /etc/init.d/ directory?

And we can see /etc/exports states that "/ *(rw,no_root_squash,async,no_subtree_check)".

Is there anything wrong with the nfs server in our system?

Examples

--------

1) Examine /etc/exports on our servers.

Try it out on our servers.

References

----------

Linux Kernel Documents (<kernel src>/Documentation/filesystems/nfs/)

man exports
https://www.digitalocean.com/community/articles/how-to-set-up-an-nfs-mount-on-ubuntu-12-04
(How to set up an nfs mount on Ubuntu 12.04)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Linux NFS kernel nfsd yocto