Why you need NFS on your smartphone and why Xiaomi 9T is right for it
Network File System (NFS) is a protocol that allows remote file systems to be mounted as local folders. On the Xiaomi 9T (Davinci model), this technology offers unique opportunities, from streaming media from the NAS to backing up photos directly to network storage. Unlike SMB or FTP, NFS provides faster data transfer speeds at low latency β critical for large files.
The main question is why Xiaomi 9T? The thing is the hardware platform: the smartphone is equipped with a Qualcomm Snapdragon 730 chipset, which supports the Linux kernel with the nfs.ko module. NFS-The client can be run even without root rights using standard mechanisms. MIUI. But there are some nuances: starting with MIUI 13, Xiaomi has restricted access to some system features, so stable operation will require bypassing these restrictions.
In this article, we will discuss:
- π How to Check the Compatibility of Your Xiaomi 9T s NFS
- π± Step-by-step setting up a client without root rights
- π₯οΈ Configuration NFS-server-side NAS
- β‘ Optimizing performance for working with media files
Compatibility Check: Does your Xiaomi 9T NFS support?
Before you start setting up, make sure your device is capable of working with NFS. On Xiaomi 9T, this depends on two factors: the version of MIUI and the presence of a kernel with support for nfs.ko.
Open the terminal (for example, via the Termux or ADB app) and execute the command:
ls /proc/filesystems | grep nfsIf you see the nfs in the answer, or nfs4 β If you don't, you'll need an alternative method (more on this in the next section). MIUI In Settings β The phone:
| MIUI version | Support for NFS | Notes |
|---|---|---|
| MIUI 11β12 | Complete. | The nfs.ko module is automatically loaded. |
| MIUI 13β14 | Limited. | Manual module loading or bypass via Termux is required |
| MIUI 14 (Global) | Partial | Only NFSv3 works, encryption issues |
β οΈ Note: On firmware with a blocked bootloader (for example, Chinese versions of Xiaomi) 9T) module NFS In this case, the only way out is to unlock the bootloader or use alternative protocols (SMB, WebDAV).
Installation NFS-Xiaomi client 9T rootless
If your device is compatible, the next step is to install the client, and the most reliable way to do this without root rights is to use Termux with nfs-utils, which allows you to mount network folders right in the Android file system.
Instructions:
- Install Termux from F-Droid (Google Play version is stripped down).
- Update packages and install nfs-utils: pkg update && pkg upgrade pkg install nfs-utils
- Create a mount point: mkdir ~/storage/shared/NFS
- mount a network folder (an example for a server with IP 192.168.1.100): mount -t nfs 192.168.1.100:/path/to/share ~/storage/shared/NFS
Termux Storage Allowed in Android| Settings
Installed packets nfs-utils and proot-distro|
Network folder exported to server with rw| rights
IP-server address is recorded in the local network-->
β οΈ Attention: By default MIUI lock-in /storage/emulated/0. Use the path ~/storage/shared β This is a workaround solution that works on all versions of firmware.
/path/to/share 192.168.1.0/24(rw,no_root_squash,async)
and reset NFS-server by the Sudo Exportfs team -ra-->
Setting up NFS-servers: requirements and configuration
For work. NFS You need not only a client on a smartphone, but also a properly configured server. Linux/Windows, router NFS (for example, ASUS RT-AX88U) or specialized NAS-device (Synology, QNAP). We will consider a universal version based on Linux (Ubuntu/Debian).
Minimum requirements for the server:
- π₯οΈ Operating system: Linux (Ubuntu recommended) 20.04+) Windows 10/11 service NFS (Requires installation of Services for NFS).
- π Static IP-address in the local network (configure in the router) DHCP-reservation).
- π Export folder with 777 rights (temporary testing solution).
Installation of the server on Linux:
sudo apt update
sudo apt install nfs-kernel-serverEdit the export file:
sudo nano /etc/exportsAdd a line (replace IP with your local network subnet):
/mnt/nfs_share 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)Apply the changes:
sudo exportfs -a
sudo systemctl restart nfs-kernel-serverHow to set up NFS-Windows-server 10/11
Mounting NFS-folders in the Android file system
After you set up the server, you just have to connect the network folder to the Xiaomi 9T. There are two options: temporary mounting (before rebooting) and permanent (with auto-starting).
Temporary installation (for testing):
mount -t nfs -o nolock,proto=tcp,rsize=8192,wsize=8192 192.168.1.100:/mnt/nfs_share ~/storage/shared/NFSRize and wsize parameters increase the data transfer rate β it is important for streaming video.
Continuous installation (via fstab):
1. Create a file. ~/nfs_mount.sh:
#!/data/data/com.termux/files/usr/bin/bash
mount -t nfs -o nolock,proto=tcp,rsize=8192,wsize=8192 192.168.1.100:/mnt/nfs_share ~/storage/shared/NFS2. Make it executable:
chmod +x ~/nfs_mount.sh3.Add to the autoboot Termux (via termux-boot):
pkg install termux-boot
ln -s ~/nfs_mount.sh ~/../usr/etc/termux-boot/π‘
For stable NFS on Xiaomi 9T, use the TCP protocol (proto=tcp), not UDP. This reduces the likelihood of connection breakage when transferring large files.
Optimizing Productivity and Solving Problems
NFS on mobile devices often faces two challenges: slow data rates and connection breaks. On Xiaomi 9T, this is due to MIUI's energy saving policy, which suspends network activity in the background.
Optimization methods:
- β‘ Turn off battery optimization for Termux: Settings β Annexes β Termux β Battery β No restrictions.
- πΆ Use a fixed Wi-Fi channel on your router (e.g., a 48th channel in the 5GHz band) to reduce latency.
- π Increase the timeouts NFS on the server, adding in /etc/nfs.conf: [nfsd] tcp=y udp=n vers4=y vers4.0=y vers4.1=y vers4.2=y
Common mistakes and their solutions:
| Mistake. | Reason. | Decision |
|---|---|---|
| mount: Operation not permitted | MIUI blocks mounting | Use Termux with proot-distro or unlock bootloader |
| RPC: Program not registered | NFS-server not running | Check the status: sudo systemctl status nfs-server |
| Stale file handle | The server rebooted. | Remount the folder or add hard,intr to the mounting options |
NFS Alternatives: When to Choose a Different Protocol
NFS is not always the best solution, and if you want high compatibility or traffic encryption, consider alternatives:
SMB (Samba):
- β It works out of the box. MIUI (through the "Conductor" β Network").
- β Supports encryption (SMB 3.0+).
- β Slower. NFS 20-30% for small files.
WebDAV:
- β Works through HTTPS (securely).
- β Easy to set up on any hosting.
- β High load on the processor when encrypting.
SSHFS:
- β Encrypting traffic out of the box".
- β It does not require a separate server (sufficient). SSH-access).
- β Slowly, noticeably. NFS/SMB because of overhead encryption.