Results 1 to 4 of 4

Thread: How to mount NFS server with autofs

  1. #1
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    386

    Default How to mount NFS server with autofs

    This is a simple and quick Howto on setting up reasonably secure NFS file server and clients in a home network and dynamically mounting NFS shares with autofs. Basic openSUSE Linux and networking knowledge is assumed.

    Required packages: nfs-kernel-server, nfs-client, yast2-nfs-server, yast2-nfs-client, autofs

    NFS server:
    1. Assign server IP, eg. 192.168.1.2
    2. Create folder to share, eg. /mnt/ServerData, with rwxrwx--- permissions
    3. Create new user group, eg. dataserver, GID 1000
    4. Create new user, eg. datauser, UID 1000 (optional, can be your own user name, but remember your UID)
    5. YAST -> Network Services -> NFS Server
    - NFS Server - Start
    - Firewall - Open Port in Firewall
    - Enable NFSv4
    - Enter NFSv4 Domain Name: localdomain
    6. Next
    7. Directories to Export
    - Add Directory - /mnt/ServerData
    - Add Host
    - Host Wild Card: 192.168.1.3 (must be same as client IP or use wildcard * to allow all hots)
    - Options: fsid=0,crossmnt,rw,root_squash,sync,no_subtree_check
    8. Finish
    9. YAST -> System -> System Services (Runlevel)
    - Check that nfs server and rpcbind are running

    NFS client:
    1. Assign client IP, eg 192.168.1.3 (must be same as set in server)
    2. Create new user group, eg. dataserver, GID 1000 (name and GID must be same as set in server)
    3. Create new user, eg. datauser, UID 1000 (name and UID must be same as set in server, optional, or can be your own user name, simply add your user name to usergroup dataserver)
    4. YAST -> Network Services -> NFS Client -> NFS Settings
    - Enable NFSv4
    - NFSv4 Domain Name: localdomain
    - Open Port in Firewall
    5. OK
    6. YAST -> System -> System Services (Runlevel)
    - Check that autofs, nfs and rpcbind are running
    7. Dolphin -> Places
    - Add Entry
    - Description: NFS Server
    - Location: /mnt/DataServer (do NOT create any folders in /mnt, autofs will do this dynamically)

    Autofs:
    1. Open and edit file /etc/auto.master
    - Add this line: /mnt/DataServer /etc/auto.misc --timeout 10
    2. Open and edit file /etc/auto.misc
    - Add this line: Data -fstype=nfs,rw,soft,intr,nosuid,nodev,tcp,retry=10,rsize=32768,wsize=32768 192.168.1.2:/
    3. Restart autofs in shell: /etc/init.d/autofs restart

    Now, open Dolphin and click on Places -> NFS Server - it should mount the server export folder automatically.

    For more info, check this article: Quick HOWTO : Ch29 : Remote Disk Access with NFS - Linux Home Networking
    openSUSE 13.1 | KDE 4.11 | AMD Phenom II X4 965 | Gigabyte GA-870A-UD3 | MSI N460GTX Cyclone nVidia | Asus Xonar DX
    openSUSE 13.1 | KDE 4.11 | Asus UL30A

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,941
    Blog Entries
    4

    Default Re: How to mount NFS server with autofs

    I found your post linked from your article about the Seagate BlackArmor NAS. Fortunately I have a Thecus which is Linux based and works much better. Thanks for this post, you spurred me to finally get around to grokking autofs.

    I already had NFS setup and could mount manually or at boot, but I didn't like the idea of a down NAS blocking boot, so autofs was what I wanted.

    I tried the autofs setup from Yast2 (you have to install yast2-autofs) but it kept asking for a proper LDAP setup so I gave up and edited /etc/auto.master directly. Basically I did this:

    Code:
    /etc/auto.master:
    [existing lines]
    /nas /etc/auto.nas
    I didn't fill the third field. I let the timeout default to 10 minutes, I think 10 seconds is too short.

    Code:
    /etc/auto.nas:
    Movie           -rw                     nas:/raid/Movie
    nas is the non-FQDN of my NAS box, very imaginative name I know, but I don't think I need more than one NAS box at the moment. Then I did:

    Code:
    ln -s /nas/Movie /home/Movie
    Restart autofs with rcautofs reload, and voila, when I access /home/Movie it gets automounted.

    That's all.

  3. #3
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    14,043
    Blog Entries
    12

    Default Re: How to mount NFS server with autofs

    Cheers ken_yap. This is what I've been working around as well.
    - Athlon X6 3.6 GHz, 16 GB DDR3, 30 GB SSD, 3 TB of disks, GT540, openSUSE 12.2 x86_64 + KDE 4.10 + GNOME 3
    - ASUS A73SD, Intel + GT610M Optimus, 6 GB, 120 GB SSD, openSUSE Tumbleweed

    Anything that can go wrong.... will teach us

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  4. #4

    Default Re: How to mount NFS server with autofs

    searching a solution for an opposite way of handling the autofs and NFS / Samba
    I stumbled over this thread...
    I would like to knwo were I can disable it
    I want to STOP autofs
    It keeps my QNAP NAS alive 24:7

    this was not so with 11.4 Opensuse

    OR? is it another issue I should take a look at

    could you please advise me and point me towards the relevant subtopic
    or should this be a new question ?
    ciao

Posting Permissions

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