NFS Xiaomi Redmi 9 Pro: full instructions for setting up a network disk

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).

πŸ“Š What are you setting up for? NFS smartphone?
Backup
Sharing files between devices
Working with the media library
Testing/training
Other

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:

  1. Install Termux from F-Droid (the Play Market version doesn’t support all commands).
  2. Update: pkg update & pkg upgrade -y
  3. Install nfs-utils and dependencies: pkg install nfs-utils proot-distro -y
  4. 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/NFS

Where 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:

  1. Unlock the bootloader through the Mi Unlock Tool.
  2. Install custom recovery (TWRP) Get root via Magisk.
  3. 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/NFS

Important:

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?
folder NFS It's not going to be automatically mounted, but it's going to be possible to manually connect through Termux.

⚠️ 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:

  1. Install packs: opkg update opkg install nfs-kernel-server nfs-utils
  2. Edit it. /etc/exports, line: /mnt/sda1 *(rw,sync,no_subtree_check,no_root_squash)
  3. Re-launch the service: /etc/init.d/rpcbind restart /etc/init.d/nfsd restart

For Linux (Ubuntu/Debian):

  1. Install packages: sudo apt install nfs-kernel-server
  2. Add the exported folder to /etc/exports: /home/user/nfs_share 192.168.1.0/24(rw,sync,no_subtree_check)
  3. Apply the changes: sudo exportfs -a sudo systemctl restart nfs-kernel-server

Parameter in /etc/exportsDescriptionRecommendation for Redmi 9 Pro
rwAllows reading and writingOf course, otherwise you won’t be able to save files.
syncSynchronous recording (data is written directly to the disk)Turn it on for reliability, but speed is lower
no_root_squashRetains root rights for the clientOnly if there is root on the smartphone!
no_subtree_checkDisables 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/NFS

Server 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 deniedThe server does not allow connection to IP smartphoneCheck it out. /etc/exports and exportfs -r
    rpcbind: server localhost not respondingRpcbind service is not running on the serversudo systemctl restart rpcbind
    mount: operation not permittedSELinux blocks mounting (relevant to root)Temporarily translate SELinux to permissive or customize context
    Stale file handleThe 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.

    FAQ: Answers to Frequent Questions

    Can I connect? NFS Redmi 9 Pro without root and Termux?
    No, standard firmware. MIUI supportive NFS. Alternatives: πŸ“ Use it. SMB (via FX File Explorer or Solid Explorer). ☁️ Set up WebDAV (for example, via Nextcloud on the server). πŸ”— Connect to the SSHFS (Demands Termux, but is easier to set up).
    Why after the reboot NFS It does not automatically connect?
    Causes and solutions: πŸ”Œ No root: Termux does not start automatically. Use Tasker or MacroDroid to execute the mount command when connecting to Wi-Fi. πŸ”§ Root: Check the rights to the script in /data/adb/post-fs-data.d/ (chmod 755). ⏱️ Network delay: Add sleep 30 At the beginning of the script to wait for Wi-Fi connection.
    How to check the speed NFS Redmi 9 Pro?
    Install dd in Termux and run the test: dd if=/dev/zero of=/sdcard/NFS/testfile bs=1M count=100 dd if=/sdcard/NFS/testfile of=/dev/null bs=1M One team tests the recording, the other one tests the reading. Normal values for a gigabit network: 30-50 MB/s if speed is lower 10 MB/s, check the settings rsize/wsize loading CPU server-side.
    Can I use it? NFS storage of photos and videos?
    Technically yes, but there are nuances: πŸ“Έ gallery MIUI won't see the files NFS (They are not indexed by MediaProvider). πŸŽ₯ Use the video to watch it. VLC or MX Player (they can work with network folders). πŸ”„ Automatic uploading of photos in NFS It can be done through FolderSync or Syncthing, and it's better to combine it for a library. NFS with Plex or Jellyfin (install the server on a PC and the client on a smartphone).
    NFS vs SMB vs SSHFS: What's faster than Redmi 9 Pro?
    Comparison of protocols based on Snapdragon tests 720G (Gigabit network, server on SSD): Protocol Read Speed Write Speed Reliability Setup complexity NFS (UDP) 45-50 MB/s 30-35 MB/s Medium (sensitive to cliffs) High SMB (Samba) 25-30 MB/s 20-25 MB/s High Low SSHFS 15-20 MB/s 10-15 MB/s High (encryption) Average Output: NFS faster, but requires a stable network. SMB or SSHFS.