NFS on Xiaomi: how to connect a network disk to a phone or TV box

Network storage by protocol NFS (Network File System allows you to turn your Xiaomi device into a full-fledged client for accessing files on the Internet. NAS, Linux servers or even other Android devices. SMB or FTP, NFS Provides higher data transfer speeds and less processor load – critical for playback 4K HDR-Video on Mi Box S or work with large databases POCO F5.

However, standard MIUI and HyperOS firmware do not include built-in NFS support out of the box.This guide covers all the current ways of connecting, from manual mounting via Termux to using specialized applications. We will also analyze the typical errors like β€œPermission denied” or β€œmount: invalid argument” that occur when working with Xiaomi devices based on Qualcomm and MediaTek.

Important: the procedure requires root rights on smartphones (except for methods with applications) and on-set developer mode on TV set-top boxes. TV Stick or Redmi Smart TV, Check the compatibility of your model with NFS-client in the table below.

What is NFS and why is it needed by Xiaomi?

NFS (developed by Sun Microsystems in 1984) is designed to remotely access a file system as if it were local, and on Xiaomi devices, it solves three key problems:

  • 🎬 Media streaming: playing movies in 10-bit H.265 s NAS No buffering (relevant to the Mi Box) 4K limited-memory).
  • πŸ“ Backup: Automatic backup of photos from Xiaomi 13 Ultra to the server without using cloud services.
  • πŸ–₯️ Development: mounting the source of projects directly from the server to the POCO X6 Pro for easy work in Android Studio.

Compared to alternatives, NFS benefits where performance is important:

ProtocolSpeed (Mbps)CPU loadingSupport for Xiaomi
NFS v4800–1200Low.Requires root/Termux
SMB (Samba)300–600MediumBuilt-in support
FTP/FTPS200–400Tall.Through applications
WebDAV150–300Very high.Through applications

⚠️ Note: On devices with MediaTek Dimensity processor (e.g. Redmi Note 12 Pro)+) You may need to disable DM-Verity before mounting. NFS. This is due to the features of the Linux 4.19 kernel used in these chips.

πŸ“Š What do you want to use for? NFS Xiaomi?
Streaming video from NAS
Backup of files
Development/programming
Another option

Preparing Xiaomi Device for NFS

Before setting up, check two key conditions:

  1. Hardware compatibility: NFS is supported by all Xiaomi-based Android 8.0+ devices, but for full mounting requires a kernel with the module nfs.ko. To find out the kernel version you can command: adb shell uname -a If the output contains the word "aarch64" - your device is compatible.
  2. Network infrastructure: NFS is sensitive to delays.
  • πŸ“Ά Use 5 GHz Wi-Fi or wired connection (for Mi Box via USB-to-Ethernet adapter).
  • πŸ”’ Set up static. IP for server and client in router (e.g. 192.168.1.100 for NAS).
  • πŸ›‘οΈ Turn it off. IPv6 in the settings of the router - it can cause timeouts when mounting.

For the Mi Box S, Mi TV Stick 4K, additionally:

⚠️ Attention: In firmware based on Android TV 11+ lock-in NFS into /storage/emulated/0. Use alternative methods like /data/local/nfs external USB-accumulator.

Developer mode is enabled (7 times click on "Build Number")

Allowed debugging over USB (in the settings of the developer)

Installed ADB drivers on PC

The NFS server is configured and available over a local network.

Compatibility of the device core is checked-->

Method 1: Connecting NFS over Termux (without root)

This method is suitable for Xiaomi smartphones without superuser rights, but requires the installation of Termux from F-Droid (the version from Google Play does not support proot).

Adjustment steps:

  1. Install Termux and update packages: pkg update & & pkg upgrade -y
  2. Install the necessary utilities: pkg install nfs-utils proot -y
  3. Create a mounting point and connect NFS: termux-setup-storage mkdir ~/nfs_mount mount -t nfs -o soft,udp,nolock 192.168.1.100:/path/to/share ~/nfs_mount Replace. 192.168.1.100:/path/to/share to the real address of your server.

Limitations of the method:

  • πŸ”„ Files will only be available inside Termux (not visible in the standard file manager).
  • 🐒 Read/write speeds are 20 to 30% lower due to proot emulation.
  • πŸ”Œ After restarting the device, the mounting is reset (you need to repeat the command).

πŸ’‘

To automate the connection when you start Termux, add the mount command to the file ~/.bashrc. To do this, edit it via nano ~/.bashrc and paste the mount string at the end of the file.

Method 2: Full mounting with root rights

If your Xiaomi device has an unlocked bootloader and Magisk installed, you can mount NFS directly into the system.This method ensures maximum performance and integration with the file system.

Requirements:

  • πŸ“± Device with root rights (stitched through) TWRP Or OrangeFox).
  • πŸ”§ Module NFS Manager for Magisk (you can download it on the Internet) XDA Developers).
  • πŸ–₯️ server NFS with an exported folder (check it out) /etc/exports server-side).

Instructions:

  1. Install the NFS Manager module via Magisk and restart the device.
  2. Open Termux (or Adb Shell) and execute: su mkdir /data/local/nfs_share mount -t nfs -o rw,soft,intr,rsize=8192,wsize=8192 192.168.1.100:/mnt/user/media /data/local/nfs_share Parameters rsize/wsize Optimize speed for the Gigabit network.
  3. Check mounting: df -h | grep nfs If the team returned the path - the connection is successful.

On file system devices f2fs (for example, Xiaomi 12T Pro) mounting in /storage/emulated/0 This will cause the error "Permission denied." Use alternative methods: /data/media/0 external SD-map.

Mounting parameterDescriptionRecommended value
rw/roAccess mode (read/write or read only)rw for full access
soft/hardNetwork error behavioursoft (breaking of connection)
intrAllow interruption of operationsInsert (intr)
rsize/wsizeSize of the read/write block8192 for Gigabit Ethernet
How to check exported folders on the server?
On a Linux server, run the command: sudo exportfs -v sudo showmount -e localhost For NAS Synology/QNAP, check the settings in the control panel in the "Network Storage" section β†’ "NFS".

Method 3: Use client applications (without Termux and root)

If you don’t want maximum performance, you can get by with specialized apps from Google Play, which are suitable for basic file access, but have limitations:

  • πŸ“₯ NFS Manager (from YoungMonkeys) – supports mounting in user space, but requires Android 9+.
  • πŸ“ Total Commander with a plugin NFS Plugin – easy to view files, but does not support streaming video.
  • πŸŽ₯ Kodi - has a built-in NFS-Media player client (ideal for Mi Box).

Customization in Kodi (relevant to Mi TV Stick):

  1. Open Kodi and go to Settings β†’ File Manager β†’ Add source.
  2. Select the NFS Protocol and type: nfs://192.168.1.100/path/to/share
  3. Please provide a username/password if the server requires authentication.

⚠️ Note: Google Play apps often use an outdated version of the libnfs library (v1.9.3), What can cause errors with servers on the NFS v4.2. If files are not displayed, try manually specifying the protocol version in the application settings (usually NFS v3).

Solving Common Errors When Connecting NFS

Even with the right setup, you can encounter errors, and here are the most common ways to fix them:

Mistake.Reason.Decision
mount: Operation not permittedNo mounting rightsRun su in front of a command or check SELinux (getenforce)
RPC: Program not registeredRpcbind service is not running on the serverOn the server run sudo service rpcbind restart
Permission denied (13)Incorrect access rights on the serverCheck /etc/exports and folder rights (chmod 777)
No route to hostNetwork problems (firewall, VPN)Turn off VPN, check ping 192.168.1.100

For HyperOS devices (e.g. Xiaomi 14) additionally:

  • πŸ”§ If the mounting falls with the error "Invalid argument", try adding the option nfsvers.=3 on the team:
mount -t nfs -o nfsvers=3 192.168.1.100:/share /mnt/nfs

On the Mi Box with Android TV 12, you may need to disable the β€œPrivate DNS” function in your network settings – it conflicts with NFS.

πŸ’‘

90% connection errors NFS Incorrect server settings (incorrect export to the server) /etc/exports) or network restrictions (firewall, IPv6). Always start your diagnosis with the showmount team. -e [server_ip] server-side.

Optimizing NFS Performance on Xiaomi

By default, NFS uses conservative settings that don't unlock the potential of today's networks.

  • πŸš€ Increase the size of the blocks: use rsize=32768,wsize=32768 for 10-Gigabit network.
  • πŸ”„ Enable caching: Add the actimeo parameter=30 to reduce delays.
  • πŸ“‘ Turn it off. TCP: local-network UDP (proto=udp) faster than TCP.

Example of optimized mounting command for POCO F4 GT:

mount -t nfs -o rw,soft,intr,rsize=32768,wsize=32768,actimeo=30,proto=udp 192.168.1.100:/mnt/disk1 /data/local/nfs_mount

To check the actual speed, use:

dd if=/data/local/nfs_mount/large_file of=/dev/null bs=1M count=1000

On the Mi Box S with limited resources, it is recommended to:

  • Use nfsvers=3 instead of v4 (less CPU load).
  • Limit the number of files open at the same time: noac.
  • Disable the time attributes: noatime, nodiratime.

FAQ: Frequent questions about NFS on Xiaomi

Can I connect NFS to Xiaomi without root?
Yes, but with limitations: Through Termux (files will only be available in Termux), through applications like NFS Manager or Kodi (without full integration into the system), full mounting in /storage/emulated/0 requires root.
Why is NFS slower than the SMB on my Redmi Note 11?
Possible reasons: NFS v2 instead of v4 (check the server version). Small block size (rsize/wsize by default 1024 bytes). SELinux is enabled in enforcing mode (check through getenforce). Solution: upgrade the server to NFS v4.1 and use rsize=8192,wsize=8192.
How to automatically mount NFS when you download Xiaomi?
Device-specific methods: With root: add a command to /data/adb/post-boot.d/nfs_mount.sh (Magisk Post-Boot Script module required. Without root: use Tasker with Termux:Tasker plugin to automatically execute commands in Termux. On Mi Box: set up Kodi autorun with mounted NFS.
Can I use NFS to back up photos with Xiaomi?
Yeah, but there's nuance: πŸ“Έ The Gallery app will not see files on NFS-Disk storage (only local or cloud storage). πŸ”„ Use SyncThing or FolderSync to automatically copy photos NFS. ⚠️ Turn off compression in the backup settings - it increases the load on the backup CPU. For Xiaomi. 13 Ultra with a large volume of photos is recommended to mount NFS into /data/media/0/Pictures and use Termux to copy via rsync.
Why After Updating MIUI quit NFS?
Updates MIUI/HyperOS drop off: πŸ”§ SELinux Rights (solution: install setenforce) 0 temporarily). πŸ“‚ Mounting paths (e.g, /storage/emulated/0 may become unavailable). πŸ”„ Magisk modules (reinstall) NFS After the update: Check root: su status in Termux. Remount NFS Manually upgrade the Magisk modules.