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

How to mount an NFS share (such as from FreeNAS) from an Android box

by Jan Bachelor March 5, 2021
12.8k views

Last Updated on March 5, 2021 by Jan Bachelor

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 (such as from FreeNAS) from 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.
0 comment 0 FacebookWhatsappEmail
Jan Bachelor

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

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.

Search for articles

Other Tips

  • How to mount an NFS share (such as from FreeNAS) from an Android box
  • How to download a Windows 10 ISO on a Windows device – easy work-around

Other Tutorials

  • Build Your Own Router - Proxmox, OPNSense, OpenVPN server and a VPN client all in one!
    12 Steps
  • Dynamically Populate Gravity Forms from Google Sheets (GSheets APIv4)
    6 Steps

Recent Comments

  • Jan Bachelor on Use Integromat to get computer IDs from user email in JamF ProHi Robert, the static groups were created in the p…
  • Robert Petitto on Use Integromat to get computer IDs from user email in JamF ProCan you share how you'd use Make (integromat) to a…
  • Martin on Part 1 – What do we want to do + Required technology (bank feed)This tutorial deserves more credit, I've not seen…
  • Jan Bachelor on WAN / LAN Set Up (Before OPNSense Installation)Hi Ed, I have not tested it with PCI passthrough y…
  • Ed on OPNSense VM Set UpIn step 4 firewall you turned off firewall, should…

Tags

chrome iso windows

Categories

  • Android
  • FreeNAS
  • Linux
  • Windows

Recent Posts

  • How to mount an NFS share (such as from FreeNAS) from an Android box

  • How to download a Windows 10 ISO on a Windows device – easy work-around

Facebook Twitter Instagram Pinterest Linkedin Youtube

@2019 - All Right Reserved. Designed and Developed by PenciDesign

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