Protocol NFS (Network File System is a standard way of sharing files between devices on a local network, which is widely used on servers and computers. NFS-And the answer is yes, but with reservations. Unlike Windows or Linux, where you can see it. NFS It is supported on the OS level, on Android (and accordingly on the MIUI) It's not built out of the box, but there are workarounds, from third-party apps to manually mounting through Termux.
In this article, we will discuss how it works. NFS Xiaomi phones, what restrictions impose MIUI 14/15, We provide step-by-step instructions for different scenarios β from simple connection to NAS We'll focus on security, why is it open? NFS-A server on a home network can be a breach for hackers, and how to avoid it.
If you've never worked with network protocols, don't worry, we'll explain it in plain language, and for experienced users, we've prepared advanced tips, such as how to automate mounting. NFS When connecting to Wi-Fi or bypassing restrictions MIUI system folder.
What is it? NFS And why is he better? SMB Xiaomi?
NFS (Network File System is a protocol developed by Sun Microsystems in 1984 for remote access to files. SMB (which is more commonly used in Windows), NFS It's optimized for Unix-like systems, including Linux and Android. NFS for Xiaomi owners:
- π Higher speed when working with large files (e.g. video) 4K backup).
- π Flexible access rights through UID/GID, What is important for multi-user systems.
- π± Better compatibility with Linux servers (for example, if you have a Linux server) NAS OpenMediaVault or TrueNAS).
- π Support for symbolic links, which is useful for developers.
But NFS First, it doesn't encrypt traffic by default (unlike the default one). SMB 3.0+), Therefore, to transfer confidential data will have to configure VPN or SSH-Second, there's no built-in support for Android. NFS β You will have to use third-party solutions.
For comparison, SMB (For example, through the Mi File Manager app, it's easier to set up, but it can slow down when you're working with thousands of small files β NFS It will be the best choice.
π‘
If your router supports IPv6, tune in NFS This will improve security because most attacks are aimed at IPv4.
Limitations MIUI: why NFS It doesn't work out of the box"
Operating system MIUI (even in the latest versions 14/15) does not include built-in support NFS for several reasons:
- π Google security policy: Starting with Android 10, system folders are restricted, and network drive mounting requires root rights.
- π± Optimization for the mass user: most smartphone owners do not need NFS, Xiaomi does not add this feature to the standard File Manager.
- π Energy Conservation Conflicts: Constant Connection to NFS-The server drains the battery, which is contrary to philosophy. MIUI.
Also, even if you use a third-party mounting app NFS (for example, NFS Manager), MIUI It can block background activity due to battery optimization, which means that after a few minutes of inactivity, communication with the network disk will be interrupted.
Important: On Xiaomi phones with MediaTek processors (like Redmi Note 12 or more) POCO X5) There may be problems with the Linux kernel, which may cause NFS-Customers are not working smoothly. Check your device model before setting up.
How to find out the processor of your Xiaomi?
Connection methods NFS Xiaomi: From Simple to Complex
There are three main methods of connection. NFS Xiaomi smartphone, each of which is suitable for different levels of training:
- Through a client application (for example, NFS Total Commander or Manager is the easiest way to do this without rooting.
- Through Termux β for advanced users who are ready to work with the command line.
- Through Magisk and the kernel with support NFS β Maximum functionality, but requires unlocking the bootloader.
Letβs look at each option in detail, starting with the most accessible.
Method 1: Client applications (without root)
The easiest way is to use a file manager with support. NFS. For example, Total Commander or a specialized application NFS Manager, Step-by-step instructions:
Install Total Commander from Google Play|Open the side menu. β Network environment β Add a network connection|Choose a type "NFS"|Indicate. IP-server address, folder path and mounting options (e.g. nolock,soft)|Save and connect.-->
Pay attention to the installation parameters:
- Ro is for reading only (read-only).
- rw is reading and writing.
- soft β if the server is not available, the application will not βhangβ.
- Tcp or udp is a transmission protocol (tcp is recommended).
The main disadvantage of this method is that there is no automatic connection, and every time you restart your phone or application, you will have to mount the disk again.
Method 2: Termux (for experienced users)
If you need more control, you can use Termux, a terminal emulator for Android, install it from F-Droid (the version from Google Play is outdated), and follow the commands:
pkg update && pkg upgrade
pkg install nfs-utils
mkdir ~/nfs_mount
mount -t nfs -o soft,udp 192.168.1.100:/path/to/folder ~/nfs_mountReplace. 192.168.1.100:/path/to/folder your address NFS-To unmount the disk, use the server:
umount ~/nfs_mountAttention! Termux doesn't automatically mount when you start. To fix this, create a script in the ~/.termux/boot/ mounted.
Method 3: Magisk and Custom Core (maximum functionality)
If you need a full-fledged integrated solution, you will need to get root rights through Magisk and install the module. NFS Kernel Server: This method allows:
- Mount NFS-disks.
- Set up an automatic connection when connecting to a specific Wi-Fi network.
- Use fstab for permanent mounting points.
Instructions:
- Unlock the bootloader on Xiaomi (this erases all data!).
- Install Magisk and module NFS Kernel Server.
- Edit it. /etc/fstab, line: 192.168.1.100:/path/to/folder /mnt/nfs nfs rw,soft,intr 0 0
- Reset the device.
β οΈ Warning: Unlocking the bootloader on Xiaomi voids the warranty and may lead to update issues MIUI. In addition, some banking applications (such as SberBank Online) refuse to work on rooted devices.
Setting up NFS-servers to work with Xiaomi
So that your Xiaomi smartphone can connect to the NFS-The server must be configured correctly. Consider the basic configuration using Ubuntu Server or NAS Linux-based.
Open the file. /etc/exports and add a line:
/path/to/shared/folder 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)Where:
- /path/to/shared/folder β The path to the folder you export.
- 192.168.1.0/24 β Subnet from which you are allowed to connect (replace with your own).
- rw - allow reading and writing.
- no_root_squash β Enable root access (unsafe for public networks!).
After editing, restart the service NFS:
sudo exportfs -a
sudo systemctl restart nfs-kernel-serverTo check the availability of the server from your phone, use the command in Termux:
showmount -e 192.168.1.100(substitute IP to your server address).
β οΈ Note: If your router is using DHCP, IP-The phone address may change. To avoid access problems, set up a static one. IP for the device in the control panel of the router or use the hostname instead IP configuration NFS.
Addressing common problems with NFS Xiaomi
Even with the right setup, you may encounter errors, and here are the most common ones and ways to fix them:
| Mistake. | Possible cause | Decision |
|---|---|---|
| mount: Operation not permitted | No root rights or SELinux blocks mounting. | Use Termux or get root through Magisk. For SELinux, run setenforce 0 (temporary solution). |
| Connection timed out | The server is unavailable or blocked by a firewall. | Check the ping to the server. Open the ports. 2049/tcp and 2049/udp router and server. |
| Permission denied | Incorrect access rights on the server or in the mounting parameters. | Check it out. /etc/exports Add the rw option to the server. Use mount on the client. -o rw. |
| NFS shuts down after sleep | MIUI Kills background processes to save battery. | Add the client app to battery optimization exceptions: Settings β Battery β Optimizing the battery β All applications β Choose a client. β No restrictions. |
If you use NFS If you run into Termux and you encounter a mount: bad address error, make sure that:
- IP-The server address is correctly specified (check via ping).
- The server is running rpcbind (port 111).
- You are using the correct version of the protocol (Nfsvers by default).=4, but some servers require nfsvers=3).
β οΈ Note: Some Xiaomi models (e.g. Xiaomi 13 Pro) have built-in firewall MIUI can block NFS-traffic even when you set it right. To fix it, temporarily turn off the firewall in Settings. β Memory. β Autoboot β Firewall (not recommended for permanent use!).
Security: How to Protect NFS Xiaomi from hacking
NFS It's not designed to run on insecure networks, but if you connect to a server through public Wi-Fi or even a home network with vulnerable devices, your data can be intercepted:
- π Use it. VPN: Set up WireGuard or OpenVPN on the server and connect to the server. NFS only through an encrypted tunnel.
- π Restrict access to IP: V /etc/exports Only give the trusted ones IP-addresses (e.g. addresses, 192.168.1.100(rw instead of *(rw)).
- π Disable unused versions NFS: V /etc/nfs.conf Just leave it. vers4 or vers3.
- π‘οΈ Set up firewall: Close ports 2049, 111 and 20048 for external connections.
For maximum safety, consider alternatives. NFS:
- SSHFS β mounting SFTP (coded automatically).
- WebDAV with HTTPS β Slower but safer for public networks.
- Syncthing is a decentralized synchronization without a central server.
Critical information: On Xiaomi phones with MIUI Global Some Applications for NFS (for example, NFS Managers can send data to servers in China. Check the app's permissions before installing and use NetGuard to block unnecessary connections.
Automation: How to Connect NFS wifi-entry
If you regularly connect to your home network, you can automate mounting. NFS. You'll need a Tasker or MacroDroid app to do this:
- Create a new macro with a trigger Wi-Fi connection (specify your network name).
- Add the action Execute the shell command:
- Add a delay of 5-10 seconds (to allow the network to be installed).
- Save the macro.
To unmount when disconnecting from Wi-Fi, create a second macro with the action:
su -c "umount /mnt/nfs"If you donβt have root, use Termux:Tasker to run commands over Termux without superuser rights.
β οΈ Warning: Automatic mounting can cause the phone to freeze if the server NFS Always add the soft option and set the timeout to the /etc/fstab (like timeo=14).
π‘
For a stable job. NFS Xiaomi is recommended to use a combination of Termux + Tasker with server availability check via ping before mounting.