Accessing the embedded board via NFS

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

formatting link

Reply to
piyushpandey
Loading thread data ...

First you have to compile your Linux kernel with NFS server enabled. The rest is standard Linux, e.g. see this page:

formatting link

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:

formatting link

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
Reply to
Frank Buss

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

formatting link

Reply to
piyushpandey

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

Reply to
ChrisQ

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:

formatting link

--
Frank Buss, http://www.frank-buss.de
piano and more: http://www.youtube.com/user/frankbuss
Reply to
Frank Buss

I'm not sure about that particular error, but there's some configuration needed by NFS server on Linux. See :

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.

Reply to
Mel

Hello Frank

not

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

formatting link

Reply to
piyushpandey

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
Reply to
Frank Buss

I read that as "Both the computer and the board have the same address" that will not work.

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.

Couldn't agree more.

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 ...

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.

Reply to
Roberto Waltman

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:

formatting link

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
Reply to
Frank Buss

Hello Frank

so

I did as you hinted here in the forum and I did it in two steps as follows:

1.In the first step:

In this I just edited the /etc/exports file and added the ip address of my client that is my embedded board and the path of the folder which I want to share as follows:

/opt/my_folder 192.168.1.230(rw,sync,no_root_squash)

and after saving it I logged in the embedded board via telnet and executed this command:

# mount -t 192.168.1.230:/opt/my_folder

and the command gets executed just giving the sign of pound next to it i.e. " # " which means that the terminal is ready to accept the next command . But where did it mount the filesystem as the path was not specified of the destination folder where it has to be mounted.

So next time I commanded it having the destination folder as :

# mount -t 192.168.1.230:/opt/my_folder /mnt/

where the /mnt/ folder is present on my embedded board , but it gives the following error:

# mount -t 192.168.1.230:/opt/my_folder /mnt/ mount: cannot read /etc/fstab: No such file or directory

ok did not get this point .

So this was all my first step, now in the second step I did a little bit changes and than tried as follows:

2 . Second step of doing the same:

I ran this command this time :

# mount -t nfs -o nolock 192.168.1.230:/opt/my_folder /mnt/

and I get the same error previous error as follows:

mount: RPC: Unable to receive; errno = Connection refused

So with this it gave different error I am not able to get why it is so as I made all recommended changes.

Ok one more thing I want to know is that is it possible to mount any filesystem through the NFS on my embedded board using the terminal of my embedded board by telnet.

Thank you

Piyush Pandey

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey

You have to restart the NFS service on your desktop Linux after editing /etc/exports.

The command is wrong, you need to write this:

mount -t nfs 192.168.1.230:/opt/my_folder /mnt

But I guess it is wrong, because last time you wrote that 192.168.1.230 is the IP address of your embedded system. But you want to mount a directory of your desktop Linux onto your embedded system, so of course you have to provide the IP address of your desktop Linux.

Ok, now the command was ok, but I don't think you need "-o nolock". Maybe next thing to do is to read the troubleshooting section of the NFS-HOWTO, after trying the right IP address :-)

formatting link

Yes, this is possible.

--
Frank Buss, http://www.frank-buss.de
piano and more: http://www.youtube.com/user/frankbuss
Reply to
Frank Buss

I tend to use wireshark or tcpdump when debugging this type of thing, as it shows what's actually on the wire, but to repeat, you must use the server ip in the command line, not the client, if you are mounting from the client. ie, from the client:

mount -t nfs server_ip_or_name:/directory client_path/directory

If you use the server name, not ip address, then you also need en entry in the client /etc/hosts file as well...

Regards,

Chris

Reply to
ChrisQ

Hey guys thanks to all finally I got success in executing the NFS command from my embedded board terminal and therefore now I can mount any directory on my embedded board of my Desktop system.

But I want to know one thing Frank that when I execute this command:

mount -t nfs 192.168.1.2:/opt/my_folder /mnt

I didn't get any response , but when I execute this command :

mount -t nfs -o nolock 192.168.1.2: /opt/my_folder /mnt

I get successfully my folder mounted on the embedded board.

So what is the reason for that.

and this one for you chris :

you told that you use wireshark or tcpdump , what are these things I mean are they different types of softwares to access NFS protocol or they are different type of protocol to access the embedded board from the Desktop.

Well thanks once again guys......you were great helping hands to me.

Thank you

Piyush Pandey

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey

ASssume the space bteween the jost name and path is intentional ?. That is wierd, though you could try:

mount -t nfs -o nolock 192.168.1.2://opt/my_folder /mnt

-----------------------------------^-------------------

I think the nfs client I use on windows takes this syntax. Otherwise, haven't a clue, but nfs runs on a wide variety of unix, linux, windows and other systems. They all have odd corners in the implementation and some may only partially implement the protocol and command line syntax. Look at the man pages for the server and also the same for the flavour of linux running on your embedded board.

Wireshark is a free network diagnostic tool that runs on windows and iirc, os-x. You can selectively filter and trap any packets on the network and view contents. tcpdump runs on unix and was the diag tool many people used for decades before fancier stuff like wireshark. I think both use libpcap at the lower level, just that wireshark has a fancy gui interface and tcpdump is command line only. tcpdump is available for linux, but not part of the standard distribution, at least on suse, so you may need to go and find the package on the web.

I keep an old p3 laptop just for network debugging, win2k bare bones install, wireshark, firefox and other utilities like netstumbler for wireless...

Regards,

Chris

Reply to
ChrisQ

Wireshark runs natively on Linux, and on OS X using the X intermediate layer.

--

Tauno Voipio
tauno voipio (at) iki fi
Reply to
Tauno Voipio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.