How to set up NFS Xiaomi Redmi Note 8 Pro: from server to connection

Network file system NFS (Network File System allows you to turn your Xiaomi Redmi Note 8 Pro into a full-fledged client for working with remote directories - whether it is home. NAS, A Linux server or even some other Android device that supports the protocol, unlike the traditional cloud storage like Google Drive, NFS It offers direct access to files over a local network without synchronization and data limitations, and is ideal for a library, backup, or large file environment (e.g., video in a video format). 4K).

However, the setup NFS Android is not a trivial task. Xiaomi smartphones are based on MIUI They don't have built-in protocol support, so you'll have to use third-party tools and manual configurations. In this guide, we'll look at two scenarios: connecting to an existing one. NFS-server (for example, on a router or PC) and organize the server directly on the Redmi Note 8 Pro using Termux.

What is NFS and why you need it on your smartphone

Protocol NFS (Network File System was developed by Sun Microsystems in 1984, but it is still one of the most efficient ways to share files on local networks. SMB (which is often used in Windows, or FTP, NFS optimized for Unix-like systems and provides:

  • ๐Ÿ“ Transparent access to remote folders as if they are on a local device.
  • โšก Minimum overhead โ€“ transfer speed is limited only by network bandwidth.
  • ๐Ÿ”’ Flexible access rights (through the UID/GID), What is important for multi-user systems.
  • ๐Ÿ–ฅ๏ธ Support for large files (up to 8 EB in) NFSv4) Long names (up to 255 characters).

Xiaomi Redmi Note 8 Pro NFS may be useful:

  • ๐ŸŽฌ Streaming video from NAS without prior download (ideal for Kodi or VLC).
  • ๐Ÿ“ฑ Backup of photos and documents to the server in automatic mode.
  • ๐Ÿ’ป Development โ€“ if you use your smartphone as a terminal for working with remote projects.
  • ๐ŸŽฎ Storage of game files (e.g. emulators or modified game files) APK).

It is important to understand that NFS It does not encrypt traffic by default (unlike the default traffic code). SFTP If your network is not secure, the data can be intercepted. NFS top-up VPN or in an isolated local area network.

๐Ÿ“Š What do you want to use for? NFS smartphone?
Media library storage
Backup
Development/programming
Games/emulators
Other

Requirements and preparation of the device

Before you start setting up, make sure your Redmi Note 8 Pro and network meet the minimum requirements:

ComponentRequirementsNotes
Android version9.0 Pie and higherNana MIUI 12+ Additional permissions may be required for Termux.
Root rightsNot required, but they make it easier to set up.Without root, you will need to use workarounds (for example, Termux with proot).
NetworkWi-Fi 5 (802.11ac) or Ethernet through OTGNFS Sensitive to delays โ€“ avoid congested networks.
NFS-serverAny (Linux, Windows with) NFS-server, router)For tests, you can deploy the server to a PC with Ubuntu or Docker.
Free seat100+ MB on the deviceYou need to install Termux, BusyBox and client utilities.

If you are planning to connect to an existing NFS-server, you'll need:

  • ๐Ÿ“Œ IP-server address (e.g. 192.168.1.100).
  • ๐Ÿ“‚ Exportable path (e.g, /mnt/nfs_share).
  • ๐Ÿ” Access rights (UID/GID Your user on the server).

โš ๏ธ Attention: On some firmware MIUI (especially global) access to mount system calls can be blocked, in which case only unlocking the bootloader and installing the custom core will help.

To organize the server directly on the smartphone will require:

  • ๐Ÿง Termux (from F-Droid, not Google Play!).
  • ๐Ÿ“ฆ BusyBox and nfs-utils (installed via Termux).
  • ๐Ÿ”Œ Static IP smartphone-on-local network.

๐Ÿ’ก

Before starting work, disable battery optimization for Termux in Android settings (Settings) โ†’ Annexes โ†’ Termux โ†’ Battery โ†’ No restrictions. This will prevent the interruption of sessions with long work.

Termux installation and environment preparation

Termux is a Linux terminal emulator for Android that will allow us to install the necessary packages to work with. NFS. It is important to use the F-Droid version as the Google Play version is outdated and does not support many commands.

Installation steps:

  1. Download and install Termux from the official F-Droid repository.
  2. Run Termux and run the packet update command: pkg update & pkg upgrade -y
  3. Install BusyBox and proot (the latter is needed to emulate root access without real root): pkg install busybox proot -y
  4. Install utilities to work with NFS: pkg install nfs-utils -y

If you see an Unable to install error at some point, try clearing the Termux cache:

pkg clean


rm -rf /data/data/com.termux/files/usr/var/cache/apt

After installation, check the availability of commands:

which mount.nfs


which showmount

Both commands must return paths to binary options (e.g, /data/data/com.termux/files/usr/bin/mount.nfs).

โš ๏ธ Note: On some devices, Xiaomi Termux may not have access to the /dev In this case, only root rights or alternative methods (e.g., chroot in user space) will help).

โ˜‘๏ธ Preparation of Termux for NFS

Done: 0 / 6

Connection to existing NFS-server

If you already have NFS-A server (e.g., on a router with OpenWRT or a home PC with Ubuntu) can be connected to it from a smartphone in a few steps.

Step 1. Create a mounting point

In Termux, do:

mkdir ~/nfs_share

This folder will be used to access the server files.

Step 2: Find out the export parameters on the server

On the server (if you have access to it) do:

sudo exportfs -v

You'll see a list of exported directories and allowed hosts, for example:

/mnt/nfs_share  192.168.1.0/24(rw,sync,no_subtree_check)

This means that the catalogue /mnt/nfs_share Available for recording (rw) to all devices on the subnet 192.168.1.0/24.

Step 3: Catalogue mounting

In Termux, run the mount command (replace). IP and the way):

mount -t nfs -o soft,intr,rsize=8192,wsize=8192 192.168.1.100:/mnt/nfs_share ~/nfs_share

Parameters:

  • soft โ€“ breaks the connection when the server freezes (useful for mobile networks).
  • intr โ€“ allows you to interrupt operations (for example, when unmounting).
  • rsize/wsize=8192 โ€” Read/write block size (optimizes speed).

If the installation is successful, check the contents of the folder:

ls ~/nfs_share

Step 4: Automatic mounting at start-up

To avoid entering a command every time, add it to the file. ~/.bashrc:

echo 'mount -t nfs -o soft,intr,rsize=8192,wsize=8192 192.168.1.100:/mnt/nfs_share ~/nfs_share' >> ~/.bashrc

The directory will be automatically mounted when Termux is launched.

What to do if the installation is suspended?
If the mount command is getting stuck, press Ctrl.+C and try adding the timeo option=10 (timeout in a tenth of a second. -t nfs -o soft,intr,timeo=10 192.168.1.100:/mnt/nfs_share ~/nfs_share If this doesnโ€™t work, check if the firewall on the server is blocking ports. 2049/tcp and 2049/udp.

Setting up NFS-servers on Xiaomi Redmi Note 8 Pro

If you need to turn around NFS-The server is directly on your smartphone (for example, to share files with other devices), this is also possible - but with reservations. unfs3 โ€” user-implementation NFS-A server that does not require root rights.

Step 1 Installation unfs3

In Termux, do:

pkg install unfs3 -y

Step 2: Creation of an exportable catalogue

Select the folder you want to make available over the network, for example:

mkdir ~/shared_folder


echo "Test file" > ~/shared_folder/test.txt

Step 3: Start the server

Follow the command (replace the path with your own):

unfsd -e ~/shared_folder -p 2049

Parameters:

  • -e โ€” catalogue.
  • -p โ€” port (default) 2049).

Step 4: Customization of customers

Now other devices on your network can connect to the NFS-For example, on a Linux machine, do it:

mount -t nfs -o nolock,soft 192.168.1.200:/shared_folder /mnt/nfs_client

Where 192.168.1.200 โ€” IP Your Redmi Note 8 Pro.

โš ๏ธ Attention: Server unfs3 Termux only works while the terminal window is open. To keep it running in the background, use tmux or screen: pkg install tmux -y tmux new -s nfs_server unfsd -e ~/shared_folder -p 2049 Press Ctrl.+B, then D to detach from the

Step 5: Optionally: Password Protection

By default. unfs3 It doesn't support authentication:

  • ๐Ÿ”’ Restrict access to IP router-setting.
  • ๐ŸŒ Use it. VPN Connecting from outside the local network.
  • ๐Ÿ”„ Change your exported catalog regularly (for example, through cron to Termux).

๐Ÿ’ก

server NFS It's only suitable for temporary file sharing on a smartphone, and it's best to deploy it on a desktop PC or for permanent use. NAS โ€” It's safer and faster.

Optimizing speed and eliminating errors

NFS It can run slowly on Android due to network limitations or incorrect settings. Here's how to speed up data transfer and fix common bugs:

Acceleration of transmission

  • ๐Ÿ“ถ Use 5 GHz Wi-Fi โ€“ itโ€™s less congested and provides more bandwidth.
  • ๐Ÿ”ง Increase the block size to rsize=32768,wsize=32768 (if the network is stable).
  • ๐Ÿ”„ Turn off power saving for Wi-Fi in Android settings.
  • ๐Ÿ“ก Connect to Ethernet via USB-OTG adapter (if the router supports).

Common mistakes and decisions

Mistake.Reason.Decision
mount: permission deniedNot enough rights on the server or client.Check the export on the server and UID On the client, try the mount. -o nolock.
server not respondingThe server is unavailable or blocks requests.Check the firewall (ufw status on the server) and ping to the device.
Protocol not supportedAn outdated version NFS (for example, v2 instead v3/v4).Update the server or specify the version explicitly: mount -o nfsvers=3.
Input/output errorProblems with the network or disk on the server.Check the dmesg on the server and the stability of the connection.

If you see a mount error: /dev/block/vold: No such file or directory, this means that Termux cannot access system calls:

  • ๐Ÿ”“ Get root rights and mount in /data/local/nfs.
  • ๐Ÿ“ฑ Use alternative clients (for example, NFS Manager from Google Play).
  • ๐Ÿง Go to custom firmware (like LineageOS) where the restrictions are minimal.

๐Ÿ’ก

To diagnose problems, use the strace mount command. -t nfs... in Termux. It will show the system calls and the point where the crash occurs.

Alternative ways to connect network disks

If setting up NFS seems too complicated, consider alternative protocols for accessing network folders:

  • ๐Ÿ“ SMB (Samba โ€“ standard for Windows, supported by many Android applications (e.g., Windows, FX File Explorer or Solid Explorer).
  • ๐ŸŒ WebDAV works through HTTP/HTTPS, It is easy to configure on any web server (Apache, Nginx).
  • ๐Ÿ”— SSHFS โ€” mounting a remote file system SSH (It requires Termux and sshfs).
  • โ˜๏ธ OwnCloud/Nextcloud โ€” Self-hosting cloud with a mobile client.

Comparison of protocols:

ProtocolSpeed.SecurityDifficulty setting up
NFSโญโญโญโญโญโญโญ (codeless)โญโญโญโญ
SMBโญโญโญโญโญโญโญ (support)โญโญ
SSHFSโญโญโญโญโญโญโญโญ (default-encryption)โญโญโญ
WebDAVโญโญโญโญโญโญ (HTTPS)โญโญ

For most users SMB It's easier to set up and has good support in Android, but if you want top speed (for example, for streaming video) 4K), NFS It's the best option.

FAQ: Frequent questions about NFS on Xiaomi

Can I connect? NFS Termux?
Yes, but with limitations. There are apps on Google Play that are like, NFS Manager, but they require root rights to mount. Without root, you can only view files through the application's built-in browser, but not mount them as a local folder.
Why After Rebooting Your Smartphone NFS-folder disappears?
This is because mounting in Termux is not saved between sessions.To fix: Add mount command to ~/.bashrc (as described above) or use tmux/screen For background execution, unfsd. On rooted devices, you can add a script to /data/local/userinit.sh.
How to connect to NFS-server on Xiaomi from another Android device?
Install Termux on the second device and repeat the mounting steps, specifying IP your Redmi Note 8 Pro as a server. -t nfs -o soft 192.168.1.200:/shared_folder /sdcard/nfs_client Make sure that the server (your Redmi) is running unfsd and allowed to access the network.
NFS It works slowly, how to speed up?
Try the following settings: Increase the block size: rsize=32768,wsize=32768. Turn off the subtree check on the server: no_subtree_check. Use a wired connection (Ethernet via a wired connection) OTG). On the server, disable atime for the exported folder: mount -o remount, noatime /path/to/folder.
Can I use it? NFS photobackup?
Technically, yes, but it's not the most reliable way. You can use Syncthing, without the cloud, rsync in Termux, for incremental backup, Nextcloud, if you want file version and encryption. NFS Suitable for manual copying, but has no mechanisms to track changes or restore deleted files.