NFS in Xiaomi smartphones: a complete guide to setup and use

Network storage by protocol NFS (Network File System allows Xiaomi smartphones to access files on remote servers or NAS-This technology is particularly useful for working with large media libraries, backups or corporate data when FTP or SMB They are too slow or too unsafe. MIUI support NFS implemented in a non-obvious way โ€“ it must be activated manually through hidden settings or third-party applications.

In this article, we will discuss three ways to connect NFS on Xiaomi smartphones (including models on MIUI 14/15 and HyperOS), consider common errors (for example, mount: Operation not allowed), and give recommendations for optimizing data transfer speeds. Particular attention will be paid to the unique feature of Xiaomi firmware - blocking NFS mounting in the background due to the energy saving policy, which breaks the connection when blocking the screen.

What is NFS and why is it needed by Xiaomi?

NFS (Network File System) was developed by Sun Microsystems in 1984 to unify file access in the network infrastructure, and unlike SMB (used in Windows) or AFP (for macOS), NFS is optimized for UNIX-like systems, including Android (based on the Linux kernel), which has several key advantages:

  • ๐Ÿš€ High speed โ€“ due to the minimum overhead costs for data packing (up to 30% faster) SMB when working with small files).
  • ๐Ÿ”’ Flexible Access Rights โ€“ Support UID/GID Extended file attributes (e.g. setuid).
  • ๐ŸŒ Cross-platform โ€“ works with Linux servers, NAS (Synology, QNAP), Windows (through services for the UNIX).
  • ๐Ÿ“ฑ Low energy consumption, unlike FTP, does not require continuous maintenance TCP-linkage.

On smartphones Xiaomi NFS can be useful for:

  • ๐ŸŽฌ Watching movies in 4K HDR s NAS without prior copying to the device.
  • ๐Ÿ“ Automatic photo backup (via Tasker or Automate).
  • ๐Ÿ’ผ Work with corporate documents (if the company uses the NFS-server).
  • ๐ŸŽฎ Storage of emulator files (e.g. RetroArch or Dolphin).

โš ๏ธ Attention: By default MIUI not include support NFS And that means that even if you install a client, you can use it. NFS From Google Play, without manual activation of the kernel module (nfs.ko), the connection will not work.

Checking NFS support in your Xiaomi smartphone

Before trying to connect to NFS-To the server, make sure that your device supports this function at the kernel level:

  1. Install Kernel Adiutor (or CPU-Z) from Google Play.
  2. Open the Kernel section โ†’ File Systems.
  3. Check for nfs, nfsd, or sunrpc strings in the list of supported file systems.

If these modules are not available, you will need to:

  • ๐Ÿ”ง Install a custom core (e.g., FrancoKernel or ElementalX) with support NFS.
  • ๐Ÿ“ฑ Use a smartphone based on Qualcomm Snapdragon (they often have support enabled) NFS drain-core).
  • ๐Ÿ”„ Update the firmware to the latest version MIUI 15/HyperOS (in new versions of support NFS more frequently).
Xiaomi modelStock core (NFS)Custom core is requiredNotes
Xiaomi 13 Proโœ… Yes.โŒ No.Supports NFS v3/v4 out of the box.
Redmi Note 12 Pro+โŒ No.โœ… Yes.It requires firmware with ElementalX kernel.
POCO F5โœ… Yes (partially)โš ๏ธ Maybe.NFS v3 works, v4 doesn't.
Xiaomi Pad 6โœ… Yes.โŒ No.Supports mounting in the background.

โš ๏ธ Note: On devices with MediaTek processors (e.g. Redmi Note 11 or POCO M5) support NFS It's very rare in the drain core, and the only way out is to install custom firmware like LineageOS.

๐Ÿ“Š What network storage protocol do you use more often?
NFS
SMB (Samba)
FTP
WebDAV
I don't use it.

Method 1: Connecting NFS via the NFS Manager Application

The easiest way to mount NFS on Xiaomi is to use the NFS Manager app from SmartPack developer, which does not require root rights, but has limitations: it only works when the screen is unlocked and does not support automatic connection when booting.

Instructions for setting:

  1. Download and install NFS Manager from Google Play.
  2. Launch the application and press + (add server).
  3. Enter the connection data: Server IP โ€” address NFS-servers (e.g., servers, 192.168.1.100). Export Path โ€“ the path to the exported folder (for example, /mnt/nas/shares). Mount Point โ€“ Local folder for mounting (for example, /storage/emulated/0/nfs_share). NFS Version - choose v3 (most compatible).

Mount

If the mounting is successful, the folder will appear in your file manager (for example, in Mi File Explorer).

  • ๐Ÿ”‹ When the screen is locked, the connection is broken (due to the energy saving policy). MIUI).
  • ๐Ÿ“ฅ Read/write speed is limited ~30 MB/s (due to the specifics of Android implementation).
  • ๐Ÿ”’ No support. NFS v4 coded (krb5).

Folder is displayed in file manager | Files open without errors | Copy speed >10 MB/s | Connection does not break when switching between applications-->

Method 2: Manual mounting via Termux (for advanced)

If you want to connect constantly (including the background) or support NFS v4, youโ€™ll have to use Termux, a Linux terminal emulator for Android, which requires root rights or at least the ability to run commands over su.

Steps to set up:

  1. Install Termux and update packages: pkg update & pkg upgrade
  2. Install utilities for working with NFS: pkg install nfs-utils
  3. Create a folder for mounting: mkdir ~/storage/shared/nfs_mount
  4. mount (replace the parameters with your own): mount -t nfs -o soft,intr,rsize=8192,wsize=8192 192.168.1.100:/mnt/nas/shares ~/storage/shared/nfs_mount
  5. To keep the mounting after the reboot, add a command to ~/.bashrc.

Advantages of this method:

  • ๐Ÿ”„ Works in the background (if you turn off battery optimization for Termux).
  • ๐Ÿ› ๏ธ Supports NFS v4 and extended mounting options.
  • ๐Ÿ“ˆ Speed is limited to network equipment (up to 100)+ MB/s on Wi-Fi 6).

โš ๏ธ Attention: On devices with MIUI 14+ mount can be blocked even with root rights due to SELinux policy, in which case you will need to disable enforcing mode by the setenforce 0 command (temporary solution) or patch the kernel.

How to check the speed NFS-connection?
Use the dd utility in Termux for the read/write speed test: dd if=/dev/zero of=~/storage/shared/nfs_mount/testfile bs=1M count=100 For reading: dd if=~/storage/shared/nfs_mount/testfile of=/dev/null bs=1M Normal speed on Wi-Fi 5 โ€” 40-60 MB/s, on Wi-Fi. 6 โ€” 80-120 MB/s.

Method 3: Automation via Tasker (for background work)

If you need to NFS-The connection was automatically restored after rebooting or breaking the connection, you can use Tasker. This method does not require root rights, but requires configuration. ADB circumvention MIUI.

Algorithm of settings:

  1. Install Tasker and AutoTools plugin.
  2. Create a Run Shell task and type a mount command (similar to the Termux method).
  3. Add the triggers: ๐Ÿ”„ Device Boot (when loading the device). ๐Ÿ“ถ Wifi Connected (when connected to your network). โšก Power Connected (when charging, if you need to mount only on a charged device).

MIUI

Tasker

excluded from battery optimization

Settings โ†’ Battery โ†’ Battery Optimization

To bypass MIUI lock for mount commands, run through ADB:

adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_SECURE_SETTINGS

This will allow Tasker to execute commands on behalf of the system.

  • ๐Ÿ” After resetting the settings, the permit will have to be issued again.
  • ๐Ÿ“ต On some firmware MIUI This can cause a Permission Denied error, which can only help root.
/mnt/nas/shares 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)

Solving Common NFS Errors on Xiaomi

When working with NFS on Xiaomi, users often encounter typical problems, and here are the most common mistakes and ways to fix them:

Mistake.Reason.Decision
mount: Operation not permittedThere is no NFS support in the kernel or SELinux lock.Install the custom core or disable SELinux (setenforce 0).
mount: Network is unreachableNFS-The server is unavailable or blocked by a firewall.Check ping to the server and setup iptables on the server.
Stale file handleThe server has rebooted or changed its export path.Remount the folder or restart the nfs-server service.
The connection breaks when the screen is blockedOptimizing the MIUI battery kills background processes.Add the mounting app to battery exclusions.

If you see a mount error: wrong fs type, bad option, bad superblock, most likely the problem is incompatibility of NFS versions.

  1. On the server, you must specify the version nfsvers = 3 in /etc/exports.
  2. In the mounting command, add the option -o nfsvers=3.
  3. If you are using Synology NAS, disable NFS v4 in the shared folder settings.

๐Ÿ’ก

On HyperOS devices (such as Xiaomi 14), NFS support is improved โ€“ it is now possible to base mount without root, but manual configuration is required through developer options.

Optimizing speed and security of NFS on Xiaomi

By default, NFS on Android is not running at its maximum speed. To speed up data transfer and protect the connection, follow the following settings:

To increase speed:

  • ๐Ÿ“ถ Use the Wi-Fi. 5 Ghz or Wi-Fi 6 (speed up 30-50%).
  • ๐Ÿ”ง In the mounting options, specify: rsize=32768,wsize=32768,hard,intr,tcp (increases packet size and uses the same data) TCP instead UDP).
  • ๐Ÿ–ฅ๏ธ On the server, turn on async in /etc/exports (Reduces delays in recording).

To improve safety:

  • ๐Ÿ” Restrict access by IP into /etc/exports (for example, 192.168.1.100(rw)).
  • ๐Ÿ›ก๏ธ Use it. NFS over TLS (Requires you to configure stunnel on the server).
  • ๐Ÿšซ Turn it off. no_root_squash, If you do not need root rights on the client.

If you connect to NFS over the mobile internet (e.g. 4G/5G), you must:

  1. Set up a VPN (like WireGuard) to encrypt traffic.
  2. Use NFS v4 with krb5 (if the server supports Kerberos).
  3. Limit speed through tc (to avoid running out of fare): tc qdisc add dev wlan0 root tbf rate 10mbit burst 32kbit latency 400ms

FAQ: Frequent questions about NFS on Xiaomi

Can I connect NFS without root rights?
Yes, but with limitations: Appendix NFS Manager works without root, but breaks the connection when you lock the screen. ADB-On HyperOS (new models), background work is possible without root through the developer settings.
Why is NFS slower than SMB?
Reasons for low speed: UDP is used by default (less reliable but faster) - switch to TCP in mounting options. Small packet size (rsize/wsize=1024) - increase to 32768. MIUI background data restrictions - add the application to battery exceptions. If the server is on a Raspberry Pi or weak NAS, the problem may be its performance. For speed test, use: ddif=/dev/zero of=./testfile count bs=1M=100
How to Auto-Connect NFS When Downloading?
Automation Options: With root rights: add mount command to /system/etc/init.d/99nfs (Init.d is required in firmware. No root: use Tasker with Device Boot trigger + ADB-On HyperOS: Enable the Stay awake option in the developer settings (Settings) โ†’ The phone. โ†’ Version. MIUI โ€” slip 7 If the mounting is triggered too early (before connecting to Wi-Fi), add the delay to Tasker: Wait: 30 seconds
Can I use NFS for backup?
Yes, but with reservations: ๐Ÿ“ฑ For copying photos suitable FolderSync or Syncthing (configured to: NFS-folder). ๐Ÿ”„ For full backup of the system (through TWRP) NFS It doesn't fit - use it ADB pull or rsync. โš ๏ธ Avoid copying on NFS databases (like WhatsApp) as it can damage them. Example command to back up via Termux: tar -czvf /storage/emulated/0/backup.tar.gz ~/storage/shared/nfs_mount/important_files
What are the alternatives to NFS on Xiaomi?
If NFS Not suitable, consider: Speed Security Protocol Difficulty setting SMB (Samba) Medium (50-70 MB/s Low (no encryption) Low WebDAV Low (10-30 MB/s) High (HTTPS) Medium FTP/FTPS Low (5-20 MB/s) Average (FTPS) Low. SSHFS Tall (80-100 MB/s High (encryption) High For Xiaomi, the easiest to configure SMB via Mi File Explorer (Network) โ†’ Add storage if you need security โ€” SSHFS (attachment SSHFS Android).