Transfer of files by protocol NFS (Network File System for Xiaomi devices is one of the most efficient ways to share data on a local network, especially if you need to work with large media files, backups or firmware. SMB or FTP, NFS Provides higher transfer speeds and less CPU load, which is critical for resource-limited devices such as Mi. TV Stick or Mi Box S.
However, the setup NFS Xiaomi devices have their own nuances: from choosing the right version of the protocol (v3 or v4) This article will take you through the steps, from preparing network storage to solving common errors like Permission denied or Mount failed. MIUI TV Android TV Xiaomi-based, where the interface and features may differ from standard solutions.
If you havenโt worked with network protocols before, donโt worry: the manual is tailored for users of all levels. For experienced administrators, we have prepared a section with advanced settings, including performance optimization and traffic protection.
What is it? NFS And why is he better? SMB for Xiaomi devices
Protocol NFS (Network File System was developed by Sun Microsystems in 1984 to provide unified access to files over a network. SMB (Windows-based), NFS initially focused UNIX-similar systems, which makes it more compatible with Android TV Linux-based firmware used in Xiaomi devices.
Main advantages NFS for Xiaomi devices:
- ๐ High speed transmission - up to 30-50% faster than SMB, thanks to a smaller overhead protocol.
- ๐ง Low load on CPU โ critical for weak processors in the Mi TV Stick or Mi Box 3.
- ๐ Flexible access rights โ set up through UID/GID Instead of simplified guest modes SMB.
- ๐ Support for symbolic links โ important for working with firmware and backups.
But there are downsides: NFS requires more complex configuration, does not support encryption out of the box (unlike the SMB 3.0+) It can be less stable in unstable network connections, and for Xiaomi devices, this means that the protocol is better used on LANs with wired connections (Ethernet) or stable Wi-Fi. 5/6.
โ ๏ธ Attention: NFS version 4.x It may not be supported on older Xiaomi models (e.g., the Mi Box 1st generation). NFS v3, This will require additional security settings on the server.
Network Preparation: Requirements for Stable Operation NFS
Before you set up NFS-server, make sure your network meets the minimum requirements for stable file transfer:
- ๐ Local area network with support IPv4 โ NFS works poorly IPv6 most-router.
- ๐ Wired connection (Ethernet) โ recommended for transferring large files (e.g. movies to the Internet) 4K firmware).
- ๐ถ Wi-Fi 5 (802.11ac) or newer โ if wired connection is not possible, use the 5GHz band.
- ๐ Static IP-Addresses โ for the server and client (set up in the router or manually on devices).
For Xiaomi devices with Android TV (Like Mi. TV 4S Or the Mi Box S, check out too:
- ๐ Disable Power Saving Mode in Network Settings โ It Can Break Connection.
- ๐ก๏ธ Turn off the firewall. MIUI (if used in the settings โ Security โ firewall.
| Network parameter | Minimum requirement | Recommended value |
|---|---|---|
| Connection speed | 10 Mbps | 100 Mbps (for example, 4K-content) |
| Delay (ping) | < 100 ms | < 20 ms |
| MTU | 1500 | 9000 (Jumbo Frames, if supported) |
| DHCP-reservation | Not necessarily. | Recommended for the server and client |
โ ๏ธ Note: If your router supports IGMP Snooping, disable this feature in your local network settings. It can cause problems with the multicast traffic that is being used. NFS op.
Setting up NFS-servers on Windows, Linux or router
NFS-You can deploy the server on different platforms. Let's look at the three most common options for working with Xiaomi devices.
1. NFS-Server on Windows (using the WSL third-party software)
Native support NFS-There is no server in Windows, but there are two ways around:
- ๐ง WSL 2 (Windows Subsystem for Linux) โ Install Ubuntu and set up NFS inside.
- ๐ป Third-party software, for example, hanewin NFS Server (paid) or FreeNFS (free but limited).
For WSL Execute at the Ubuntu terminal:
sudo apt update && sudo apt install nfs-kernel-server
sudo nano /etc/exportsAdd a line (replace) IP_client IP your Xiaomi device):
/path/to/folder IP_client(rw,sync,no_subtree_check,no_root_squash)2. NFS-Linux-server (Ubuntu/Debian)
On Linux, it is easier to set up:
sudo apt install nfs-kernel-server
sudo systemctl enable --now nfs-serverEdit it. /etc/exports and add:
/media/shared 192.168.1.0/24(rw,sync,no_subtree_check,anonuid=1000,anongid=1000)Apply the changes:
sudo exportfs -a
sudo systemctl restart nfs-server3. NFS-server on the router (Keenetic, ASUS, etc.)
Many modern routers (for example, Keenetic or ASUS RT-AX88U) support NFS-The server is out of the box:
- Go to section. USB-applications โ Network server.
- Select a connected drive (a flash drive or a flash drive). HDD).
- Activate the option. NFS-server and specify the folder for access.
- In the security settings, allow access to IP-Addresses of your Xiaomi device.
Make sure there is enough free space on the server.|
Make sure that the firewall does not block ports. 2049 (TCP/UDP)|
Set up static. IP server-client|
Turn off energy saving modes on the router and client-->
Connection NFS-Xiaomi balls TV Mi Box
Now, we're going to go to customize the client side on Xiaomi devices, and the process may vary depending on the firmware and model.
Method 1: Using a standard file manager (MIUI TV)
On Xiaomi Mi TVs TV firmware MIUI TV:
- Open the File Manager (if not, install it from Google Play).
- Select the Network โ Add network storage.
- Specify the type of connection: NFS.
- Enter the data: Server: IP-address NFS-servers (e.g., servers, 192.168.1.100). Folder: Path to the exported directory (e.g, /media/shared). Username/password: Leave blank if you use it no_root_squash.
Method 2: Through the application"NFS Manager" (Android TV)
For Mi Box S or other Android devices TV:
- Install the NFS Manager app from Google Play.
- Press Add. NFS Share and fill in the fields: Share Name: arbitrary name (e.g. XiaomiMedia). IP: Server Path: Path to the folder. Mount Point: Local path to mount (e.g, /mnt/nfs).
Mount at Boot
Method 3: Manual mounting through ADB (for experienced)
If standard methods do not work, you can connect NFS through ADB:
adb shell
su
mkdir /mnt/nfs_share
mount -t nfs -o nolock,proto=udp 192.168.1.100:/media/shared /mnt/nfs_shareImportant: On some firmware, Xiaomi may need to disable SELinux with the setenforce 0 command before mounting.
๐ก
If there is a Permission Denied error during mounting, check that the server in the /etc/exports The correct rights are specified (rw for writing, ro for reading) and restart NFS-server by the command sudo systemctl restart nfs-server.
Solving Common Errors When Connecting NFS
Even if you set it up properly, you can run into errors, and let's look at the most common ones and how to fix them.
| Mistake. | Possible cause | Decision |
|---|---|---|
| Mount failed: No such device | NFS-The server is not responding or is incorrect IP | Check it out. IP-Server address and port 2049 availability |
| Permission denied | Incorrect rights in /etc/exports SELinux | Add in. no_root_squash Or turn off SELinux. |
| Stale file handle | The server has been rebooted and the client is trying to access the files. | Remount the ball or reboot the client |
| Connection timed out | Firewall blocks traffic or network problems | Turn off the firewall or check the cables/Wi-Fi |
If the error persists, check the logs on the server:
sudo tail -f /var/log/syslog | grep nfsโ ๏ธ Attention: On Xiaomi devices with firmware MIUI TV older 2021 There may be no support for the year NFS v4. In this case, force the version of the protocol in the mount command: mount -t nfs -o nfsvers=3....
How to check for support NFS Xiaomi-based?
Optimizing productivity NFS media-file
If you're transmitting through NFS film 4K, High-resolution music or big firmware, setting the default protocol may not be enough. Here are some tips for optimizing:
- ๐ฆ Increase the size of the buffer โ add in the mounting option: rsize=32768,wsize=32768
- ๐ Disable attributes (if not needed): noatime, nodiratime
- ๐ Use it. TCP instead UDP (More stable for larger files: proto=tcp
- ๐ Set up Jumbo Frames โ if your network supports MTU 9000, add on server and client: ifconfig eth0 mtu 9000
Example of a complete mounting command with optimizations:
mount -t nfs -o rsize=32768,wsize=32768,noatime,nodiratime,proto=tcp,nfsvers=3 192.168.1.100:/media/shared /mnt/nfs_shareFor Xiaomi devices with a weak processor (e.g. Mi) TV Stick is also recommended:
- ๐ฌ Disable pre-buffering in the player (for example, in Kodi or VLC).
- ๐ Use separate balls for different types of content (movies, music, firmware).
๐ก
For maximum performance when transferring large files (>1 GB) use a combination of rsize parameters=32768,wsize=32768,proto=tcp and wired connection. This will reduce the transmission time 20-40% compared to the default settings.
Security NFS: How to protect data from unauthorized access
NFS It doesnโt initially encrypt traffic, so itโs important to take steps to protect your data, especially if you have other devices on your network.
1. Restriction of access over IP
In the file /etc/exports Please do not specify subnets (for example, 192.168.1.0/24), specific IP-address:
/media/shared 192.168.1.101(rw) 192.168.1.102(ro)2.Use of Kerberos for authentication
For businesses or home networks with high security requirements, set up Kerberos:
sudo apt install nfs-kernel-server krb5-user
Set up /etc/krb5.conf and export balls with the option sec=krb53. Encrypting traffic by means of VPN
If NFS Used online (not recommended), be sure to set up VPN (For example, WireGuard or OpenVPN between server and client.
4. Adjustment of access rights
Avoid using it. no_root_squash - You'd better point out clearly. UID and GID:
/media/shared 192.168.1.101(rw,all_squash,anonuid=1000,anongid=1000)โ ๏ธ Attention: On Xiaomi devices with firmware MIUI TV It can be enabled with an embedded antivirus that blocks access to network folders. โ Security โ Antivirus or add an exception for the mounting path.