Why Redmi 9 Pro is a Network Storage NFS?
Protocol NFS (Network File System allows you to connect remote folders as local drives β the ideal solution for owners of Xiaomi Redmi 9 Pro, who lack internal memory or need to sync files between devices, NFS It operates directly over the local network, which guarantees high speed and no data limits.
However, the setup NFS Xiaomi smartphones have nuances: standard firmware MIUI It doesn't support out of the box protocol. You'll need either root rights or workarounds through Termux or specialized applications. In this article, we'll break down both methods, focus on security and optimization, and solve common bugs like mount: permission denied or rpcbind failure.
Before you start, check:
- πΆ Stable Wi-Fi connection (NFS sensitive to network delays).
- π Battery charge higher 50% (The process of adjustment may take 20-40 minute).
- π± Version. MIUI on your Redmi 9 Pro (instructions are different for 12/13/14).
Method 1: Connection NFS rootlessly through Termux
If you don't have superuser rights, the only way to work is to use the Termux terminal with the nfs-utils package. MIUI 12-14, But requires manual adjustment every time you restart your smartphone.
Steps for installation:
- Install Termux from F-Droid (the Play Market version doesnβt support all commands).
- Update: pkg update & pkg upgrade -y
- Install nfs-utils and dependencies: pkg install nfs-utils proot-distro -y
- Create a mount point (for example, in a folder) /sdcard/NFS).
To install the network folder, use the command:
mount -t nfs -o nolock,soft,udp 192.168.1.100:/path/to/folder /sdcard/NFSWhere 192.168.1.100 β IP yours NFS-server (e.g. router or PC) and /path/to/folder β exported directory.
Ping to the server passes (command ping 192.168.1.100)
There is a folder for mounting (ls) /sdcard/NFS)
The server is allowed access to IP smartphone (check out) /etc/exports)
Port 2049 is open (default for port) NFS)
-->
Limitations of the method:
- π Mounting resets after rebooting.
- π’ Read/write speeds are lower than root access (due to Termux work).
- π No automatic connection when changing the network.
π‘
If the mount command gives an operation not allowed error, try adding the port option.=2049 Use mount.nfs instead of mount. -t nfs.
Method 2: Continuous installation NFS root-right
Root access gives full control of Redmi 9 Pro and allows you to configure automatic mounting. NFS It's going to take a lot of time to load:
- Unlock the bootloader through the Mi Unlock Tool.
- Install custom recovery (TWRP) Get root via Magisk.
- Edit the file /etc/fstab or create a script in /data/adb/post-fs-data.d/.
Example of auto-mounting script (/data/adb/post-fs-data.d/99nfs.sh):
#!/system/bin/sh
mkdir -p /storage/emulated/0/NFS
mount -t nfs -o nolock,soft,udp 192.168.1.100:/share /storage/emulated/0/NFS
chmod 777 /storage/emulated/0/NFSImportant:
chmod 755 99nfs.sh
Advantages of root method:
- π Automatic connection during booting.
- β‘ Speed is close to local storage (Gigabit network).
- π§ Possibility of fine tuning (caching, timeouts).
What happens if you remove the script from the /data/adb?
β οΈ Note: On some versions MIUI 14 script /data/adb/ You may not be able to do this because of the SELinux policy. | grep avc and change the security context if necessary: chcon -R u:object_r:adb_data_file:s0 /data/adb/post-fs-data.d/
Setting up NFS-router-server
Before connecting from Redmi 9 Pro, you need to configure the server correctly. Consider two options: a home router with OpenWRT firmware and a computer running Linux (or Windows with Windows). NFS Server).
For OpenWRT:
- Install packs: opkg update opkg install nfs-kernel-server nfs-utils
- Edit it. /etc/exports, line: /mnt/sda1 *(rw,sync,no_subtree_check,no_root_squash)
- Re-launch the service: /etc/init.d/rpcbind restart /etc/init.d/nfsd restart
For Linux (Ubuntu/Debian):
- Install packages: sudo apt install nfs-kernel-server
- Add the exported folder to /etc/exports: /home/user/nfs_share 192.168.1.0/24(rw,sync,no_subtree_check)
- Apply the changes: sudo exportfs -a sudo systemctl restart nfs-kernel-server
| Parameter in /etc/exports | Description | Recommendation for Redmi 9 Pro |
|---|---|---|
| rw | Allows reading and writing | Of course, otherwise you wonβt be able to save files. |
| sync | Synchronous recording (data is written directly to the disk) | Turn it on for reliability, but speed is lower |
| no_root_squash | Retains root rights for the client | Only if there is root on the smartphone! |
| no_subtree_check | Disables the subtree check (accelerates work) | Recommended for all cases |
β οΈ Note: If you are using firewalld or ufw on the server, open ports 2049/tcp and 2049/udp, also 111/tcp (On OpenWRT, check that the rule is added to /etc/config/firewall.
Optimizing speed and eliminating lags
NFS Mobile devices often run slower than PCs because of Snapdragon processor limitations 720G Redmi 9 Pro and Android Linux kernel features. Here's how to speed up data sharing:
Mounting settings:
- π§ Use the rsize parameter=8192,wsize=8192 to increase the size of the packages.
- π Add hard,intr for reliable recovery after communication break.
- β‘ For a local network with low latency, turn off tcp and use udp.
Team example:
mount -t nfs -o rsize=8192,wsize=8192,hard,intr,udp 192.168.1.100:/share /sdcard/NFSServer settings:
- π₯οΈ On a Linux PC, increase the number of streams NFS, edited /etc/default/nfs-kernel-server: RPCNFSDCOUNT=16
- π‘ On the router, turn off sync in /etc/exports, if the speed is critical (but you risk losing data if the failure occurs).
3.Local tweaks on Redmi 9 Pro:
π‘
The most common cause of lags is the small size of packages (rsize/wsize) By default, increase to 8192-32768 Bytes can double the speed of reading/write.
Addressing common mistakes
When you set up NFS On Redmi 9 Pro, users are faced with typical problems:
| Mistake. | Reason. | Decision |
|---|---|---|
| mount: permission denied | The server does not allow connection to IP smartphone | Check it out. /etc/exports and exportfs -r |
| rpcbind: server localhost not responding | Rpcbind service is not running on the server | sudo systemctl restart rpcbind |
| mount: operation not permitted | SELinux blocks mounting (relevant to root) | Temporarily translate SELinux to permissive or customize context |
| Stale file handle | The server is restarted and the client is trying to use the old descriptors. | Remount the folder (umount) /sdcard/NFS; mount...) |
The most important feature of the Redmi 9 Pro: MIUI 13+ core-driven+ A patch for the module may be required NFS. If the mounting falls with an unknown filesystem type 'nfs' error, install the patch through Magisk:
Magisk Module: "NFS Kernel Fix for MIUI"(search the forum XDA Developers or 4PDA).
β οΈ Note: If after the update MIUI NFS Stopped working, check if the folder rights have been reset /dev/block. Restore them with a team: chmod 755 /dev/block
Security: How to protect data in NFS
NFS It transmits data in a clear form, which makes it vulnerable to interception on the local network:
Restriction of access by IP:
- π V /etc/exports point out specific IP, not subnetwork: /share 192.168.1.150(rw) 192.168.1.151(ro)
- π« Restrict access to everyone else: /share *(rw,noall_squash) β You'd better list the permitted ones explicitly. IP.
Traffic encryption:
- π Use it. VPN (e.g. WireGuard) for tunneling NFS-traffic.
- π The alternative β NFS over TLS (requires stunnel configuration on the server and client).
3. Authentication settings:
- π€ Turn it off. no_root_squash, If there is no root on the smartphone.
- π Use kerberos for authentication (hard to configure, but secure).
Logistics and monitoring:
- π Enable logs on the server: sudo rpcinfo -p sudo tail -f /var/log/syslog | grep nfs
- π‘οΈ Set up alerts for suspicious connections (for example, through the fail2ban).
π‘
For temporary access (for example, file transfer), use the noaccess option for sensitive folders and only open access for a limited time.