In the process of configuring the s3c-2410 development environment, I set up a shared directory for mounting during development, but various problems always occurred. It took me an entire afternoon to complete it, so I will summarize it here.
Usually when NFS cannot be used normally, a prompt will be given, generally the following types are given:
Permission denied
mount: 192.168.81.32:/opt failed, reason given by server: Permission denied
Check the exports configuration file to see if the client is allowed to mount.
errno = No route to host
mount: RPC: Unable to receive; errno = No route to host
First check whether they are in the same network segment
Then input:
[root@localhost etc]# service iptables status
Check if the firewall is turned on, if so, turn it off
[root@localhost etc]# service iptables stop
Note: However, this method sometimes still has some problems, so we simply turn off the firewall and selinux at the same time.
errno = Connection refused
mount: RPC: Unable to receive; errno = Connection refused
① First check whether the nfs service is enabled.
② Secondly, check whether rpcbind is enabled.
If rpcbind is not running, restart the nfs service after re-enabling rpcbind.
Because restarting rpcbind has affected some nfs configurations, it needs to be restarted.
Yes, you have found the problem.
[root@localhost etc]# service iptables stop
Then run service nfs restart.
The cross-compiled program in Linux needs to be run on arm, so first the program needs to be copied to arm, and nfs is selected.
But when mounting nfs on arm, I encountered a failure:
Find solutions online:
The default options for nfs mount include file locking and rely on the dynamic port allocation functionality provided by portmap.
Solution: kill file lock (lockd) or mount -o nolock
So I tried mount -o nolock -t nfs 192.168.1.24:/home/test /mnt/nfs and it worked fine.
not responding, still trying..
Sometimes errors occur when transferring large files.
NFS: server 192.168.81.32 not responding, still trying..
This may be a problem with NFS, which may be related to the size of the RING or buffer.
Cause analysis of the problem:
1. The default transmission protocol of NFS is UDP, and when the PC and the embedded system interact through UDP, serious network card packet loss will occur;
2. The transmission rates of the network cards of the server and the target machine conflict, which requires the target machine to spend a lot of time copying a large number of data packets. In fact, if the network card rate of the target machine is large enough, there is no need to divide so many packets and there will be no conflict.
Solution to the problem:
method one:
Use TCP protocol on the client side, use the following command, and add the parameter tcp to the mount command
mount -o tcp ,nolock 192.168.14.223:/nfs_root /mnt
You can also do this:
After tracing the code of fs/nfs/nfsroot.c, I found that when nfs is used as the root file system, the parameters can be written directly after "nfsroot=", and each parameter is separated by a comma, such as:
nfsroot=192.168.10.1:/rootfs,proto=tcp,nfsvers=3,nolock
This way you can specify nfs to use the tcp protocol
Method Two:
Specify the transfer rate (limit the size of data that can be read or written at one time during transfer)
mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.14.223:/nfs_root /mnt
3. The card is in the connected state when mounted
Solution: If the network connection is normal, it may be that iptable or network firewall blocks TCP and UDP ports 111 and 2049 used by NFS. Taking ESX as an example, when you need to mount the NFS shared disk, you first need to edit the firewall security file to allow access to the port. Or simply disable the firewall
svc: failed to register lockdv1 RPC service (errno 111).
solution:
The default options for nfs mount include file locking and rely on the dynamic port allocation functionality provided by portmap.
Solution: kill file lock (lockd) or mount -o nolock
The mount was mounted with RW permissions, but read and write were still Permission denied.
After restarting the NFS service, on the client
mount -o tcp,nolock 192.168.10.77:/home/gatieme/Work/NfsRoot /mnt/nfs
The command mounts the network file locally. After the execution is completed, the directory is accessible, but not writable. It feels a bit strange, because the command clearly specifies that it can be written.
So I searched for information online and found that there is a parameter no_root_squash in the exports directory permissions.
Its function is: if the user who logs in to the NFS host and uses the shared directory is root, then he will have root permissions for the shared directory! .
By default, the opposite parameter root_squash is used.
If the user who logs into the NFS host and uses the shared directory is root, the user's permissions will be compressed to an anonymous user, and usually his UID and GID will become nobody.
Because my client is logged in as root, the permissions are compressed to nobody, no wonder it cannot be written. Change the configuration information to:
/home/gatieme/Work/NfsRoot 192.168.10.123(rw,no_root_squash)
It was said to be a bit unsafe, but the problem was solved.
Previous article:Cross compile and port opencv3.0.0 to arm board
Next article:1.5.4_swi exception mode program example
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Working principle and application of module power supply
- RF/Wireless Popular Data Download Collection
- How to implement wireless video transmission
- [Me and Atria 3] at32-littlevgl uses gui-guider designer to make a mini-hmi display
- Come if you dare! Enter the top-secret black technology laboratory of Tektronix!
- How to read the varistor data sheet? From related terms to component selection
- Share LCD JLX12864G-086 driver based on msp430
- [Image recognition classification & motion detection & analog signal processing system based on Raspberry Pi 400, sixth post - supplement] Raspberry Pi and S...
- EEWORLD University Hall ---- Tsinghua University Altera FPGA Engineer Growth Handbook
- [GD32L233C-START Review] 1. Unboxing + Resource Introduction