Virtual Machine ubuntu10.04 Mount NFS

Source: Internet
Author: User

First, the environment

Virtual machine: VMware 7.0

Linux system: Ubuntu10.04

PC operating system: Windows XP

Client side: ARM9 Development Board (Freescale IMX27)

Second, install NFS server program

Apt-get Install Nfs-kernel-server

Apt-get Install Nfs-common

You can also use the synaptic (new) Package Manager installation, search for "NFS", select the package "Nfs-kernel-server" Item for installation, start the SUNRPC Service and NFS service by default during installation, and create/etc/exports and Etc/default/nfs-kernel-server configuration file, waiting for the user to complete the NFS installation, configure the resources to be shared, you can use the NETSTAT-TL command to check whether the NFS port is open;

Third, the configuration Portmap
Method 1: Edit the/etc/default/portmap and remove the-I 127.0.0.1.
Method 2: $ sudo dpkg-reconfigure portmap, to the should portmap being bound address? Select N.
Configure/etc/hosts.deny
(Disable any host (host) for NFS connections to your NFS server) by adding:
### NFS daemons
Portmap:all
Lockd:all
Mountd:all
Rquotad:all
Statd:all
Configure/etc/hosts.allow
Allow the host you want to connect with your Server for NFS. The following steps will allow any IP address to start with 192.168.197 (Connect to an NFS server), or you can specify a specific IP address. Refer to Man page hosts_access (5), Hosts_options (5). Join:
### NFS daemons
portmap:10.176.28.
lockd:10.176.28.
rquotad:10.176.28.
mountd:10.176.28.
statd:10.176.28.
/etc/hosts.deny and/etc/hosts.allow set up access to Portmap. The use of these two configuration files is somewhat similar to the meaning of "mask". All user access to Portmap is now prohibited in/etc/hosts.deny. In/etc/hosts.allow, some users are allowed to access portmap.
Run $ sudo/etc/init.d/portmap restart reboot Portmap daemon.
Configure/etc/exports
NFS mount directories and permissions are defined by the/etc/exports file
For example, I'm going to have the/home/wjd/qte directory in my home directory let 10.176.28.* IP share, then add the following statement at the end of the file:
/home/wjd/work 10.176.28.* (Rw,sync,no_root_squash)

NFS clients within the 10.176.28.* network segment can share the contents of the NFS server/home/wjd/work directory. and read, write permission, and the user into the/home/zp/share directory after the identity of root
It is best to add sync, otherwise $ sudo exportfs-r will give a warning, sync is the default option for NFS.

(Run $ SHOWMOUNT-E to view the Export List for NFS server.)

If you change the/etc/exports, run $ sudo exportfs-r update

Run $ sudo/etc/init.d/nfs-kernel-server Restart Restart NFS service)

Four. Configure IP Address

1. Configure host IP address: Set the PC host IP address to static ip:10.176.28.249 mask:255.255.255.0;gateway:10.176.28.1

2. Configure VMware:

The VMware Network connection is set up to bridge the way, in Vmware->settings->network adapter->bridged, selected. The Device status connection is all selected.

3. Configure Ubuntu

Ubuntu is also set to static IP,IP address and host PC in the same network segment, for: 10.176.28.248

4, configure the Development Board IP address

The Development Board IP address is set to: 10.176.28.247, with the host PC, Ubuntu are in the same network segment

Test and Ping each other to see if the network is connected

V. Testing NFS

1. Ubuntu Native Test

#sudo Mount 10.176.28.248:/home/wjd/work/mnt/nfs

2, Development Board test

#mount-T Nfs-o nolock 10.176.28.248:/home/wjd/work/mnt/nfs

If the error occurs:
  portmap:server localhost not responding, timed out
  WORKAROUND:
  mount-t N Fs-o nolock node1:/public/public
  that adds the-o nolock parameter, because
 UNFSD doesn ' t support NLM, and it ' s locking ing the LOCKD daemon to being started (which again requires the portmapper to be installed etc.)

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.