element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
NexGen Flight Simuator Howto: NFS (Network File System)
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: phoenixcomm
  • Date Created: 30 Apr 2015 12:30 AM Date Created
  • Views 1805 views
  • Likes 1 like
  • Comments 15 comments
  • rpc
  • software_design
  • file_sharing
  • protocols
  • nfs
  • feature_tutorial
  • cifs
  • linux
Related
Recommended

Howto: NFS (Network File System)

phoenixcomm
phoenixcomm
30 Apr 2015

Ok what in the world of Microsoft and Windows and Linux is NFS and why do I need it... Really I'm very happy with SMB or CIFS,  or Samba (reversed engineered SMB) so why change to NFS??

  1. SMB is a kludge, its what you see is maybe what you get.
  2. and it really is not Open...
  3. CIFS is single threaded which makes it SLOW!
  4. and NFS just works, and it's dam fast!!

 

History:

NFS is a distributed file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network much like local storage is accessed. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (RPC) system. The Network File System is an open standard defined in RFCs, allowing anyone to implement the protocol.  There have been several versions with version 4 the latest.

 

My Network is comprised of several Linux Boxes on a 1 Gigabit Network (Player, Whirlwind, RSS), I also have a slower 100 Megabit Backbone which has my slower stuff (WiFi, network printers, etc.  I also have an additional 100 Megabit Network for NexGen my Simulator.  All of the Boxes are LinuxMint Ver 17r2. For this HowTo I will only concern ourselves with version 4.

 

How I Did It:

I am currently using Whirlwind as my desktop and file server.  There are a lot of Howto's out there and they all have there part but here is mine so here goes.

 

First I have to get NFS on my server.  You have you choice of using Synaptic or the terminal.. I will use and show you the terminal.

$ sudo apt-get install nfs-kernel-server nfs-common

Then edit your exports file. The follow 4 lines are my "exports", remember they will not be the same.

$ sudo vi /etc/exports

/mnt/MyData/public    192.168.1.1/24(rw,async,no_root_squash,subtree_check)

/mnt/MyMedia/Music  192.168.1.1/24(ro,async,no_root_squash,subtree_check)

/mnt/MyMedia/media  192.168.1.1/24(ro,async,no_root_squash,subtree_check)

/mnt/MyMedia/p2p      192.168.1.1/24(rw,async,no_root_squash,subtree_check)

 

so let explain my magic:

  • /mnt/......  Where my filesystem is mounted
  • 192.168.1.1/24  Who I want to share it with.. in this case I am sharing it with everybody hence the /24
  • ro or rw    Read Only or Read Write
  • async    allows the NFS server to violate the NFS protocol and reply to requests before any changes made by that request have been committed to stable storage (e.g. disc drive).
  • no_root_squash  Very often, it is not desirable that the root user on a client machine is also treated as root when accessing files on the NFS server. To this end, uid 0 is normally mapped to a different id: the so-called anonymous or nobody uid. This mode of operation (called 'root squashing') is the default, and can be turned off with no_root_squash.
  • subtree_check is also used to make sure that files inside directories to which only root has access can only be accessed if the filesystem is exported with no_root_squash even if the file itself allows more general access.

 

Now restart the NFS server

$ sudo service nfs-kernel-server start

 

You can test you service and exports by using this:

$ showmount -e

Export list for Whirlwind:

/mnt/MyData/public 192.168.1.1/24

/mnt/MyMedia/p2p  192.168.1.1/24

/mnt/MyMedia/media 192.168.1.1/24

/mnt/MyMedia/Music 192.168.1.1/24

 

Your Done!!

 

Now the Client.... (RSS)

install just the client.

$ sudo apt-get-install nfs-common  $ sudo apt-get install nfs-common

 

you can use showmount -e whirlwind on the client to show the servers exports but if you use name on your machines you must update your /etc/hosts file.... (good idea)

$ sudo /etc/hosts

192.168.1.23  Whirlwind

 

now try a mount command. I used my /mnt/  I added two directories under /mnt/ public and music. so here is what you need..

$ sudo mount -t nfs whirlwind:/mnt/MyData/public /mnt/public

now look in /mnt/public for your shares.. Got them. Good now one last thing.. Let make them mount when the machine starts.. cool

 

$ sudo vi /etc/fstab

Whirlwind:/mnt/MyData/public  /mnt/public

whirlwind:/mnt/MyMedia/Music /mnt/music

 

I think im done...

Cris H. image

PS 17JUNE2015 I made a small error! in the client machines you must add NFS to the fstab

>>>>>>>> Whirlwind:/mnt/MyData/Public     /mnt/public     NFS

 

PS 21OCT2016 I made a small error! in the line: $ sudo apt-get-install nfs-common

>>>>>>>   $ sudo apt-get install nfs-common

 

BTW if you want to mount your files on a local window 7 box, its not that hard Mount your NFS share on Windows 7

  • Sign in to reply

Top Comments

  • phoenixcomm
    phoenixcomm over 8 years ago in reply to shabaz +3
    Guys, shabaz Jan Cumps since you are both talking about the dark days... In 1977/8 or so I worked for Interdata in Oceanport. I helped deliver our 8/32 serial 1 to Bell Labs in Homedel. this was the first…
  • Former Member
    Former Member over 8 years ago in reply to Former Member +2
    In answer to my first question, the clients do not automatically reconnect. They seem to hang a bit. I had to re-mount my nfs shares once the NFS server was available after going out of service. This is…
  • phoenixcomm
    phoenixcomm over 8 years ago in reply to Former Member +2
    texadactyl Richard nope I use mostly LinuxMint and Solaris on my Sun UltraSparc. I have one box that runs windows for Ventura Publisher (It has things in it like Page Setup, Frames {this is where you type…
  • Former Member
    Former Member over 8 years ago in reply to phoenixcomm

    phoenixcomm What goes where is configurable E.g. which folder to peg/store configuration, logs, other stuff.  From the "www" reference, I'll assume that you are talking about the Apache or Tomcat web/app server(s).  Easy to avoid cluttering up /var.  Secondly, with a symbolic link for any folder, you can point anywhere else (E.g. /opt or a USB drive). Also, /var itself can be mounted anywhere (E.g. under /opt or on a USB drive).  Commercial Apache admins always make these kinds of changes to match the available physical storage.

     

    By the way, are you aging your Apache logs?  See https://www.loggly.com/ultimate-guide/apache-logging-basics/

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 8 years ago in reply to shabaz

    Guys, shabaz Jan Cumps since you are both talking about the dark days... In 1977/8 or so I worked for Interdata in Oceanport. I helped deliver our 8/32 serial 1 to Bell Labs in Homedel. this was the first non-DEC port of UNIX. I have had my hand in it ever since. I will never understand the LINUX distros. why in the hell do they put things in /var that should never be, like parts of the your web server pagers.. /var should be only for your logs! The best DOS attack is to just ask a web server for just one small bit of info. This transaction is recorded  in /var/logs/www/<name>{error.log & transfer.log} when this gets full, that is to say, that volume, your system has no more space and just dies.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 8 years ago in reply to phoenixcomm

    Aw, Solaris.  My first real unix experience was on Oracle Applications running on Solaris.

    that's where I learned writing shell scripts. A skill that has very much faded away by now...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 8 years ago in reply to phoenixcomm

    Hehe I do the same trick with /export/home since Solaris days too : )

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 8 years ago in reply to phoenixcomm

    I was mostly reacting to the 4 points in your original post which did not specify which computer OS was slow or single-threaded.  I don't have any Windows products in my home so I wouldn't be able to judge.

     

    Wow, you have a lot of equipment in your home.  I'll never feel bad about buying more techie toys again!  (=:

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube