Nfs network file system mounting notes sorting 1

Source: Internet
Author: User
Nfs network file system mounting notes sorting 1 retrieval and sorting: 1. server configuration 1. edit the shared directory configuration file/etc/exports in the directory to specify the shared directory and permissions. Run the following command to edit the file/etc/exports: # vi/etc/export... nfs network file system mounting notes sorting 1 retrieval and sorting: 1. server configuration 1. edit the shared directory configuration file/etc/exports in the directory to specify the shared directory and permissions. Run the following command to edit the file/etc/exports: # vi/etc/exports and add the following content to the File:/opt/workplace 192.168.0. * (rw, sync, no_root_squash) save and exit. The added content indicates that the computer with the IP address range of 192.168.0. * is allowed to access the/opt/workplace directory with the read and write permissions. [/Opt/workplace] is the server output shared directory. Rw: read/write permission. the parameter of read-only permission is ro. sync: Data is synchronized to the memory or hard disk. you can also use async. in this case, data is saved to the memory and not written to the hard disk. No_root_squash: specifies the attributes of the NFS server shared Directory user. if the user is root, the root permission is granted to the shared directory .] After the configuration is complete, enter the command # exportfs-rv on the console to enable the configuration. 2. edit the IP address configuration file/etc/hosts. allow is: portmap: * // set that all IP addresses can be accessed, and can be written as the specific IP address lockd: * // etc/hosts. deny configuration prohibit access IP mountd: * rquotad: * statd: * 3. start Port ing: # service portmap start or in fedora # service rpcbind start may also need to start the rpcidmapd service. (both in/etc/init. d/, find start) # service nfs start nfs service. 4. disable firewall: # lokkit or # setup, # service iptables stop and # service ip6tables stop. 5. verify that the NFS server performs a loop test on the linux server to verify that the shared directory is accessible. run the following command: # mount-t nfs 192.168.1. *:/opt/workplace/mnt/nfs # ls/mnt/nfs if NFS works normally, you should be able to see the/opt/workplace contents under the/mnt/nfs directory. 2. configure the NFS client of the embedded target system after the linux server is configured. 1. run the following command to mount the NFS shared directory: # mkdir/mnt/nfs # mount-t nfs-o nolock 192.168.1. *:/opt/workplace/mnt/nfs # cd/mnt/nfs # ls 2. during the development process, it is annoying to input commands back and forth. two simple scripts are used to start and Mount nfs. Host starts nfs: snfs (script name )#! /Bin/bash ifconfig eth0 192.168.0.20/etc/rc. d/init. d/portmap start/etc/rc. d/init. d/nfs start: Mount nfs on the embedded target machine: mnfs :( script name )#! /Bin/sh mount-t nfs 192.168.0.20:/home/work/nfs/mnt/nfs-o nolock echo "nfs OK !" III. how to unmount nfs mounting # umount/mnt/nfs may cause device is busy. Solution: 1. First, find out who is occupying: # fuser/mnt/nfs to get the process number. 2. search for the process: # ps-ef | grep process number. 3. kill the process: # kill-9 process No. 4. then umount. if not, umount-f/mnt/nfs will be forcibly uninstalled. 5. do not restart nfsd, and then execute the above command umount file system. IV. How to View system File Sharing: # showmount-e
Related Article

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.