Facebook Twitter Instagram
    WiredRevolution.com
    • Home
    • About
    • Contact Us
    • Essential Linux Commands
    • Sitemap
    Facebook Twitter Instagram
    WiredRevolution.com
    gentoo

    Setup NFS server on Gentoo

    RyanBy RyanMarch 19, 2009Updated:March 21, 20092 Comments2 Mins Read
    Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Email

    Setting up a NFS server on Gentoo doesn’t have to be difficult. Here I will explain how to setup a basic NFS server in just a few steps.

    The fist step is to become root.

    $ su -
    

    Your Gentoo kernel must be compiled with support for both NFS server and client. You can check for this in a couple ways.

    If you manually built your kernel you can do the following to check for support.

    # cd /usr/src/linux
    # make menuconfig
    

    The following options should be enabled in the kernel.

    File Systems —>
    Network File Systems —>
    <*> NFS file system support
    [*] Provide NFSv3 client support
    <*> NFS server support
    [*] Provide NFSv3 server support

    It should look similar to this.

    make_menuconfig_nfs

    Alternatively you may be able to check your configuration settings in /proc/config.gz.

    # zcat /proc/config.gz | grep NFS
    

    Here are the important lines to look for.

    ...
    #
    # Network File Systems
    #
    CONFIG_NFS_FS=y
    CONFIG_NFS_V3=y
    # CONFIG_NFS_V4 is not set
    # CONFIG_NFS_DIRECTIO is not set
    CONFIG_NFSD=y
    CONFIG_NFSD_V3=y
    # CONFIG_NFSD_V4 is not set
    # CONFIG_NFSD_TCP is not set
    ...
    

    If your configuration lacks these options you will need to rebuild your kernel.

    Once you verified your kernel has NFS support go ahead and emerge the nfs-utils package. This package contains all the user-space programs to setup NFS.

    # emerge nfs-utils
    

    You should now edit /etc/exports which tells NFS which filesystems should be shared.

    # vim /etc/exports
    

    Here is a basic entry example. Here the /mnt/storage directory will be shared to all computers on 192.168.1.* network. The share options will allow for secure read and write access to the NFS volume.

    /mnt/storage 192.168.1.0/24(rw,sync,no_subtree_check)
    

    Now start the NFS service.

    # /etc/init.d/nfs start
    

    Congratulations you should now have a working NFS server, but there are still a couple things to do.

    Add this service to your default run level. This will automatically start the service every time the system boots.

    # rc-update add nfs default
    

    The showmount command can be used to check which NFS volumes are exported.

    # showmount -e [host]
    

    If you make any changes to the /etc/exports file you need to reload the NFS service for these changes to take effect.

    # /etc/init.d/nfs reload
    
    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Email
    Previous ArticleFix blue tinted video in Ubuntu
    Next Article Share a remote filesystem over SSH

    Related Posts

    Canonical releases Ubuntu 12.10 Quantal Quetzal

    Share a remote filesystem over SSH

    View the status of a long emerge

    Most Commented
    March 12, 2009

    Fix blue tinted video in Ubuntu

    September 10, 2010

    Setup SSH access between VirtualBox Host and Guest VMs

    March 8, 2011

    Install GNOME Shell in Ubuntu 10.10 Maverick

    April 4, 2009

    Setup the PS3 Bluetooth Controller on Ubuntu

    October 22, 2008

    How to correctly use LD_LIBRARY_PATH

    Recent Comments
    • Execute command on linux virtual machine (or server) from windows commandline on Setup SSH access between VirtualBox Host and Guest VMs
    • Solved: How to SSH to a VirtualBox guest externally through a host? - Daily Developer Blog on Setup SSH access between VirtualBox Host and Guest VMs
    • How to SSH to a VirtualBox guest externally through a host? [closed] – Code D3 on Setup SSH access between VirtualBox Host and Guest VMs
    • How to copy and paste from VirtualBox? [duplicate] on Setup SSH access between VirtualBox Host and Guest VMs
    • Jackie Laguna on Fix OpenGL: ChoosePixelFormat SketchUp error in WINE
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.