Why you need NFS on a smartphone and why the Redmi Note 7 is right for it
Network File System (NFS) is a protocol that allows remote file systems to be mounted as local folders. On the Xiaomi Redmi Note 7 (codenamed lavender), this technology offers unique opportunities, from seamless access to home NAS to faster work with large files (for example, 4K video or projects in Termux).
The Redmi Note 7 is equipped with a Qualcomm Snapdragon 660 processor with support for kernel 4.4+, which is critical for the stable operation of the NFS- client. Moreover, an active development community has created custom cores (for example, Perseus or FrancoKernel), optimized for network operations. However, standard firmware MIUI blocks such functions - so you can not do without unlocking the boot and rooting.
In this article, we will discuss three key steps: 1 Device Preparation (unlock + TWRP), 2 Install firmware with support for NFS, 3) Client configuration and network folder mounting.
Warning: the process requires technical skills and can lead to loss of warranty. If you are a beginner, first practice on a less critical device.
Step 1: Unlock the bootloader and install TWRP
Without an unlocked bootloader, it is impossible to install custom recovery (TWRP) or firmware with NFS support. On the Redmi Note 7, this process is officially supported by Xiaomi, but has nuances.
First, check the blocking status:
- Turn off the phone and press Volume Down + Power to log into the Fastboot.
- Connect the device to the PC and execute the command: fastboot oem device-info
- If the answer is Device unlocked: false, the bootloader is blocked.
To unlock:
- Link your Mi Account to your device in Settings β Xiaomi Account β Mi Cloud.
- Download Mi Unlock Tool (version no lower than 5.5.224.30).
- Sign in to your account and follow the instructions. Attention: it takes 72-168 hours to connect your account to your device!
β οΈ Warning: Once unlocked, all data (including internal memory) will be reset. Backup via Settings β Additional β Backup and Reset.
Install TWRP for Redmi Note 7:
- Download the current image of TWRP 3.7.0+ (twrp-3.7.0_9-0-lavender.img file).
- Fastboot: fastboot flash recovery twrp-3.7.0_9-0-lavender.img fastboot boot twrp-3.7.0_9-0-lavender.img
Loader unlocked|Installed TWRP|Data backup made.|Mi Account connected-->
Step 2: Selecting and Installing NFS-enabled Firmware
The standard MIUI kernel does not include NFS modules (e.g. nfs.ko or sunrpc.ko) and you will need custom firmware that supports these features.
- π LineageOS 18.1+ is a stable firmware based on Android 11 with pre-enabled modules NFS. Supports F2FS for the /data partition, which speeds up network drives.
- π Pixel Experience is a firmware with pure Android and a network-optimized core. Requires additional Magisk installation for NFS.
- π CrDroid is a flexible firmware with advanced kernel settings, including support for NFS v4.1.
Instructions for installation (on the example of LineageOS):
- Download the firmware from the official website (lineage-18.1-YYYYMMDD-nightly-lavender-signed.zip).
- Download Open GApps (the pico option for saving space).
- In TWRP, run: Wipe β Advanced Wipe βDalvik / ART Cache, System, Data, Cache Install β select LineageOS firmware β add ZIP (Open GApps) Reboot System
| Firmware | Support for NFS | Need a Magisk? | Features |
|---|---|---|---|
| LineageOS 18.1 | Yes (v4.1) | No. | Stable, minimalist interface |
| Pixel Experience | Yes (v4.0) | Yes. | Clean Android, frequent updates |
| CrDroid 7.x | Yes (v4.2) | No. | Advanced kernel settings, WireGuard support |
| MIUI with Magisk | Partially (v3) | Yes. | Requires manual installation of modules |
β οΈ Warning: If the phone doesnβt boot after installing the firmware (hangs on the logo), go back to TWRP and repeat the Wipe β Format Data step (this will remove the encryption).
LineageOS|Pixel Experience|CrDroid|MIUI Magisk|other-->
3 step: Installation of the NFS- client and kernel setting
Even if the firmware supports NFS, you might need to do some more customization, and let's look at two scenarios: with and without Magisk.
Method 1: Magisk installation (for MIUI or Pixel Experience)
If you stayed on MIUI or chose Pixel Experience, install the NFS for Android module:
- Download the NFS for Android module (nfs-magisk-vX.X.zip file).
- In Magisk Manager, select Modules β Install from Storage β Select a file.
- Reset the device.
Method 2: Manual setting in LineageOS/CrDroid
For AOSP (LineageOS, CrDroid) firmware, NFS modules are already built into the kernel, but they need to be activated:
- Connect to the device by ADB: adb shell su echo "nfs" > /proc/filesystems
- Check the available modules: lsmod | grep nfs Should display nfs, nfsd, sunrpc.
If there are no modules, install them manually:
- Download the source modules for your version of the kernel.
- Compile them via Termux: pkg install clang make git clone https://github.com/LineageOS/android_kernel_xiaomi_sdm660 cd android_kernel_xiaomi_sdm660/fs/nfs make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
- Copy the compiled files (.ko) to /vendor/lib/modules/.
π‘
If an unknown type name 'atomic_long_t' error occurs during compilation, add the line #include <linux/types.h> to the beginning of the nfs4file.c file.
4 step: Configure NFS- server and mount folders
Before mounting the network folder, make sure that the server (NAS, PC with Linux/Windows) is configured with NFS-Export. Windows requires you to install Services for NFS, Linux requires you to edit /etc/exports.
Example of configuration for a Linux server:
/mnt/storage 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)Where:
- /mnt/storage β Exported folder
- 192.168.1.0/24 β the subnet from which access is allowed;
- rw β Reading/write rights;
- no_root_squash β Retain root rights (required for Android)
On Redmi Note 7, mount a folder via Termux:
pkg install nfs-utils
mkdir ~/nfs_mount
mount -t nfs 192.168.1.100:/mnt/storage ~/nfs_mount -o soft,timeo=3,retrans=2Where:
- 192.168.1.100 - IP- server address;
- soft β soft mounting (interrupts attempts with errors);
- timeo = 3 - timeout of the answer (seconds).
β οΈ Warning: If a Permission denied error occurs during mounting, check: The server in /etc/exports indicates the correct IP client (or subnet). Redmi Note 7 in /system/etc/hosts.allow allows access to the 2049 port (NFS). sudo ufw allow from 192.168.1.0/24 to any port nfs.
How to automate mounting during booting?
Step 5: Optimizing Performance and Safety
NFS on a mobile device can slow down due to high network latency.
- π Reduce timeouts: Use timeo=1,retrans=1 for stable local area networks.
- π Traffic encryption: configure NFS over TLS or use WireGuard for tunneling.
- πΆ Wi-Fi Priority: In Settings β Wi-Fi β In addition, turn on Always Keep Wi-Fi while you sleep.
- π Caching: Install the Dynamic FSync Magisk module to reduce write delays.
To check the speed, use Termux:
dd if=/dev/zero of=~/nfs_mount/testfile bs=1M count=100
dd if=~/nfs_mount/testfile of=/dev/null bs=1MCompare the results with local memory (/sdcard/). Normal speed for a Gigabit network: 30-50 MB/s per write and 50-80 MB/s per read.
| Parameter | Recommended value | Description |
|---|---|---|
| rsize | 8192 | Size of the reading block (byte) |
| wsize | 8192 | Size of the recording block |
| timeo | 1 (for local area network) | Timeout of response (tenths of a second) |
| retrans | 1 | Number of repeated attempts |
| hard/intr | soft | Interrupt operations in case of errors |
π‘
For maximum performance, use the NFS v4.1 protocol with mount -t nfs4 -o minorversion=1,timeo=1,retrans=1 parameters.
Step 6: Troubleshooting and Frequent Errors
Even with the right setup, there can be problems. Consider typical errors and their solutions:
- π mount: Operation not allowed β no root rights or kernel modules. Check su and lsmod | grep nfs.
- π No route to host β network issues. Make sure the server and client are on the same subnet and port 2049 is open.
- π Stale file handle -- the server has rebooted or changed the export. Remount the folder.
- π± Device or resource busy β the folder is already mounted or used by another process. Check mount | grep nfs.
If files are not displayed after mounting:
- Check the access rights on the server: chmod-R 777 /mnt/storage (temporary solution for the test).
- Make sure that the client has read rights: ls -la ~/nfs_mount.
- Try mounting with the option -o nolock (disables file locks).
For diagnosis, use the kernel logs:
dmesg | grep nfsLook for lines with errors, such as:
[ 1234.567890] NFS: server 192.168.1.100 not responding, still trying
or
[ 1234.567890] NFS: nfs4_discover_server_trunking: error -5
π‘
If NFS is unstable over Wi-Fi, try connecting via a USB ethernet adapter (such as the AX88179), which will reduce latency and increase speed.