Xiaomi Mi 8
Network File System (NFS)
Turning on NFS on the Mi 8 is not a beginnerβs task: it requires root rights, modification of system files and understanding of network protocols. But the result is worth the effort: file transfer speeds over the local network can exceed 100 MB / s (versus 10-30 MB / s for MTP), and access to files becomes as convenient as a regular network folder. In this guide, we will discuss two ways to activate NFS β through Magisk modules and manually, and consider typical errors and their solutions.
β οΈ Important: The procedure requires an unlocked bootloader and installed TWRP. If you have never worked with custom firmware, we recommend you first study our guides for unlocking Xiaomi Mi 8 and installing Magisk.Incorrect actions can lead to data loss or a βbrickβ of the device.
1.Device preparation: root, TWRP and compatibility check
Before setting up the NFS, make sure your Xiaomi Mi 8 meets the following requirements:
- π Bootloader unlocked. Without it, you can't get root rights.
- π οΈ Established custom recaveri TWRP (version 3.6.0 or later).
- π± Superuser rights via Magisk (version 24)+).
- πΆ Stable connection to the local network via Wi-Fi 5 GHz or Ethernet (via Wi-Fi) USB-OTG adapter).
If at least one of the conditions is not met, the NFS will not work. You can check the status of the bootloader unlock by the team in ADB:
fastboot oem device-infoSearch for Device unlocked: true. To check for root rights, install the Root Checker app from Google Play.
Method 2: Installation of NFS via Magisk Module (recommended)
The easiest and safest method is to use the ready-made NFS Server for Android module adapted for Magisk, which minimizes the risk of errors when manually editing system files.
Instructions:
- Download the NFS Server for Magisk module (check compatibility with your Android version).
- Open Magisk Manager, go to Modules β Install from storage.
- Select the downloaded.zip file and confirm the installation.
- Reset the device.
After the reboot, the NFS Server icon will appear in the application menu. Launch it and configure:
- π Please specify the folder for export (for example, /sdcard/Download).
- π Ask permissions (recommend rw,sync,no_subtree_check,no_root_squash).
- π Enable the Start on boot option to automatically start the server.
Installed Magisk 24+| NFS Server module activated in Magisk|Folder for export is specified correctly |Server launched (status "Running") |PC and smartphone in the same network-->
β οΈ Note: If after installation of the module NFS Do not start, check the logs in Magisk (Logins) β A common error is a conflict with other modules, such as BusyBox or KernelSU.
Method 2: Manual NFS setup (for power users)
If you prefer full control of the system, you can configure NFS manually, which requires editing system files and working with Terminal Emulator.
Steps:
- Install BusyBox via TWRP (if not already installed).
- Download binary files NFS-server ARM64: wget https://github.com/smartmonty/nfs-android/raw/master/nfsd-arm64 -O /system/bin/nfsd chmod 755 /system/bin/nfsd
- Create a configuration file /system/etc/exports: echo "/sdcard 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)" > /system/etc/exports Replace. 192.168.1.0/24 subnet.
- Start the server: nfsd start exportfs -a
To automatically start when downloading, add commands to /data/adb/post-fs-data.sh:
#!/system/bin/sh
/system/bin/nfsd start
/system/bin/exportfs -aβ οΈ Warning: Manual setup can break the system when there are errors in the export syntax.Always do backup /system If the device doesn't start after the reboot, restore the original boot.img via Fastboot.
What if NFS is not manually started?
4.Configure the connection from the PC (Windows/Linux/Mac)
After launch NFS-Xiaomi Mi 8 servers need to configure client connection on your computer.
For Windows 10/11:
- Open Control Panel β Programs β Enable or disable Windows components.
- Activate NFS Services β Client for NFS.
- In the Conductor, enter the address: \\192.168.1.100\sdcard Replace. IP to your smartphone address.
For Linux/Mac:
Use the mounting command:
sudo mount -t nfs 192.168.1.100:/sdcard /mnt/xiaomi -o nolock,softIf you have a mount.nfs: access denied by server error, check:
- π Correctness IP-Smartphone addresses (ifconfig on the device).
- π Rules in the file /system/etc/exports (subnet should match).
- π₯ Firewall settings on PC (allow incoming connections to port 2049).
1. Launch regedit.
2. Move to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters.
3. Create a DWORD RequireSecuritySignature with a value of 0.
4.Reboot the PC.-->
5. Optimizing NFS performance
By default, NFS on Android can run slower than expected. Here are the key options for tuning:
| Parameter | Recommended value | The effect |
|---|---|---|
| rsize | 32768 | Increases the size of the read block (accelerates the download of files) |
| wsize | 32768 | Increases the size of the recording block (accelerates copying to a smartphone) |
| timeo | 14 | Reduces timeouts with unstable connection |
| retrans | 2 | Reduces the number of repeat packet transfers |
| noatime | included | Disables access time recording (reduces the load on flash memory) |
Example of mounting command with optimization for Linux:
sudo mount -t nfs 192.168.1.100:/sdcard /mnt/xiaomi -o rsize=32768,wsize=32768,timeo=14,retrans=2,noatime,nolock,softFor permanent mounting, add a line to /etc/fstab:
192.168.1.100:/sdcard /mnt/xiaomi nfs rsize=32768,wsize=32768,timeo=14,noatime 0 0π‘
Nolock and soft are mandatory for Android clients, and without them, you can freeze when you break the connection.
Typical errors and their solutions
Even with the right NFS setup, there can be problems.
- π« Error "Permission denied" Reason: Incorrect permissions in /system/etc/exports Solution: Check the folder rights (chmod) 777 /sdcard) Turn off SELinux temporarily (setenforce) 0).
- π Impossible to connect to the server Cause: Port 2049 blocked NFS-Solution: Check the status of the server (ps) | grep nfsd) and firewall (iptables) -L).
- π’ Slow transfer speed Reason: Default settings or weak Wi-Fi connection are used. Solution: Apply optimized settings rsize/wsize and switch to 5 GHz Wi-Fi or Ethernet.
- π Server spontaneously shuts down Reason: Android kills background processes or no keepalive.Solution: Add nfsd to battery optimization exception list and use tcp_keepalive_time=60 kernel settings.
If the problem is not solved, study the kernel logs:
su
dmesg | grep nfs7. NFS Alternatives: When to Choose a Different Protocol
NFS is not the only way to organize network access to Xiaomi Mi 8 files. In some cases, it is better to use:
- π SMB (Samba) Pros: Easy to set up, better supported by Windows.Cons: Slower NFS on 20-30%, heavy-duty CPU.
- π SSHFS Pros: Encrypted connection, no root required. Cons: Speed limited by encryption (~50 MB/s).
- βοΈ WebDAV Pros: Works over the Internet, cross-platform. Cons: Lowest speed (~10 MB/s), complex setup.
- β‘ FTP/FTPS Pros: Supported by all OS. Cons: No file locking, encoding problems.
Transfer speed comparison (test on Xiaomi Mi 8 with Wi-Fi 5):
| Protocol | Reading speed (MB/s) | Recording speed (MB/s) | CPU load (%) |
|---|---|---|---|
| NFS (optimized) | 85-110 | 70-90 | 10-15 |
| SMB (Samba) | 50-60 | 40-50 | 25-30 |
| SSHFS | 45-55 | 35-45 | 40-50 |
| FTP | 30-40 | 25-35 | 20-25 |
π‘
NFS is ahead of the alternatives in speed and load, but requires root and customization skills, and SMBs are enough for simple tasks such as transferring photos.