Forums

Accessing the embedded board via NFS

Started by piyushpandey February 6, 2011
Hello to all guys


Actually I have an embedded development board installed with the linux and
I want to mount the filesystem in my Desktop also running the linux Ubuntu
10.04 lucid , which is in the path /opt/my_folder on the embedded board via
NFS.

For this how should I proceed .

Please give me hint or any document where communication through the
embedded board is described in detail.

Piyush Pandey

	   
					
---------------------------------------		
Posted through http://www.EmbeddedRelated.com
piyushpandey wrote:

> Actually I have an embedded development board installed with the linux and > I want to mount the filesystem in my Desktop also running the linux Ubuntu > 10.04 lucid , which is in the path /opt/my_folder on the embedded board via > NFS. > > For this how should I proceed . > > Please give me hint or any document where communication through the > embedded board is described in detail.
First you have to compile your Linux kernel with NFS server enabled. The rest is standard Linux, e.g. see this page: http://tldp.org/HOWTO/NFS-HOWTO/server.html But usually it is easier for developing that you export a NFS directory from your desktop system and the embedded systems mounts this directory at e.g. /opt/my_folder. Starting a NFS server on Ubuntu is much simpler. I don't have Ubuntu, but something like this should do it: http://www.quietearth.us/articles/2006/09/28/Ubuntu-How-to-setup-an-nfs-server Chances are good, that your embedded plattform doesn't have "apt-get", so you have to compile and deploy the required programs yourself, if you don't use something like Bitbake and Angstroem where you can configure the programs for your system, if it is not already on your system. But chances are good, that you have already a NFS enabled client, portmapper service and NFS capable "mount" command on your embedded system :-) -- Frank Buss, http://www.frank-buss.de piano and more: http://www.youtube.com/user/frankbuss
Hello Frank


Actually I have installed the NFS server and the NFS client on my Linux
desktop and also it is installed on the embedded board which I am using
actually my embedded board is comes with pre-installed linux having all the
features like NFS, FTP etc.

So what I really did in the meantime I tried in this way:

For this I have used the following command :

mount –t nfs –o nolock 192.168.1.230:/opt/my_folder /mnt

and I am running this command where the 192.168.1.230 is the embedded
boards ip address.

but I am getting the error as follows:

mount: RPC : unable to recieve ; errno = connection refused

So I want to know what is this error for .............I browsed the
internet and I am getting that the firewall may be abrupting the connection
......but in linux the firewall is off by default.

Should I use the ip address of my embedded board or should I use the ip
address of my internet .

thank you 

Piyush Pandey	   
					
---------------------------------------		
Posted through http://www.EmbeddedRelated.com
piyushpandey wrote:
> Hello Frank > > > Actually I have installed the NFS server and the NFS client on my Linux > desktop and also it is installed on the embedded board which I am using > actually my embedded board is comes with pre-installed linux having all the > features like NFS, FTP etc. > > So what I really did in the meantime I tried in this way: > > For this I have used the following command : > > mount –t nfs –o nolock 192.168.1.230:/opt/my_folder /mnt > > and I am running this command where the 192.168.1.230 is the embedded > boards ip address.
The command line looks ok, but you should be using the server address, not the client if you are mounting from the client. On a solaris server, nfs exports are qualified by access mode (r, rw) and a list of permitted clients. Would assume linux is similar. On solaris, the file /etc/dfs/dfstab contains the list of permitted clients. You also need to get the user id from the client correct for the mount request as well and also perhaps connection mode. Nfs is pretty bulletproof otherwise... Regards, Chris
piyushpandey wrote:

> Should I use the ip address of my embedded board or should I use the ip > address of my internet .
From the client use the IP address of your desktop PC. Make sure that you have added the IP of your client in the /etc/exports file of your desktop PC. Take a look at /var/log/messages for errors. If you have two Linux systems, try to mount it from one to the other system, to make sure NFS works on your desktop PC. You can do this locally, too, but this might not reveal /etc/exports- and network-problems. If it still doesn't work, read the NFS-HOWTO, and the troubleshooting section: http://nfs.sourceforge.net/nfs-howto/ -- Frank Buss, http://www.frank-buss.de piano and more: http://www.youtube.com/user/frankbuss
piyushpandey wrote:

> Hello Frank > > > Actually I have installed the NFS server and the NFS client on my Linux > desktop and also it is installed on the embedded board which I am using > actually my embedded board is comes with pre-installed linux having all > the features like NFS, FTP etc. > > So what I really did in the meantime I tried in this way: > > For this I have used the following command : > > mount –t nfs –o nolock 192.168.1.230:/opt/my_folder /mnt > > and I am running this command where the 192.168.1.230 is the embedded > boards ip address. > > but I am getting the error as follows: > > mount: RPC : unable to recieve ; errno = connection refused > > So I want to know what is this error for .............I browsed the > internet and I am getting that the firewall may be abrupting the > connection .....but in linux the firewall is off by default. > > Should I use the ip address of my embedded board or should I use the ip > address of my internet .
I'm not sure about that particular error, but there's some configuration needed by NFS server on Linux. See <http://www.faqs.org/docs/securing/chap5sec33.html>: You need to add lines describing the directories that the server will share in the file /etc/exports . `man /etc/exports` will give the details. Then run the command /usr/sbin/exportfs -a to make sure the NFS daemon recognizes those directories. Mel.
Hello Frank 

>From the client use the IP address of your desktop PC. Make sure that you >have added the IP of your client in the /etc/exports file of your desktop >PC. Take a look at /var/log/messages for errors. If you have two Linux >systems, try to mount it from one to the other system, to make sure NFS >works on your desktop PC. You can do this locally, too, but this might
not
>reveal /etc/exports- and network-problems. >
as you said that I should use the ip address of my Desktop.So I want to know that I don't have router and my computer is connected to the cable modem , so what I do is that I remove the normal ethernet cable from the modem and connect the crossover ethernet cable provided by my vendor to the computer and my embedded board . Now since I have disconnected my computer from the modem therefore I change it's ip address from the ip address through which I access the internet and to the ip address of my embedded board which is 192.168.1.230 . and after changing the ethernet configuration I just run the ifconfig eth0 to check that everything has changed suitably. and the result is ok and pinging it like this gives me result: ping 192.168.1.230 it displays the data send and recieved from the embedded board on the terminal and also I am able to connect to my board through the FTP and telnet . So am I right up to this stage. Ok now I want to ask you that should I use this ip 192.168.1.230 or the ip of my internet .......I think it's obvious that I should use the ip address of the board to which I have converted the ip address of my computer. So I think I have cleared pretty much of my job, so please give me detailed hint on it . Thank you --------------------------------------- Posted through http://www.EmbeddedRelated.com
piyushpandey wrote:

> Hello Frank > >>From the client use the IP address of your desktop PC. Make sure that you >>have added the IP of your client in the /etc/exports file of your desktop >>PC. Take a look at /var/log/messages for errors. If you have two Linux >>systems, try to mount it from one to the other system, to make sure NFS >>works on your desktop PC. You can do this locally, too, but this might > not >>reveal /etc/exports- and network-problems. >> > > > as you said that I should use the ip address of my Desktop.So I want to > know that I don't have router and my computer is connected to the cable > modem , so what I do is that I remove the normal ethernet cable from the > modem and connect the crossover ethernet cable provided by my vendor to the > computer and my embedded board . > > Now since I have disconnected my computer from the modem therefore I change > it's ip address from the ip address through which I access the internet and > to the ip address of my embedded board which is 192.168.1.230 . > > and after changing the ethernet configuration I just run the ifconfig eth0 > to check that everything has changed suitably. > > and the result is ok and pinging it like this gives me result: > > ping 192.168.1.230 > > it displays the data send and recieved from the embedded board on the > terminal and also I am able to connect to my board through the FTP and > telnet . > > > So am I right up to this stage. > > > Ok now I want to ask you that should I use this ip 192.168.1.230 or the ip > of my internet .......I think it's obvious that I should use the ip address > of the board to which I have converted the ip address of my computer. > > > So I think I have cleared pretty much of my job, so please give me detailed > hint on it .
Maybe start reading some more about network basics. A router would make it simpler. I don't know which interesting problems you might get if you are using a crossover cable. But if you type "ifconfig" on your desktop Linux and it shows some address like 192.168.1.* , then it should work. Your initial idea was to mount a directory on your embedded system, which is exported from your desktop PC. So of course you have to use the IP of your desktop PC. Login to your embedded system with telnet, then use something like mount -t nfs x:/opt/my_folder where "x" is the IP of your desktop PC, e.g. 192.168.1.42, not of your embedded system and not your internet IP (which is not a local address, so it don't start with 192.168). Make sure that /opt/my_folder and the IP of your embedded system is in the /etc/exports file of your desktop PC. You can read more about the format of the exports file in the NFS HOWTO. -- Frank Buss, http://www.frank-buss.de piano and more: http://www.youtube.com/user/frankbuss
Frank Buss <fb@frank-buss.de> wrote:
>piyushpandey wrote: >> as you said that I should use the ip address of my Desktop.So I want to >> know that I don't have router and my computer is connected to the cable >> modem , so what I do is that I remove the normal ethernet cable from the >> modem and connect the crossover ethernet cable provided by my vendor to the >> computer and my embedded board . >> >> Now since I have disconnected my computer from the modem therefore I change >> it's ip address from the ip address through which I access the internet and >> to the ip address of my embedded board which is 192.168.1.230 .
I read that as "Both the computer and the board have the same address" that will not work.
>> Ok now I want to ask you that should I use this ip 192.168.1.230 or the ip >> of my internet .......I think it's obvious that I should use the ip address >> of the board to which I have converted the ip address of my computer.
Not so obvious. I don't understand what is "the ip of my internenet". If that is the IP address exposed by your cable to the outside world, it is irrelevant in this context. You should not use it in your network. You need two different addresses in your net, one for each node. They can be almost anything, but if you are using DHCP normally they will be 192.168.1.xxx or 192.168.0.xxx with a netmask = 255.255.255.0 It is very likely that your modem was also acting as a DHCP server. If you disconnect your computer from it, you will have to assign static IP addresses to both systems. Now back to NFS - Imagine a more common situation, where your embedded board is connected to a network with many other computers, and more than one NFS server. As Frank writes further down, the mount command in the client specifies what directory to mount from WHICH server. That tells the NFS client which NFS server should get the request and which server(s) should not. Therefore, you need to specify there the address of the server, not the address of the client. The server will know who (what IP address) is making the request from the addresses in the headers of the request packets.
> Maybe start reading some more about network basics.
Couldn't agree more.
> A router would make it simpler.
I strongly believe that in small networks, (let's say, up to 30 nodes) using static IP addresses wil always save time compared to DHCP, specially in development environments. (Hey, my new system just rebooted but the lcd display is blank, and I cannot telnet to it for debugging because I don't know the address. I'm facing this everyday at work) I know I am in a minority here ...
>I don't know which interesting problems you might get if you are >using a crossover cable. But if you type "ifconfig" on your desktop Linux >and it shows some address like 192.168.1.* , then it should work.
Only for a while... The address 192.168.1.x suggests that it was obtained via DHCP from the (cable?) modem. If the modem was disconnected to have a direct connection to the embedded board, no DHCP server will be found when the lease expires and the interface will stop working.
>Your initial idea was to mount a directory on your embedded system, which >is exported from your desktop PC. So of course you have to use the IP of >your desktop PC. Login to your embedded system with telnet, then use >something like > >mount -t nfs x:/opt/my_folder > >where "x" is the IP of your desktop PC, e.g. 192.168.1.42, not of your >embedded system and not your internet IP (which is not a local address, so >it don't start with 192.168). Make sure that /opt/my_folder and the IP of >your embedded system is in the /etc/exports file of your desktop PC. You >can read more about the format of the exports file in the NFS HOWTO.
Roberto Waltman wrote:

> You need two different addresses in your net, one for each node. They > can be almost anything, but if you are using DHCP normally they will > be 192.168.1.xxx or 192.168.0.xxx with a netmask = 255.255.255.0 > > It is very likely that your modem was also acting as a DHCP server. If > you disconnect your computer from it, you will have to assign static > IP addresses to both systems.
DHCP is not very likely. If the PC is connected with something like PPPoE, then the modem doesn't do very much and the IP address is provided from the ISP. I would avoid such a configuration, because then you have to trust the firewall of your PC and your computer is visible in the internet without any layer between. Better using a router. There are many routers with an integrated internet port, which provides a gateway for a local network with DHCP and connects itself with PPPoE or similar protocols to the internet. An unpatched Windows systems, which is connected to the internet with a cable modem without a firewall, will be infected with a virus within 4 minutes: http://isc.sans.edu/diary.html?storyid=4721 Patched Windows versions and Linux might survive longer, but maybe not a standard desktop Linux configuration. -- Frank Buss, http://www.frank-buss.de piano and more: http://www.youtube.com/user/frankbuss