Network File System (NFS) is a mechanism for attaching partitions (directories) on a remote host to a local system over the network. with support for network file systems, users can share partitions on the remote host on the local system like operating on the local partition (contents...
Network File System (NFS) is a mechanism for attaching partitions (directories) on remote hosts to local systems through the Network, with support for the network file system, you can operate on the shared partition (directory) of the remote host on the local system just like operating on the local partition. During the development process of www.2cto.com in embedded Linux, developers need to develop all the software on the Linux server. after cross-compilation, the general FTP Mode Downloads executable files to the embedded system for running, however, this method is not only inefficient, but cannot be used for online debugging. Therefore, you can create NFS to share specific partitions on the Linux server to the embedded target system to be debugged, and then operate the Linux server directly on the embedded target system, at the same time, you can debug and modify the program online, greatly facilitating software development. Therefore, NFS is an important part of embedded Linux development. This section details how to configure the NFS development environment of embedded Linux. The implementation of the NFS development environment in embedded Linux includes two aspects: one is the support of the NFS server on the Linux server, and the other is the support of the NFS client on the embedded target system. Therefore, to establish an NFS development environment, you must configure the Linux server and embedded target system. NFS is developed and developed by Sun to share files between different machines and operating systems over the network. NFS server can also be seen as a file server, which is used to share files between UNIX-type systems and can be easily mounted to a directory, it is as convenient as a local file. ========================================================== ====================================== Type: system V-launched Service software package: nfs-utils process: nfsd, lockd, rpciod, rpc. {mounted, rquotad, statd} script: nfs, nfslock Port: Port assigned by the portmap service (111) configuration file:/etc/exports auxiliary tool: portmap (required) related commands: rpcinfo-p [IPADD]: view the rpc service showmount-e provided by the Server: view the service shared directory www.2cto.com Server: 1. /etc/exports format: Directory option example: share/share directory to 192.168.0.x users/share 192.168.0.0/24 (rw)/home/haiouc/haioucshare * (rw, sync, all_squash) /mnt/cdrom 192.168.0. * (ro) => * indicates that all ip addresses are allowed to access the disk. you must grant certain permissions to the directory/home/haiouc/haioucshare. you can attach local CDs, use nfs to share with others. 2. start the portmap service: service portmap start [restart] 3. start NFS service: service nfs start [restart] Client: 1. start the portmap service: service portmap start [restart] 2. mount the server-side shared directory (assuming the server-side 192.168.0.1): mkdir/mnt/localshare mount-t nfs 192.168.0.1: /share/mnt/localshare ==================================== ================================================== showmount // display the NFS server file system mounting information showmount-e // display the NFS server output list ============== ========================================================== ================== chkconfig -- level 35 nfs on // sets the NFS automatic start mode; www.2cto.com ========================================== ======================================== by modifying/etc/fstab file can be automatically mounted to the nfs Directory [root @ server6 nfs1] # cat/etc/fstab # This file is edited by fstab-sync-see 'Man fstab-sync' for details LABEL /// ext3 defaults 1 1 none/dev/pts devpts gid = 5, mode = 620 0 0 none/dev/shm tmpfs defaults 0 0 none/proc defaults 0 0 none/sys sysfs defaults 0 0 LABEL = SWAP-hdc2 swap defaults 0 0 192.168.1.10: /home/haiouc/haioucshare/mnt/nfs1 nfs defaults 0 0 0 ==================== ========================================================== ======= NFS parameter information: access permission options • set output directory read-only ro • set output directory read/write rw user ing options • all_squash maps all common users and groups remotely accessed to anonymous users or user groups (nfsnobody); • no_all_squash and all_squash (default setting); www.2cto.com • root_squash maps root users and groups to anonymous users or user groups (default setting); • no_root_squash and rootsquash reverse; • anonuid = xxx maps all remotely accessed users to anonymous users and specifies the user as a local user (UID = xxx ); • anongid = xxx maps all remotely accessed user groups to anonymous user group accounts, and specifies the anonymous user group account as the local user group account (GID = xxx ); other options • secure limits the client to be able to connect to the nfs server from a TCP/IP port smaller than 1024 (default setting); • insecure allows the client to connect to the server from a TCP/IP port larger than 1024; • sync writes data to the memory buffer and disk synchronously, which is less efficient but ensures data consistency. • async saves data in the memory buffer and writes it to the disk only when necessary; • wdelay checks whether there are related write operations. If yes, the write operations can be executed together to improve the efficiency (default setting). • no_wdelay performs the write operation immediately, it should be used with sync; • If the subtree output directory is a sub-directory, the nfs server will check the permissions of its parent directory (default setting); • no_subtree even if the output directory is a sub-directory, the nfs server does not check the permissions of its parent directory, which improves efficiency.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service