NFS Connection on Xiaomi Redmi 9: Full Instruction with Error Solutions

Xiaomi Redmi 9 is a popular smartphone with flexible networking capabilities, but connecting NFS (Network File System) on it requires specific actions. Unlike standard protocols like SMB or FTP, NFS provides higher data transfer speeds on LANs, which is important for working with media files or backups. However, in the stock firmware MIUI, NFS support is absent β€” it needs to be activated manually.

This article will help you understand how to set up NFS-client 9 (model M2003J15SC/M2004J19C), Including router preparation, installation of the necessary software and solving common errors such as mount: permission denied or no such device. We will consider two methods: using Termux (without root) and using Magisk (for advanced users). MIUI 12.5–14 Android 10–13.

What is NFS and why you need it on your smartphone

NFS (Network File System) is a network protocol developed by Sun Microsystems in 1984 for remote file access. Unlike SMB (used in Windows) or FTP, NFS is optimized for UNIX-like systems, making it ideal for Linux servers and Android devices. On Redmi 9, NFS allows:

  • πŸ“ Mount network folders as local drives (for example, for Kodi or for the Internet). VLC).
  • 🎬 Stream video 4K bufferless (NFS faster SMB 20–30% in local networks).
  • πŸ”„ Automate backups to NAS-server (e.g., Synology or QNAP).
  • πŸ–₯️ Work with files on the server as with local (without downloading).

Important: NFS does not encrypt traffic by default (unlike SFTP or WebDAV). For security, use it only on trusted LANs or configure NFS over TLS (requires additional core modules).

⚠️ Attention: Redmi 9 with firmware MIUI Global may not support the nfs.ko core module, in which case a custom core or Magisk is required.

Preparation: What will be needed to connect

Before setting up the NFS, make sure you have:

ComponentRequirementsNotes
SmartphoneXiaomi Redmi 9 (any modification)MIUI 12.5+ firmware or custom (e.g. LineageOS)
NFS-serverLinux/NAS with Exported FolderExamples: Synology DSM, OpenMediaVault, TrueNAS
Local area networkWi-Fi 5 GHz or Ethernet adapterNFS is sensitive to delays – avoid public networks
Access rightsRoot or Termux with prootWithout root, work is only possible in an isolated environment.

Also check:

  • πŸ”Œ Stable power supply of the smartphone (NFS-The installation will be interrupted when the battery is discharged).
  • πŸ“Ά Network speed is not lower than 100 Mbps (for 4K-streaming needs 300+ Mbit/s).
  • πŸ”’ Unplugged. VPN (It can block local traffic).
πŸ“Š What protocol do you use for network access?
SMB (Samba)
FTP
NFS
WebDAV
Other

Method 1: Connecting NFS over Termux (without root)

If you don't have superuser rights, you can use Termux, a Linux emulator for Android, which is suitable for temporary folder mounting, but has limitations:

  • πŸ”„ Files will only be available inside Termux.
  • πŸ“± Android apps (such as a gallery) will not see folders.
  • πŸ”Œ After restarting, the mounting will reset.

Adjustment steps:

  1. Install Termux from F-Droid (the version from Google Play is outdated).
  2. Update packages and install nfs-utils: pkg update && pkg upgrade -y pkg install nfs-utils proot -y
  3. Create a folder for mounting: mkdir ~/nfs_share
  4. Connect to NFS-server (replace) IP_SERVER AND/WAY/To/FAPK: mount -t nfs -o soft,udp,rsize=8192,wsize=8192 IP_SERVER:/path/to/folder ~/nfs_share ⚠️ Note: If the server requires authentication, add a setting -o sec=krb5 (Kerberos needs a).

To check the mounting, do:

ls ~/nfs_share

If you see files from the server, the connection is successful. To auto-mount when Termux starts, add a command to ~/.bashrc.

Installed by Termux from F-Droid|Updated packages (pkg update)|Installed nfs-utils and proot|A folder for mounting has been created|Executes mount command without errors-->

Method 2: Continuously mounting NFS with Magisk (for root)

If you have Magisk installed on your Redmi 9, you can configure the NFS at the system level.

  • πŸ“‚ See network folders in any file manager (e.g. MiXplorer).
  • πŸ”„ Automatically mount NFS loading.
  • 🎯 Use it. NFS in applications (for example, for storing Kodi data).

Instructions:

  1. Install the module. NFS For Android via Magisk: Download ZIP-module XDA Developers. Go to Magisk. β†’ Modules. β†’ Install it from storage. Select the downloaded file and restart the smartphone.
  2. Check the loading of the kernel module: lsmod | grep nfs Should appear nfs, nfsd, sunrpc.
  3. Create a folder to mount (e.g., in /storage/emulated/0/NFS): mkdir /storage/emulated/0/NFS
  4. Add the mounting line to /etc/fstab (Use MiXplorer with root access): IP_SERVER:/path/to/folder /storage/emulated/0/NFS nfs rw,soft,udp,rsize=8192,wsize=8192 0 0

For auto-mounting during loading:

  1. Install Tasker or create a script in /data/adb/post-fs-data.d/: #!/system/bin/sh mount -t nfs -o rw,soft,udp,rsize=8192,wsize=8192 IP_SERVER:/path/to/folder /storage/emulated/0/NFS

⚠️ Note: If the folder is not mounted after rebooting, check logcat logs | grep nfs. Frequent error - Stale file handle, which is solved by restarting the server NFS.

πŸ’‘

If NFS is slow, try changing the mount settings to tcp instead of udp and increasing the rsize/wsize to 32768.

Setting up NFS-server for Xiaomi Redmi 9

Before connecting from the smartphone, make sure that the server is properly configured. Consider setting up Ubuntu Server 22.04 and Synology DSM 7.

For Linux (Ubuntu/Debian)

Install packages and export the folder:

sudo apt install nfs-kernel-server -y


sudo nano /etc/exports

Add a line (replace) IP_TELEFONA):

/path/to/folder IP_TELEFON(rw,sync,no_subtree_check,no_root_squash)

Apply the changes:

sudo exportfs -a


sudo systemctl restart nfs-kernel-server

For Synology NAS

Go to: Control Panel β†’ Shared folder β†’ Select a folder. β†’ NFS-permitting.

Add a rule:

  • πŸ“Œ host: IP-Redmi address 9 or subnetwork (e.g, 192.168.1.0/24).
  • πŸ”“ Privileges: Reading/Write (rw).
  • πŸ”’ Root squash: Disable (no_root_squash).
  • πŸ”„ Asynchronous: Include to increase speed.

After setting up, restart the NFS service to the NAS.

How to check the export of folders on the server?
Run the command on the server: sudo showmount -e localhost Should display a list of exported permission folders. If the list is empty, check the syntax in /etc/exports and restart the NFS service.

Addressing common mistakes

When connecting NFS to Redmi 9, there may be errors, and let’s consider the most common and ways to fix them:

Mistake.Reason.Decision
mount: permission deniedIncorrect rights on the server or firewallCheck it out. /etc/exports Turn off the firewall: sudo ufw disable. Add a rule to the firewall: sudo ufw allow from IP_Telephone to any port nfs.
mount: no such deviceThere is no core module nfs.koInstall the module via Magisk (see Method 2). Check for NFS support in the kernel: zcat /proc/config.gz | grep NFS.
Stale file handleThe server has rebooted or changed the folder IDRemount folder: umount / path; mount / path. Reset. NFS-server: sudo systemctl restart nfs-server.
Protocol not supportedThe server requires NFSv4, and the client only supports v3.Explicitly state the protocol version: -o nfsvers=3.

If the error is not listed in the table, examine the kernel logs:

dmesg | grep nfs

Or server logs:

sudo tail -f /var/log/syslog | grep nfs

πŸ’‘

90% of NFS errors are due to server incorrect rights or the absence of a kernel module.Always start your diagnosis by checking /etc/exports and lsmod | grep nfs.

Optimizing NFS Speed with Redmi 9

By default. NFS It uses conservative data settings to increase speed (especially important for the use of a computer). 4K-video) change the mounting parameters:

  • πŸ“Ά Use tcp instead of udp for stability: -o proto=tcp
  • πŸ“¦ Package size: Increase rsize and wsize to 32768 (or 65536 for Gigabit networks): -o rsize=32768,wsize=32768
  • πŸ”„ Caching: Enable asynchronous recording: -o async
  • πŸ›‘οΈ Security: If you don’t need authentication, disable the rights check: -o noacl

Example of an optimized mounting command:

mount -t nfs -o proto=tcp,rsize=32768,wsize=32768,async,noacl,soft IP_SERVERAGE:/path/point/mounting

For speed testing, use:

dd if=/dev/zero of=/storage/emulated/0/NFS/testfile bs=1M count=100

Compare the result with a local record (for example, internal memory), the difference should not exceed 30%.

FAQ: Frequent questions about NFS on Xiaomi Redmi 9

❓ Can I connect? NFS rootless and Termux?
No, there is no NFS support in MIUI stock firmware. Alternatives: Use SMB (embedded support in MiXplorer). Set up WebDAV (works over HTTP/HTTPS). Install custom firmware with NFS support (e.g. LineageOS).
❓ Why? NFS works slower than SMB?
Possible reasons: rsize/wsize settings are not optimized (set 32768). udp is used instead of tcp. Server is overloaded (check htop on NAS). Encryption is enabled (turn off sec=krb5 if not necessary). Use iperf3 between phone and server for diagnostics.
❓ How to Automatically Mount NFS when connected to Wi-Fi?
Use Tasker or MacroDroid: Create a task with a Wi-Fi Connection trigger (specify your network). Add the "Execute command" action (su) -c "mount -t nfs..." Set the delay to 10 Seconds (so that the network can be initialized). /data/adb/service.d/ (root).
❓ Can I use it? NFS backup?
Yes, but with reservations: βœ… Suitable for incremental backup (e.g. via rsync). ❌ Not recommended for full images (e.g., through TWRP), so NFS It does not support file locking. Example of a photo backup command: rsync -avz /storage/emulated/0/DCIM/ /storage/emulated/0/NFS/backup/DCIM/
❓ Why After Updating MIUI NFS quit?
Reasons and Solutions: Reset Magisk: Reinstall the NFS for Android module. Kernel update: Check the module's compatibility with the new kernel version (uname -r). Lock MIUI: Disable MIUI Optimization in the Magisk settings. MIUI 14 added protection against /system modification, which can block modules from loading. Use Magisk Delta or go to custom firmware.