Network storage by protocol NFS (Network File System allows you to turn your Xiaomi smartphone into a full-fledged client for working with remote folders - whether it is a smartphone. NAS-server, home PC or cloud. But what if you have a Sberbank-branded SberPay on your device that limits some system functions? NFS-Xiaomi client with SberPay firmware, and optimize the work with network disks.
It's important to understand that SberPay is not just a shell, it's a modified firmware with its own security rules. NFS (through mount or applications like NFS Managers may not work due to root permissions and kernel level restrictions, but there are workarounds ranging from manually mounted Termux to dedicated kernel-level controls. ADB-We'll look at all the relevant ways, including solutions for MIUI 14 and MIUI 15.
Before you start, make sure your Xiaomi meets the minimum requirements:
- π± Version. MIUI: 14.0.5+ or 15.0.1+ (Check in the settings β The phone).
- π Network connection: Wi-Fi 5/6 (NFS delay-sensitive, 4G not recommended).
- π Unlocked bootloader: Some methods require fastboot oem unlock.
- π οΈ ADB-Access: Enable Debugging by USB In Settings β For developers.
1. Xiaomi Preparation for NFS: Unlocking and ADB
The first step is to prepare the device. SberPay's firmware blocks many system functions, so you can't get NFS on without first manipulating it, starting with unlocking the bootloader (if it's locked) and setting up the ADB.
To unlock the loader:
- Go to the Mi Unlock website and download the Mi Unlock Tool.
- Link your Mi Account to your device in Settings β Xiaomi Account.
- Launch your phone in Fastboot mode (hold Power + Volume down when turned on).
- Connect the device to your PC and follow the instructions in the Mi Unlock Tool.
After unlocking, turn on debugging via USB:
- Go to Settings β About Phone and tap 7 times on the MIUI version to activate the developer menu.
- Back to Settings β Additionally. β For developers.
- Activate Debugging over USB and Allow OEM unlocking.
β οΈ Attention: Unlocking the bootloader will reset all data on the device! make a backup through Settings β System system β Backup.
βοΈ Preparation for setup NFS
2. Installation of necessary tools: Termux and BusyBox
Since SberPay limits installation of system applications, the main tool for working with NFS is Termux (the Android terminal).
Installation instructions:
- Download Termux from F-Droid.
- Open the application and execute commands: pkg update & pkg upgrade pkg install root-repo pkg install busybox proot-distro
- Install Ubuntu distribution for full-featured work with NFS: proot-distro install ubuntu proot-distro login ubuntu
After entering the Ubuntu environment, install NFS packages:
apt update
apt install nfs-commonIf you have an E: Unable to locate package, add a repository:
echo "deb http://archive.ubuntu.com/ubuntu focal main" >> /etc/apt/sources.listπ‘
If Termux doesnβt start after installation, try disabling MIUI Optimization in the developer settings (Settings β Developer β Disable MIUI optimization).
3.Tune in. NFS-servers: requirements and configuration
Before connecting to NFS-Make sure the server is properly configured. NAS (for example, Synology or QNAP) Linux PC with running nfs server.
Minimum requirements for the server:
- π₯οΈ OS: Linux (Ubuntu/Debian) or NAS supportive NFSv3/v4.
- π‘ Network: Static IP-address (set up in router) DHCP-reservation).
- π Export: The folder must be exported with read/write rights.
Example of /etc/exports configuration on the server:
/mnt/nfs_share 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)After editing, restart the service:
sudo exportfs -a
sudo systemctl restart nfs-kernel-server| NFS parameter | Meaning | Description |
|---|---|---|
| rw | Reading/writing | Allows you to change files |
| sync | Synchronous recording | Guarantees the safety of data |
| no_root_squash | Root rights | Allows root access from the client |
| no_subtree_check | Disabling the verification | Accelerates work with nested folders |
β οΈ Attention: Parameter no_root_squash It's not safe, you can only use it on trusted networks.
4. NFS Connection to Xiaomi via Termux
Now, to the mounting process itself, in Termux, do the following:
1. Create a mounting point:
mkdir ~/nfs_mount2. Connect. NFS-resource (replace) IP and the way):
mount -t nfs 192.168.1.100:/mnt/nfs_share ~/nfs_mount -o rw,soft,timeo=3,retrans=2Mounting parameters:
- π soft β breaks the connection in case of errors (useful for mobile networks).
- β±οΈ timeo=3 β server response timeout (reduces delays).
- π retrans=2 - Number of repeated attempts.
If the installation is successful, check the contents:
ls ~/nfs_mountWhat to do if mount gives an error "Permission denied"
5. Automatic NFS connection when booting
To avoid mounting after each restart, set up automatic mounting via Termux:Boot:
1. Install the plugin:
pkg install termux-boot2. Create a script in ~/.termux/boot/:
mkdir -p ~/.termux/boot
echo 'mount -t nfs 192.168.1.100:/mnt/nfs_share ~/nfs_mount -o rw,soft,timeo=3,retrans=2' > ~/.termux/boot/nfs_mount.sh
chmod +x ~/.termux/boot/nfs_mount.sh3. Allow auto-start Termux:
- Open Settings β Applications β Termux β Autorun.
- Enable the option to Allow Auto Start.
β οΈ Note: When updating Termux scripts in ~/.termux/boot/ They may be reset. It's recommended to back them up.
π‘
Automatic mounting via Termux:Boot only works if the Termux application has not been forcibly stopped by the system. For reliability, add it to battery optimization exceptions (Settings β Battery β Battery Optimization β All applications β Termux β No restrictions).
6. Solving Common NFS Errors on Xiaomi
Even with the right setup, there can be problems, and let's look at the typical errors and their solutions.
| Mistake. | Reason. | Decision |
|---|---|---|
| mount: Operation not permitted | No root or SberPay blocking rights | Use proot or ADB with superuser rights |
| NFS server not responding | Problems with the network or firewall | Check ping to server, disable firewall on router |
| Stale file handle | The server restarted or changed the export | Remove the resource (umount & & mount) |
| Permission denied (13) | Incorrect rights on the server | Check /etc/exports and chmod 777 on the folder |
If the error is related to SberPay, try to bypass the restrictions through ADB:
adb shell
su
mount -o remount,rw /system
echo "192.168.1.100:/mnt/nfs_share /data/nfs nfs rw,soft 0 0" >> /etc/fstabImportant: Changing /etc/fstab without root rights can make it impossible to boot the system!
7. Optimizing speed and safety of NFS
NFS is sensitive to network delays, so it is recommended to:
- πΆ Use Wi-Fi 6: Reduces ping and increases bandwidth.
- π Encrypt traffic: Set up your traffic NFS over TLS or VPN (For example, WireGuard).
- β‘ Disconnect energy saving: In Settings β Battery Add Termux to Exceptions.
- π Cache data: Mount with the rsize option=8192,wsize=8192 to increase the buffer.
Example of an optimized mounting command:
mount -t nfs 192.168.1.100:/mnt/nfs_share ~/nfs_mount -o rw,soft,timeo=3,retrans=2,rsize=8192,wsize=8192,noatimeTo check the speed, use dd:
dd if=/dev/zero of=~/nfs_mount/testfile bs=1M count=100
Record: 100 MB file
dd if=~/nfs_mount/testfile of=/dev/null bs=1M
Reading: speed in MB/sπ‘
If the read/write speed is below 10 MB/s, check the server load and the quality of the Wi-Fi signal. Use ping 192.168.1.100 and iptraf-ng in Termux for diagnostics.