Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Can I Mount A Network Folder Into An Android Internal Folder?

I want to mount a network shared folder (Ex: \10.0.0.240\Folder) into an Android internal folder (Ex: /mnt/sdcard/MountedFolder), just like the MountManager App does.

My question it's: How can i do it, or how can i at least enter to the network folder and see the files on it directly from my app?

I'm working on a Rooted device, so it doesn't matter about permissions.

like image 212
Ivan Verges Avatar asked Nov 02 '22 05:11

Ivan Verges


1 Answers

This is how you do it in Kit Kat from the command line:

mount -o username=<user>,password=<pwd>,file_mode=0777,dir_mode=0777 -t cifs //<NAS IP Addr>/<share name> <mount point dir>

E.g.

mount -o username=guest,password=guest,file_mode=0777,dir_mode=0777 -t cifs //192.168.1.254/public /storage/nas/public

Notes:

  • Make sure the directory /storage/nas/public exists and you have set appropriate permissions.
  • If you do not use file_mode and dir_mode you will only be able to access the share from root.
like image 110
Bryon Avatar answered Nov 14 '22 01:11

Bryon