Ubuntu 14.04 under NFS installation configuration

Source: Internet
Author: User

1, execution command: sudo apt-get install nfs-kernel-server;

2, execute the command: Mkdir/home/jack/nfs-share create a dedicated folder for NFS services;

3, after the establishment of a good folder, then execute the command: sudo vi/etc/exports configuration NFS;

4. Add:/home/jack/nfs-share * (Rw,sync,no_root_squash,no_subtree_check) in the last line of the article
/home/jack/nfs-share * (Rw,sync,no_root_squash,no_subtree_check) The meaning of this line is:
/home/jack/nfs-share: Directory shared with the NFS service client, this path must match the path of the file you set up earlier!
*: Allow all network segments to be accessed or use specific IP
RW: Clients hooking up this directory have read and write access to the shared directory
Sync: Data is written to memory and hard disk synchronously
No_root_squash:root users have full administrative access to the root directory.
No_subtree_check: The permissions of the parent directory are not checked.

5. After modifying the above configuration file, save exit.

6, execute command: Sudo/etc/init.d/rpcbind restart restart Rpcbind service. NFS is an RPC program that needs to map a good port before using it and set it through Rpcbind.

7, execute the command: Sudo/etc/init.d/nfs-kernel-server Restart restart the NFS service.

8. Mount Instructions:
sudo mount-t NFS 192.168.111.128:/home/jack/nfs-share/home/jack/nfs-jack-node001
To execute a mount instruction to any server, you can mount the shared path on the specified IP server to local.

Note: NFS is only a file directory sharing mode and is accessed locally. HDFs is a distributed file system that can load balance the data in the server.

9. Automatically mount the boot:
Write the above instruction Sudo mount-t NFS 192.168.111.128:/home/jack/nfs-share/nfs-jack-node001/to the/etc/rc.local file

Appendix: The Common Parameters for NFS are as follows:
RO read-only access
RW read-Write access sync all data is written to share on request
Async NFS can respond to requests before writing data
Secure NFS is sent over a secured TCP/IP port below 1024
Insecure NFS is sent over 1024 ports
Wdelay If multiple users are writing to the NFS directory, the group is written to (default)
No_wdelay if more than one user wants to write to the NFS directory, it is written immediately and does not require this setting when using Async.
Hide does not share its subdirectories in the NFS shared directory
No_hide subdirectories for shared NFS directories
Subtree_check if you share a subdirectory such as/usr/bin, Force NFS to check the permissions of the parent directory (default)
No_subtree_check and above, do not check parent directory permissions
All_squash shared file UID and GID mapping anonymous user anonymous, suitable for common directories.
No_all_squash preserve the UID and GID of shared files (default)
Root_squash all requests from the root user are mapped to the same permissions as the anonymous user (default)
No_root_squas Root user has full administrative access to the root directory
Anonuid=xxx specifying the UID of an anonymous user in an NFS server/etc/passwd file
Anongid=xxx specify GID for anonymous users in NFS server/etc/passwd files

2. What is the basic usage of mount?
Format: Mount [-parameter] [device name] [Mount Point]
Among the parameters commonly used are:
-A installs all file systems that are class-out in the/etc/fstab file.
-F disguises mount, making checks on the device and the directory look, but does not really mount the file system.
-N does not record the installation in the/etc/mtab file.
-R tells the file system to be installed as read-only.
-V Displays the installation information in detail.
-W installs the file system as writable, which is the default for the command.


-T < file system type > Specifies the file system type of the device, which is common:
EXT2 Linux currently used file system
Msdos MS-DOS FAT, is FAT16
VFAT Windows98 commonly used FAT32
NFS Network File System
ISO9660 CD-ROM standard file system
File system for NTFS Windows NT/2000/XP
Auto automatically detects the file system


-O < options > Specifies options for mounting the file system, some of which can also be written to/etc/fstab. Commonly used are:
Defaults Use default values for all options (auto, Nouser, RW, suid)
Auto/noauto Allow/disallow installation with the –A option
Dev/nodev/Do not interpret special devices on file systems
Exec/noexec Allow/Disallow binary code execution
Suid/nosuid Confirm/Not confirm suid and Sgid bit
User/nouser Allow/Disallow normal users to mount
CODEPAGE=XXX code page
Iocharset=xxx Character Set
RO mount in read-only mode
RW mount in read-write mode
Remount Reinstall a file system that has already been installed
Loop Mount Cyclotron Device
Username/password used to set the user name and password with access rights

Ubuntu 14.04 under NFS installation configuration

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.