How to set up NFS on Xiaomi Mi 9C: from preparation to connection

The Network File System (NFS) allows you to turn your Xiaomi Mi 9C into a full-fledged client to access remote folders as if they were on a local device, which is especially useful for working with large files, backing up or organizing a media library without taking up the internal memory of the smartphone. However, standard MIUI firmware does not include NFS support out of the box - it needs to be activated manually.

In this article, we will discuss the entire process: from server preparation (on Linux, Windows or NAS) to fine-tuning the client with Xiaomi Mi 9C. Particular attention will be paid to the nuances of root access, alternative methods without root and solving common errors like β€œPermission denied” or β€œNo route to host.” If you have never worked with NFS, do not worry: the manual is adapted for beginners, with explanations of each step.

What is NFS and why is it needed for Xiaomi Mi 9C?

NFS is a file networking protocol developed by Sun Microsystems back in 1984 that allows remote directories to be mounted as local directories, which is convenient for:

  • 🎬 Streaming video without downloading to the device (for example, movies in the 4K s NAS).
  • πŸ“ Backup photos and documents directly to the network storage.
  • πŸ”„ Synchronize files between multiple devices (smartphone, PC, TV).
  • πŸ–₯️ Work with large projects (e.g., editing KineMaster videos with files on the server).

On the Xiaomi Mi 9C, NFS can be an alternative to SMB (which often slows down) or cloud services (where speed depends on the Internet channel), the main advantage is the minimum overhead for data transfer over the local network, which is critical for devices with limited resources.

However, there are limitations:

  • ⚠️ Without root access functionality NFS will be cut down (for example, auto-mounting is impossible when loading).
  • ⚠️ NFS Do not encrypt traffic by default (for security use) NFS over SSH or VPN).

πŸ“Š What do you want to use for? NFS Xiaomi Mi 9C?
Storage of media files
Backup
Documentation work
Another option

Requirements and preparation for setting up

Before you start, make sure you have:

ComponentMinimum requirementsRecommendations
Xiaomi Mi 9CMIUI 10+, Android 9+Update to the latest version of MIUI for stability
NFS-serverLinux (Ubuntu/Debian), Windows 10/11 with WSL, or NAS (Synology, QNAP)For beginners, it is easier to configure on Linux or ready-made solutions such as OpenMediaVault
Root accessOptional but expands opportunitiesUse Magisk to get root without the risk of "bricking"
Local area networkWi-Fi 5 GHz or Ethernet connection (via adapter)For stability, give preference to a wired connection

If you do not have a separate server, you can use:

  • πŸ–₯️ Old PC with Ubuntu Server (minimum requirements: 1 GB of RAM, 20 GB) HDD).
  • πŸ“¦ Ready. NAS-solution (e.g. Xiaomi Mi) NAS synology DS220+).
  • ☁️ Cloudy VPS (Oracle Cloud with a free rate, but it's less secure.

πŸ’‘

Before setting up, check the speed of the local network using the WiFi Analyzer app – NFS is sensitive to delays (ping above 50 ms can cause lags).

Setting up NFS-server (for example, Linux)

Consider installing a server on Ubuntu 22.04 LTS β€” The most universal option. If you have Windows, use it. WSL 2 with Ubuntu distribution, or set up NFS-Windows server via haneWIN NFS (paid NFS4J (Free, but less stable).

Open the terminal on the server and execute the commands:

# Installation of NFS packages


sudo apt update && sudo apt install nfs-kernel-server -y




Creating a directory for access (e.g. /mnt/nfs_share)



sudo mkdir -p /mnt/nfs_share




sudo chown nobody:nogroup /mnt/nfs_share




sudo chmod 777 /mnt/nfs_share # Temporary solution for the test (we will configure the rights more accurately later)




Editing the export file (/etc/exports)



sudo nano /etc/exports

Add a line to the file (replace 192.168.1.0/24 with your subnet):

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

Save the file (Ctrl+O, then Ctrl+X) and restart the server:

sudo exportfs -a


sudo systemctl restart nfs-kernel-server

Check that the folder is exported:

sudo exportfs -v
What do the parameters in /etc/exports mean?
rw – allows reading and writing (use ro for reading only). sync – synchronous writing (without data loss in case of failure). no_subtree_check β€” Disables subtree inspection (accelerates work). no_root_squash β€” allows the root user on the client to have root rights on the server (not secure for public networks!).

Setting up NFS-client on Xiaomi Mi 9C

There are two ways to do this: root and no root. Let's look at both.

Method 1: No root (limited functionality)

Install from Google Play app NFS Manager (from the developer of Sparks) It allows you to mount NFS-balls without rue, but with limitations:

  • πŸ”„ Manual mounting only (no automatic connection when downloading).
  • πŸ“ Access only to selected applications (e.g, VLC or FX File Explorer).
  • ⚠️ The speed of operation is lower than with native mounting.

Instructions:

  1. Open NFS Manager and press + to add a new server.
  2. Enter. IP servers (e.g., servers, 192.168.1.100) and the path to the file (/mnt/nfs_share).
  3. Select NFS v3 (v4 may not work without additional settings).
  4. Press Mount and confirm access.

Method 2: With root access (full functionality)

If you have root, use the Termux or ADB terminal:

su


mkdir /mnt/nfs




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

To mount automatically when booting, add a line to /etc/fstab:

192.168.1.100:/mnt/nfs_share /mnt/nfs nfs rw,soft,intr,rsize=8192,wsize=8192 0 0

Make sure that the /mnt/nfs folder exists.

Run mount | grep nfs – your ball should be displayed

Try to create a test file: touch /mnt/nfs/testfile

Check the availability of the file on the server

-->

Solving typical mistakes

When setting up NFS on Xiaomi Mi 9C, the following problems most often arise:

Mistake.Reason.Decision
mount: Permission deniedIncorrect server rights or firewall block port 2049Check /etc/exports and turn off firewall: sudo ufw disable
No route to hostThe server is not available over the network (incorrect IP or subnet)Check ping to server and routing settings
Stale file handleThe server is restarted and the client is trying to use the old descriptors.Remount the ball: umount /mnt/nfs &&mount /mnt/nfs
Slow workSmall packet size (rsize/wsize) or network congestionIncrease the size to 32,768 and check the load on the router

⚠️ Note: If files are displayed after mounting but not opened, check the filename encoding. NFS It can be incorrectly working with Cyrillic. Solution: rename files to Cyrillic. UTF-8 or use a parameter -o nolock,vers=3 mounting.

For diagnostics, use the logs on the server:

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

Optimizing NFS Performance

By default, NFS can run slowly on the Xiaomi Mi 9C due to the limitations of the hardware.

  • πŸ”§ Increase the size of the read/write buffers in the mounting parameters: mount -o rsize=32768,wsize=32768
  • πŸ“Ά Connect to a 5 GHz Wi-Fi router or use a USB-Ethernet adapter (e.g., Xiaomi) USB-C to Ethernet).
  • πŸ”„ Disable atime (last access time) on the server by adding a /etc/fstab noatime.
  • πŸ›‘οΈ If you use NFS v4, Turn off idmapping (add) -o noidmap to avoid delays.

To test the speed, use the command:

dd if=/dev/zero of=/mnt/nfs/testfile bs=1M count=100

Compare the result with local memory – the difference should not exceed 30-40%.

πŸ’‘

For maximum speed, use a combination of mounting parameters: rw,soft,intr,rsize=32768,wsize=32768,noatime,nodiratime,vers=3.

How to protect NFS from unauthorized access

NFS does not encrypt traffic by default, so it is important to limit access to the server.

  • πŸ” Replace the line in /etc/exports safer: /mnt/nfs_share 192.168.1.105(ro,sync,no_subtree_check,root_squash) (where 192.168.1.105 β€” IP Your Xiaomi Mi 9C).
  • πŸ›‘οΈ Set up a firewall to allow connections only from trusted IP: sudo ufw allow from 192.168.1.105 to any port nfs
  • πŸ”‘ Use it. NFS over SSH (via sshfs) or VPN (WireGuard, for example, if access is required from an external network.
  • πŸ“‘ Turn off folder export to the Internet: in the router, close port 2049 for external connections.

⚠️ Note: Never use the parameter. no_root_squash In public networks, this allows anyone with root access on the client to have full control of your server. In the home network, the risk is lower, but it is better to limit the rights with the chmod command. 755 exportable.

FAQ: Frequent questions about NFS on Xiaomi Mi 9C

Can I use NFS to stream 4K video?
Yes, but with reservations: πŸ“Ά Wi-Fi speed should be at least as fast as possible. 300 Mbit/s (standard) 802.11ac). πŸ–₯️ The server must transmit data at a speed of at least 50 MB/s (check it out) HDD/SSD load). πŸ“± On Xiaomi Mi. 9C use the player VLC or MX Player with support for network protocols. For stability, it is better to use a wired connection via a USB-Ethernet adapter.
Why After Rebooting Your Smartphone NFS-The ball does not automatically connect?
It's a typical root-free problem. Solutions: πŸ”„ Use Tasker. + Termux for Automatically Executing a mount Command After Downloading. πŸ“± Install. NFS Manager and enable the option "Auto-mount on boot" (does not work on all firmware). πŸ”§ With root, add a line to /etc/fstab (On some firmware, as described above. MIUI can reset the mounting due to security policy - in this case, only the root will help.
How to transfer photos from Xiaomi Mi 9C to NFS automatically?
Use the FolderSync app: Create a pair to sync between /DCIM/Camera and /mnt/nfs/Photos. Select the "One way" sync type. Set up a schedule (e.g. every 2 hours or when connecting to Wi-Fi). Enable the "Delete source files after sync" option if you want to free up space on your phone. Alternative is Syncthing, but it requires more resources.
Can I use NFS to back up SMS and contacts?
No, you can't, but you can: πŸ“± Export SMS through SMS Backup & Restore in the file NFS. πŸ“ž Sync contacts with Google Account and then copy contacts.vcf to the server. πŸ”§ With root, backup folder. /data/data/com.android.providers.contacts Use the system for a full backup. TWRP + adb pull on NFS-ball-ball.
NFS or SMB – Which is better for Xiaomi Mi 9C?
The choice depends on the task: Criterion NFS SMB (Samba) Speed βœ… Higher (less overheads) ❌ Below (because of the protocol) SMB) Easy setup ❌ More difficult (requires manual commands) βœ… Easier (eat) GUI Windows support in MIUI ❌ No built-in (root or third-party apps needed) βœ… There is in the "Conductor" by default Security ❌ No encryption (need to be configured further) βœ… Supports SMB 3.0+ encrypted output: NFS It wins in speed, but loses in convenience.For home use with Xiaomi Mi 9C optimally SMB, If you do not need maximum transmission speeds.