Installation and configuration of LinuxNFS

Source: Internet
Author: User
Installation and configuration of LinuxNFS-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Recently, for embedded development on the PXA270 board in Linux, you need to use some Linux service configurations, such as NFS and TFTP. If you are not familiar with them, you may encounter a lot of trouble. So write a little article, it is hoped that netizens who have experienced the same experience will not make some detours.

My Linux system is MagicLinux, a Linux system developed by Chinese people. It supports Chinese characters and uses bsh. Basically, it is similar to the Linux System of the RedHat series.

The following describes how to install and configure NFS:

1. Enter setup in the console as root, and select
  • Nfs
  • The portmap service option portmap service is required for NFS because it is a dynamic port distribution daemon of NFS. If portmap is not started, NFS cannot be started. If this configuration option is not available for Linux system services, you can search for related software packages online.

    2. Edit the/etc/exports file.

    The exports file is the NFS shared directory configuration file, which specifies the shared directory and sharing policy. Use the vi command to edit the file and add the following content:

    /* (Rw, sync) # there must be a space between '/' and '*'
    /Home 10.13.9.19 (rw, sync) * (ro, sync)

    The first rule/indicates that the entire root directory is shared. * indicates that all users are shared, rw can be read and written, and sync files are synchronized.

    The first rule/home indicates the shared directory. Of course, you can add other directories for sharing. The following content indicates that the read and write permissions are granted to hosts with ip address 10.13.9.19. Other hosts only have read and write permissions.

    There are other settings, such:

    /Bluefish (rw, no_root_squash) # Share with users whose host name is bluefish
    /Share 172.29.0.0/255.255.0.0 (ro)
    /Share/private (noaccess)

    Option description:

    Ro read only
    Rw read write
    No_root_squash: trust the client, corresponding to UID
    Noaccess client is not available

    3. Then, run the following two commands on the console:

    [Root] # service portmap restart
    [Root] # service nfs restart

    If you see a series of [OK], it indicates that the startup is successful. If nfs is started for the first time and the restart command is used again, some [FAILED] may appear at the beginning. That is, the nfs service is stopped, and the nfs service is FAILED before it is started.

    Of course, you can also use other commands to start or disable the nfs service:

    Start NFS service
    Stop NFS service
    Restart stop and restart NFS service
    Reload the NFS Setting Value

    4. Test the NFS service

    To test whether NFS is configured successfully, perform the following tests:

    [Root] # mout-t nfs 10.13.9.19:/{cwd}/mnt # {cwd} is the NFS shared directory, and/mnt is a service mounted to a local device.

    If you can see the content of the NFS shared directory under/mnt, it means that your NFS settings are successful. Use # umount/mnt to cancel mounting.

    5. You can also run some commands to view NFS statuses:

    Showmount-e to see which directories are shared
    # Showmount-a: All the mount entries are displayed.

    Check the NFS running level:

    # Chkconfig -- list portmap
    # Chkconfig -- list nfs

    Set automatic NFS startup at the appropriate running level as needed:

    # Chkconfig -- level 235 portmap on
    # Chkconfig -- level 235 nfs on
  • 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.