Page 1 of 53 1231151 ... LastLast
Results 1 to 10 of 521

Thread: HOWTO: NFS Server/Client

  1. #1
    Join Date
    Apr 2006
    Beans
    4

    HOWTO: NFS Server/Client

    Why NFS?

    I simply wanted to experiment with NFS, and couldn't seem to find the documentation here on the forums. I found using NFS just as easy if not easier than using Samba for sharing between a few of my Unix based systems. In order to share a folder it only required a single line in a configuration file under /etc/exports, and a single line under /etc/fstab on the client to mount the share on each client at boot.

    I mostly edited and moved things around from these guides to make a more complete single guide to getting this working using Ubuntu.

    http://www.cyberciti.biz/tips/ubuntu...nfs-share.html (for client configuration)
    http://www.redhat.com/docs/manuals/l...nfs-mount.html (for mounting using fstab)
    <removed dead link>
    http://www.freebsd.org/doc/en_US.ISO...twork-nfs.html (contains more info about NFS)

    Install NFS Server Support
    at the terminal type
    sudo apt-get install nfs-kernel-server nfs-common portmap
    When configuring portmap do =not= bind loopback. If you do you can either edit /etc/default/portmap by hand or run:
    sudo dpkg-reconfigure portmap
    sudo /etc/init.d/portmap restart


    Editing /etc/exports
    the /etc/exports file is used for creating a share on the NFS server

    invoke your favorite text editor or
    sudo vi /etc/exports

    Here are some quick examples of what you could add to your /etc/exports

    For Full Read Write Permissions allowing any computer from 192.168.1.1 through 192.168.1.255

    • /files 192.168.1.0/24(rw,no_root_squash,async)


    Or for Read Only from a single machine

    • /files 192.168.1.2 (ro,async)

    save this file and then in a terminal type
    sudo /etc/init.d/nfs-kernel-server restart

    Also aftter making changes to /etc/exports in a terminal you must type
    sudo exportfs -a

    Install NFS client support
    sudo apt-get install portmap nfs-common

    Mounting manually
    Example to mount server.mydomain.com:/files to /files. In this example server.mydomain.com is the name of the server containing the nfs share, and files is the name of the share on the nfs server

    The mount point /files must first exist on the client machine.
    cd /
    sudo mkdir files


    to mount the share from a terminal type

    sudo mount server.mydomain.com:/files /files

    Note you may need to restart above services:
    sudo /etc/init.d/portmap restart
    sudo /etc/init.d/nfs-common restart


    Mounting at boot using /etc/fstab
    Invoke the text editor using your favorite editor, or
    gksudo gedit /etc/fstab

    In this example my /etc/fstab was like this:
    • server.mydomain.com:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr

    You could copy and paste my line, and change “servername.mydomain.com:/files”, and “/files” to match your server name:share name, and the name of the mount point you created.
    It is a good idea to test this before a reboot in case a mistake was made.
    type
    mount /files
    in a terminal, and the mount point /files will be mounted from the server.
    Last edited by dmizer; August 6th, 2009 at 12:10 AM. Reason: removed dead link

  2. #2
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: HOWTO: NFS Server/Client

    Thanks, this howto made simple what the wiki howto makes look difficult. I can now dispense with the vagaries of samba
    No longer participating......

  3. #3
    Join Date
    Apr 2006
    Location
    Toronto
    Beans
    19
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: NFS Server/Client

    Thanks for the howto. The only problem I ran into was with this line:

    Quote Originally Posted by malco2001 View Post
    save this file and then in a terminal type
    /etc/init.d/nfs-kernel-server restart
    it gave me a bunch of errors until I sudo'd it.

    sudo /etc/init.d/nfs-kernel-server restart

  4. #4
    Join Date
    Aug 2006
    Beans
    7

    Re: HOWTO: NFS Server/Client

    Thank you for writing this!!! I have been sifting through posts for two days trying to figure out how to share files between my two ubuntu(dapper) pc's. Your instructions worked the first time I tried them.

  5. #5
    Join Date
    Apr 2006
    Beans
    4

    Re: HOWTO: NFS Server/Client

    Originally Posted by malco2001
    save this file and then in a terminal type
    /etc/init.d/nfs-kernel-server restart
    Posted by InspirationDate
    it gave me a bunch of errors until I sudo'd it.
    i edited my post to fix that. i'm glad it worked so well for all of you.
    Last edited by malco2001; September 11th, 2006 at 05:28 AM.

  6. #6
    Join Date
    Jun 2006
    Location
    Austin, TX
    Beans
    57
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: NFS Server/Client

    Had some serious speed problem with Samba. Setting up NFS from your guide works well! Now I'm doing 30-40Mb (gigabit network) per sec instead of 1-3Mb with Samba. Thanks!
    i7-3930K, 64GB RAM, 4x2TB HD RAID-10

  7. #7
    Join Date
    Sep 2006
    Beans
    2

    Re: HOWTO: NFS Server/Client

    thanks for this guide really cool

    however I have a bunch of Disks mountet on the server i home dir
    and I wanted to just mount the home dir in the client.
    I did'nt work. I could not see the subdirs for some reason.

    thoug if in export I make explicit what dirs to export where the dirs are disks, then it worked fine after restarting the service and making new mount points of course.

    though if someone can explain how to just mount the home of the server that would be great. I did everything as the guide instructed.

  8. #8
    Join Date
    Sep 2006
    Location
    Fort Lauderdale, FL
    Beans
    47
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: NFS Server/Client

    If you're connection to a Linux NFS server from Mac OS X, you need to specify 'insecure' in your exports and map the user IDs since Macs use uid 501 for the first regular user. For my /etc/exports I use:

    /home 192.168.0.0/255.255.255.0(rw,async,insecure,all_squash,anonuid =1000,anongid=1000)

  9. #9
    Join Date
    Aug 2006
    Beans
    27

    Smile Re: HOWTO: NFS Server/Client

    Thankyou malco2001,

    Very precise and to the point, gained access to my freenas box in mere moments once i read this post, now to make sunbird share it's calendar file for both my ubuntu and windows boxes.

    Many thanks

    Pebbles

  10. #10
    Join Date
    Mar 2006
    Location
    Tucson, AZ, USA
    Beans
    5
    Distro
    Dapper Drake Testing/

    Re: HOWTO: NFS Server/Client

    thanks, I found this helpful, and quite easy to config with the built in nfs module in webmin. I also experienced a speed increase of about double over samba.

Page 1 of 53 1231151 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •