How to Install NFS on Xiaomi Redmi Note 7: A Complete Guide from Unlock to Mount

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:

  1. Turn off the phone and press Volume Down + Power to log into the Fastboot.
  2. Connect the device to the PC and execute the command: fastboot oem device-info
  3. If the answer is Device unlocked: false, the bootloader is blocked.

To unlock:

  1. Link your Mi Account to your device in Settings β†’ Xiaomi Account β†’ Mi Cloud.
  2. Download Mi Unlock Tool (version no lower than 5.5.224.30).
  3. 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:

  1. Download the current image of TWRP 3.7.0+ (twrp-3.7.0_9-0-lavender.img file).
  2. 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):

  1. Download the firmware from the official website (lineage-18.1-YYYYMMDD-nightly-lavender-signed.zip).
  2. Download Open GApps (the pico option for saving space).
  3. In TWRP, run: Wipe β†’ Advanced Wipe β†’Dalvik / ART Cache, System, Data, Cache Install β†’ select LineageOS firmware β†’ add ZIP (Open GApps) Reboot System

FirmwareSupport for NFSNeed a Magisk?Features
LineageOS 18.1Yes (v4.1)No.Stable, minimalist interface
Pixel ExperienceYes (v4.0)Yes.Clean Android, frequent updates
CrDroid 7.xYes (v4.2)No.Advanced kernel settings, WireGuard support
MIUI with MagiskPartially (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:

  1. Download the NFS for Android module (nfs-magisk-vX.X.zip file).
  2. In Magisk Manager, select Modules β†’ Install from Storage β†’ Select a file.
  3. 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:

  1. Connect to the device by ADB: adb shell su echo "nfs" > /proc/filesystems
  2. Check the available modules: lsmod | grep nfs Should display nfs, nfsd, sunrpc.

If there are no modules, install them manually:

  1. Download the source modules for your version of the kernel.
  2. 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
  3. 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=2

Where:

  • 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?
Add a line to /data/adb/post-fs-data.d/nfs_mount.sh (Create a file if it is not there): #!/system/bin/sh mount -t nfs 192.168.1.100:/mnt/storage /data/local/nfs_mount -o soft,timeo=3 chmod 777 /data/local/nfs_mount Then make the file executable: chmod +x /data/adb/post-fs-data.d/nfs_mount.sh This will mount the folder automatically after the system boots up.

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=1M

Compare 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.

ParameterRecommended valueDescription
rsize8192Size of the reading block (byte)
wsize8192Size of the recording block
timeo1 (for local area network)Timeout of response (tenths of a second)
retrans1Number of repeated attempts
hard/intrsoftInterrupt 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:

  1. Check the access rights on the server: chmod-R 777 /mnt/storage (temporary solution for the test).
  2. Make sure that the client has read rights: ls -la ~/nfs_mount.
  3. Try mounting with the option -o nolock (disables file locks).

For diagnosis, use the kernel logs:

dmesg | grep nfs

Look 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.

FAQ: Frequent questions about NFS on Redmi Note 7

Can I use NFS without root rights?
No, mounting NFS requires root rights, because it's a system operation, and the alternative is WebDAV or SMB (via applications like FX File Explorer), but they're slower and less reliable.
What is the most stable firmware for NFS?
According to XDA Developers user tests, LineageOS 18.1 shows better stability thanks to built-in NFS v4.1 support and an optimized kernel.CrDroid is suitable for advanced users, as it allows fine-tuning of network settings.
How to unmount the NFS- folder if the device is frozen?
If umount ~/nfs_mount Not working due to resource employment: Find a process that blocks unmounting: fuser -vm ~/nfs_mount. Forced to complete it: kill -9 <PID>. Use the umount -f ~/nfs_mount (In the extreme case, reset the device.
Can I use NFS to store applications?
Technically, but not recommended. Applications installed on a network drive will be slow and can become dyed up when a connection is cut, and it's better to use NFS for media files, backups or projects in Termux.
How to set up auto-mounting when connecting to a specific Wi-Fi network?
Use Tasker or Automate: Create a task with a Wi-Fi Connected trigger (SSID of your network). Add Run Shell action with the mount command. Set up reverse action (unmount) when you disconnect from Wi-Fi. Alternatively, a script in /data/adb/service.d/ that checks the current network.