Difference between revisions of "Network File System configuration"

From ArmadeusWiki
Jump to: navigation, search
(cleanup)
Line 52: Line 52:
  
 
===Mount the NFS partition manually ===
 
===Mount the NFS partition manually ===
 
+
* check if mount point is existing (for example we will take ''/mnt/nfs''):
* create a mount point (for example):
+
<pre class="apf">
 +
# ls /mnt
 +
</pre>
 +
* if not existing, create the mount point:
 
<pre class="apf">
 
<pre class="apf">
  # mkdir -p /mnt/host
+
  # mkdir -p /mnt/nfs
 
</pre>
 
</pre>
 
* mount it (for example):
 
* mount it (for example):
 
<pre class="apf">
 
<pre class="apf">
  # mount -t nfs 192.168.0.2:/local/export /mnt/host
+
  # mount -t nfs 192.168.0.2:/local/export /mnt/nfs
 
</pre>
 
</pre>
If 192.168.0.2 is your Host IP address and ''/local/export'' the name of your Host directory you want to mount.
+
Here 192.168.0.2 is your Host IP address and ''/local/export'' the name of your Host directory you want to mount.
  
 
===Mount the NFS partition automatically at each boot from FLASH===
 
===Mount the NFS partition automatically at each boot from FLASH===
  
* be sure to have the latest available software (>=armadeus2.0 or latest GIT)
 
 
* login to your Armadeus board as root
 
* login to your Armadeus board as root
 
* open the '''/etc/fstab''' file and add this line:
 
* open the '''/etc/fstab''' file and add this line:
 
  <host-ip>:/<path-to-shared-folder> /mnt/<path-to-mount-folder> nfs hard,intr,rsize=8192,wsize=8192 0 0
 
  <host-ip>:/<path-to-shared-folder> /mnt/<path-to-mount-folder> nfs hard,intr,rsize=8192,wsize=8192 0 0
 
example:
 
example:
  192.168.0.2:/local/export /mnt/host nfs hard,intr,rsize=8192,wsize=8192 0 0
+
  192.168.0.2:/local/export /mnt/nfs nfs hard,intr,rsize=8192,wsize=8192 0 0
 
* check your modification:
 
* check your modification:
 
<pre class="apf">
 
<pre class="apf">
  # mount /mnt/host
+
  # mount /mnt/nfs
 
</pre>
 
</pre>
 
* reboot your board
 
* reboot your board
Line 82: Line 84:
 
<pre class="apf">
 
<pre class="apf">
 
  # df
 
  # df
  # ls /mnt/host
+
  # ls /mnt/nfs
 
</pre>
 
</pre>
 
When you have a problem, verify that the NFS server is running on the host:
 
When you have a problem, verify that the NFS server is running on the host:
Line 118: Line 120:
  
 
===Summary of the required Packages:===
 
===Summary of the required Packages:===
* portmap (buildroot)
+
* portmap (Buildroot)
 
* nfs (busybox)
 
* nfs (busybox)
 
* nfs support (Linux, activated by default in Armadeus configuration)
 
* nfs support (Linux, activated by default in Armadeus configuration)

Revision as of 15:10, 2 November 2011

Introduction

On this page, you will find usefull informations to configure NFS (Network File System) on your Host and your Target.

NFS server on your development Host

Installation

  • On Fedora, NFS is part of your distribution so you normally don't need to install it.
  • On Ubuntu/Kubuntu:
$ sudo apt-get install nfs-kernel-server
  • On OpenSUSE:
$ sudo zypper install yast2-nfs-server

Configuration

/etc/exports

  • You have to declare the directory where you're going to store the files you want to share accross the network. For that you have to modify the /etc/exports file with (for example):
# Directory for Armadeus:
/local/export     192.168.0.0/255.255.255.0(ro,no_root_squash,sync)
In that case your Host will authorize all client from the subnet 192.168.*.* to access /local/export in read only mode. If you want read/write access from your APF to your exported dir, then replace ro with rw.
  • If not existing, create your export directory (for example):
$ sudo mkdir -p /local/export
$ sudo chown -R $USER:$GROUP /local/export/

Restart of NFS server

  • On Fedora:
 # /sbin/service nfs restart

Next time you boot, you can check your NFS server status with:

 # /sbin/service nfs status

and if not started then:

 # /sbin/service nfs start
  • On Ubuntu/Kubuntu:
 $ sudo /etc/init.d/nfs-kernel-server restart

Next time you boot, you can check your NFS server status with: System Settings->System services

  • On OpenSUSE
# /etc/init.d/nfsserver restart

NFS usage on your Armadeus board

Mount the NFS partition manually

  • check if mount point is existing (for example we will take /mnt/nfs):
# ls /mnt
  • if not existing, create the mount point:
 # mkdir -p /mnt/nfs
  • mount it (for example):
 # mount -t nfs 192.168.0.2:/local/export /mnt/nfs

Here 192.168.0.2 is your Host IP address and /local/export the name of your Host directory you want to mount.

Mount the NFS partition automatically at each boot from FLASH

  • login to your Armadeus board as root
  • open the /etc/fstab file and add this line:
<host-ip>:/<path-to-shared-folder> /mnt/<path-to-mount-folder> nfs hard,intr,rsize=8192,wsize=8192 0 0

example:

192.168.0.2:/local/export /mnt/nfs nfs hard,intr,rsize=8192,wsize=8192 0 0
  • check your modification:
 # mount /mnt/nfs
  • reboot your board
 # reboot
  • and enjoy the result
 # df
 # ls /mnt/nfs

When you have a problem, verify that the NFS server is running on the host:

 $ /etc/init.d/nfs-kernel-server status

or

 $ /sbin/service nfs status

Boot from NFS

  • on your Host, expand generated rootfs image to your NFS export dir (for example if your NFS export dir is /local/export/ on your Host):
 $ make shell_env
 $ source armadeus_env.sh
 $ sudo tar xvf $ARMADEUS_ROOTFS_TAR -C /local/export
  • on your target, in U-Boot, check if the rootpath envt variable is set accordingly:
 BIOS> printenv rootpath
  • if not then set it (here for example /local/export):
 BIOS> setenv rootpath /local/export
  • save it:
 BIOS> saveenv
  • then boot with:
 BIOS> run nfsboot

Summary of the required Packages:

  • portmap (Buildroot)
  • nfs (busybox)
  • nfs support (Linux, activated by default in Armadeus configuration)

Troubleshooting:

  • 1] If nfsd and mountd daemon are not running on your Host, then you will get a message like:
# mount: RPC: Program not registered

In that case, restart the NFS service on your Host (see above)

  • 2] To successfully mount a NFS drive, portmap daemon should be running on your target, if not system will hang during some minutes when you launch the mount !!

To check if portmap is running, look at the running processes:

# ps faux

If portmap is not listed, then launch it manually:

# /etc/init.d/S13portmap

NFS Server under Windows

For those who want to use the NFS service on Windows, a small and FREE NFS server is available here.

Links