Ubuntu NFS server

Source: Internet
Author: User

Create an NFS server
NFS is often used for Embedded Linux development. Program Debugging. With NFS, you can
Place the root file system used by the Board in the host directory. The Development Board mounts the system to this directory over Ethernet and
The files in the directory are used as the content of the root file system, so that after the user program is updated, it is no longer necessary to re-burn the root file system of the Board.
System can be reused, which can greatly accelerate program debugging.
To install the NFS server in Ubuntu, follow these steps:
4.3.1 install the NFS server and client:
Sudo apt-Get install nfs-kernel-server nfs-common Portmap
The client can be installed to test the NFS service on the local machine.
4.3.2 configure Portmap
You can choose either of the two methods:
(1): sudo Emacs/etc/default/Portmap
Remove-I 127.0.0.1
(2) sudo dpkg-reconfigure Portmap
Select "no" after running"
In addition, it is very important to use the sysv-RC-conf (instead of chkconfig) tool to check the current NFS and Portmap
If off, use sudo sysv-RC-conf Portmap on or sudo sysv-RC-conf nfs-kernel-server on
Open
4.3.3 configure the Mount directory and permissions
Emacs/etc/exports
My configuration is as follows:
#/Etc/exports: the access control list for filesystems which may be exported
# To NFS clients. See exports (5 ).
#
# Example for nfsv2 and nfsv3:
#/Srv/homes hostname1 (RW, sync) hostname2 (RO, sync)
#
# Example for nfsv4:
#/Srv/nfs4 GSS/krb5i (RW, sync, fsid = 0, crossmnt)
#/Srv/nfs4/homes GSS/krb5i (RW, sync)
#
/Nfsboot * (RW, sync)
Explanations:
# Subsequent explanations
/Nfsboot is the NFS shared directory. * indicates that any IP Address can share this directory. You can change it to a restricted IP address, RW
Indicates the permission, and sync indicates the default permission.
4.3.4 update the exports file
If you change/etc/exports, you cannot update this file through sudo exportfs-R.
4.3.5 restart the NFS service
Sudo/etc/init. d/Portmap start
Sudo/etc/init. d/nfs-kernel-server restart NFS service
4.3.6 Test
Try mounting the local disk (My Linux system IP address is 202.198.137.18, Mount/home/nfsboot to/mnt)
$ Sudo Mount 202.198.137.18:/nfsboot/mnt
Run $ DF to check the result
$ Sudo umount/mnt

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.