Linux common service configuration-nfs service configuration

Source: Internet
Author: User


Install nfs: # sudo apt-get install nfs-kernel-server Ubuntu 10.10 is already in the latest version. You do not need to install and open the/etc/exports file. Add the following at the end: /home/xgc * (rw, sync, no_root_squash) Note: nfs allows the mounted directory and permissions, which are defined in the file/etc/exports. The meanings of each field are as follows: /home/xgc: directory to be shared *: Allow all network segments to access rw: read/write permission sync: Data Synchronization write internal and hard disk no_root_squash: nfs client shared directory user permission Restart service: # sudo/etc/init. d/portmap restart <--- restart portmap. It is very important # sudo/etc/init. d/nfs-kernel-server restart <--- restart nfs service # showmount-e <--- display Show shared directory Note: nfs is an RPC program. before using it, you need to map the port and set the command execution through portmap as follows: xgc @ xgc-VirtualBox :~ $ Sudo/etc/init. d/portmap restart Rather than invoking init scripts through/etc/init. d, use the service (8) utility, e.g. service portmap restart Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the restart (8) utility, e.g. restart portmap start/running, process 474 xgc @ xgc-VirtualBox :~ $ Sudo/etc/init. d/nfs-kernel-server restart * Stopping NFS kernel daemon [OK] * Unexporting directories for NFS kernel daemon... [OK] * Exporting directories for NFS kernel daemon... exportfs:/etc/exports [1]: Neither 'subtree _ check' or 'no _ subtree_check 'specified for export "*:/home/xgc ". assuming default behaviour ('no _ subtree_check '). NOTE: this default has changed since nfs-utils version 1.0.x [OK] * Starting NFS kernel daemon [OK] xgc @ xgc-VirtualBox :~ $ Showmount-e Export list for xgc-VirtualBox:/home/xgc * now you can try: # sudo mount-t nfs localhost:/home/xgc/mnt note: localhost is the linux IP address of the local machine. In this way, the shared directory is mounted to the/mnt directory. To unmount the shared directory, use: # sudo umount/mnt. If it is mounted on an embedded device, add the parameter-o nolock to lexue.

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.