Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan
AndroidFreeNASLinux

How to mount an NFS share on an Android box

by Jan Bachelor February 3, 2024
26.3K views
26.3K

Do you have a home NAS plus an Android TV (box) or a phone connected to a non-smart TV and want to mount the NAS onto the Android device to watch your movies on a TV? Then check out this article!

 
 

How to mount an NFS share to an Android box

  1. On your Android box, install these apps (e.g. from Google Play):
  • SSH Droid – used for SSH access. Remember to change the default password for something complex!
  • Busybox – contains a list of commands such as to mount the NFS share. Default path for the installation is in /system/xbin).
  • Script Manager (SManager) – used later for running the mounting script upon every boot once tested as working.

  1. Log into your Android device via SSH Droid. Out of interest, compare the default version of busybox with the one you have just installed:
# Stock version of busybox
busybox

# Newly installed version
/system/xbin/busybox
  1. Get the NFS share visible to all Android users by disabling SELinux:
su --mount-master
getenforce
setenforce 0
getenforce
# result should be 'Permissive'
  1. Mount your NFS share
# Mount the NFS share with the -option parameter to read only and nolock:
/system/xbin/busybox mount -o ro,nolock IP:/path/to/your/share/on/FreeNAS /path/on/android/to/mount

# Create a folder where to mount the NFS share 
mkdir /mnt/FreeNAS

# Example below:
/system/xbin/busybox mount -o ro,nolock 192.168.1.17:/mnt/Tank/Kodi /mnt/FreeNAS

# Now output indicates it went well. Check it with the following:
ls -lah /mnt/FreeNAS
  • It may be a good idea to test at this point that you can access the data from within the Android device. You can use an app called EZ File Browser (or any other).

  1. Convert the command into a script:
# Create a new file in a folder that the system can reach after startup
vi /storage/emulated/0/mount_freenas.sh

# Press the Insert key (or A) to be able add data. Then copy paste/re-enter the mount line that we tested previously

# To save exit the vi editor, press the 'Escape' key, followed by letters 'wq' and the 'Enter' key to confirm.
  1. Schedule the script on every boot:
  • Run SManager in Android, find the script file wherever you saved it and set it to run as ‘bash mount_freenas.sh’. Tick the following parameters:
    • Run on boot
    • Run as root
    • Run on network change (in case of network disconnect and re-connect)

  Now reboot your Android box and see if the shares come up again. Allow about 2 minutes after the boot as there is typically a slight delay before the folder is mounted. You can use EZ File Explorer or any other Android app to verify that the path is accessible..

  1. Mount the path in Kodi Once all done, go to Kodi (XBMC) and set up your share as local (not external or network share), e.g. in /mnt/FreeNAS.
3 comments 0 FacebookWhatsappEmail
Jan Bachelor

previous post
How to download a Windows 10 ISO on a Windows device – easy work-around
next post
How to Rename a Proxmox Node

You may also like

How to join two Proxmox nodes into a cluster (PVE 8.x)

May 4, 2025

How to Rename a Proxmox Node

May 4, 2025

3 comments

Carles Cortes Costa December 13, 2024 - 1:11 pm

Amazing Jan, thank you very much

Reply
Jan Bachelor December 13, 2024 - 1:53 pm

Hi Carles, thank you. I can see that you have an interesting blog yourself! Ended up reading about the ‘offline’ S3 bucket solution with Minio. Thanks!

Reply
Carles Cortes Costa December 16, 2024 - 7:57 pm

That article is pretty old ! Docker Swarm ended not being as used as i thought it would be back then. A pleasure !

Reply

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Course Steps

Recent Comments

  • Jan Bachelor on Dynamic DNS Set Up with DuckDNS on OPNSenseHi Jake, that's awesome, congratulations on getting…
  • Jake on Dynamic DNS Set Up with DuckDNS on OPNSensefollowed guide above to the T and all is working. i…
  • Fastbrain on Dynamic DNS Set Up with DuckDNS on OPNSenseThanks for the guide. For some reason, after follow…

Other courses

Install iRedMail Mail Server As Proxmox VM With...

October 31, 2024

Remote Bucket Storage for Proxmox VM Backups

August 16, 2024

Concur Alternative: Import Employees’ Credit Card Expenses to...

January 19, 2024

Create an automated Gravity workflow that will allow...

January 19, 2024

Dynamically Populate Gravity Forms from Google Sheets (GSheets...

March 16, 2021
Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Recent Posts

  • How to join two Proxmox nodes into a cluster (PVE 8.x)

  • How to Rename a Proxmox Node

  • How to mount an NFS share on an Android box

Facebook Twitter Instagram Pinterest Linkedin Youtube

All Rights Reserved. The theme was customized from Soledad, see PenciDesign