Embedded development board using the Ethernet port and nfs file sharing

 

If your board has a network port, like this stuff.

 

Well, you can buy a network cable, similar to this stuff.

 

Then you and your computer can be connected with the cable boards up to folders shared through NFS (Network File System), equivalent to mount the shared folders, nfs mounted using the network, your computer hard disk is mounted by hardware (pcie?).

 

Nfs configuration process:

Only for ubuntu computers and embedded development board instructions, Windows I have not tried, if necessary, can refer to fumble.

 

The following presentation only for my environment, my environment is:

ubuntu16.04 computer, the computer via WiFi Internet access, embedded development board is a linux system.

As if your computer is a networking cable Internet, in fact, no big difference.

 

1. Check your computer's ip (ifconfig)

 

Dir address card of one mind that the Ethernet ip (enp0s31f6), my computer is out of the yellow box ip, ip address that is embedded boards to be connected. Note that different computers may display the name is not the same, my name is enp0s31f6.

Interface in addition to the above first enp0s31f6, there's a wlan ip (wlp3s0), in some cases, this is ip and ethernet ip is the same, sometimes different, we only Ethernet ip.

 

However, my computer start of ifconfig, and did not show ip box, because you do not set this ip, ip The ip called Ethernet, or call a static ip, there are many online tutorials on setting a static ip ubuntu .

 First open / etc / network / interfaces file

My static ip settings are:

enp0s31f6 Auto 
iface enp0s31f6 inet static 
address 169.254.XXX.XXX (own settings) 
Netmask 255.255.0.0

  

Which enp0s31f6 as the name of your first card.

address and netmask can set up their own.

 

ok, you have to get a static ip.

 

2, modify your ip embedded board

/Etc/init.d/S00eth0 open files on embedded boards, add (the second and third rows), if not the first line of the following two lines, please add.

#! /bin/sh

ifconfig eth0 169.254.XXX.YYY
mount -o nolock -t nfs 169.254.XXX.XXX:/home/yongyang/hi3559a /mnt

  

ifconfig eth0 169.254.XXX.YYY represent embedded board ip modified to this ip , remember to revise your computer to the same period of ip , which is why the computer to remember static ip one reason. Means that the same paragraph, only the last . 3 digits different from other identical IP .

mount -o nolock -t nfs 169.254.XXX.XXX:/home/yongyang/hi3559a / mnt this line ip , is your computer a static ip . He said it would on your PC / home / yongyang / hi3559a folder mount board / mnt , the board later access / mnt , you can access the appropriate folder on your computer.

 

After the file is written, each time the card is activated, set to be executed, so you can reboot reboot, or re-direct power off, and they can be configured to take effect. . .

 

 

 

3 , but not enough to do this, you need to configure on your computer nfs server. The following is executed on a computer

 

sudo apt-get install nfs-kernel -server installation nfs server

 

 

Their new one folder for the mount, I created a / home / yongyang / hi3559a

 

Modify the permissions for the folder:

sudo chown nobody:nogroup /home/yongyang/hi3559a
sudo chmod 777 /home/yongyang/hi3559a

  

Modify / etc / exports file

Add a line in the file

/home/yongyang/hi3559a 169.254.XXX.YYY(rw,sync,no_root_squash,no_subtree_check)

  

 ip here is the board's ip, indicating that the computer will open / home / yongyang / hi3559a folder as the ip of the device to mount. Parentheses copy.

 

sudo exportfs -a To export a shared directory

sudo systemctl restart nfs-kernel-server last restart nfs

 

4, restart your card to see if you successfully mount

For example, I can be on the computer / home / yongyang / hi3559a decentralized file folders to see if I have this document in the board / mnt in.

 

 

Recommendation: Modify good on both sides after ip, you can try to ping each other, if you can ping the same, it may, ping different, behind not finish, see what steps you made a mistake. Remember to turn off Windows Firewall.

Guess you like

Origin www.cnblogs.com/yongy1030/p/10990549.html
Recommended