Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,808,261 Members 37,936 Now Online
XDA Developers Android and Mobile Development Forum

[SOLVED] Mount a smb/cifs share

Tip us?
 
sendan
Old
(Last edited by sendan; 19th February 2014 at 08:00 PM.)
#1  
sendan's Avatar
Senior Member - OP
Thanks Meter 103
Posts: 574
Join Date: Dec 2009
Location: Appleton
Drive [SOLVED] Mount a smb/cifs share

Thank you in advance if you can help with this, unfortunately I'm not going to be able to follow through with this very well at the moment. If this gets no attention I'll bump it when I can follow through.

I want to mount a smb/cifs share from my router to my Nexus 5.

I can successfully mount the share and view it in terminal but none of it shows up in any apps...and that's pretty much my issue.


Here's some unimportant info, and a little info about me, I'm as scatterbrained as they come. The reason I want to do this is to stream my movies on the "NAS" to my Chromecast through Allcast or something.

As of now I'm using an entware mini dlna package on the router to stream everything to Avia. My problem is dlna broadcasts all my media to my entire network...no password required or anything. Also accessing my files through Avia is a pain in the ass, navigating through the folders repetitively gets exhausting.

Here's what I've come up with so far:

I'm using hammerhead-faux123-010m kernel, and SlimRC3.

CIFS DebugData:

Code:
CIFS Version 1.78
Features: posix xattr
Active VFS Requests: 0
Servers:
1) Name: 192.168.1.1  Domain: WORKGROUP Uses: 1 OS: Unix
NOS: Samba 3.0.37	Capability: 0x80e3fd
SMB session status: 1	TCP status: 1
Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
Shares:
1) \\192.168.1.1\NAS Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0xf
PathComponentMax: 255 Status: 0x1 type: 0 

MIDs:
The disk is actually Ext3, not NTFS.

This guy kinda just crushed all my hopes and dreams of the future but I'm trying to use his OneClickMount alpha app.
http://forum.xda-developers.com/show...&postcount=127

app here:
http://forum.xda-developers.com/show...&postcount=129

This is what I have tried, I ended up with the same results:

Code:
root@android:/storage/emulated/0/cifs # setenforce Permissive
root@android:/storage/emulated/0/cifs # getenforce
Permissive
root@android:/storage/emulated/0/cifs # mount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /storage/emulated/0/cifs
root@android:/storage/emulated/0/cifs # ls
My Music
My Pictures
My Videos
Torrents
Then I tried OneClick Mount app:

https://www.dropbox.com/sh/muabb9vp1i8ubxt/o78FSYMcHo

From what I can tell from the app logcat, the app tries to move the debuggered file, create its own with a chosen command inside, start then stop it, and restart the original.

I might try to do this manually later, as in a month from now at the least. I'm pretty sure a certain someone is pissed off at me for not becoming one with the universe n all that jazz.
 
sendan
Old
#2  
sendan's Avatar
Senior Member - OP
Thanks Meter 103
Posts: 574
Join Date: Dec 2009
Location: Appleton
I'm gonna leave a couple links here so I can delve into them later, they seem to have crazy amounts of useful information:

[HINT] How Stickmount (and others...) are working with Android 4.2

Debuggered script

Sincerely, Head is spinning
 
3DSammy
Old
#3  
Senior Member
Thanks Meter 310
Posts: 704
Join Date: May 2011
Location: Toronto
Sorry but as of android 4.4.2 CIFS at a device level (all accounts see the network shares) no longer works and no one has a solution. This includes rooted devices and custom Roms. Of course apps such as ES File Explorer can have network share accesses but not all apps can utilize that access. For example MX player can be invoked from an ES file folder by clicking on a video file but apps like PowerAmp cannot see those folders. Some apps include built in network share features but they have the same restrictions as I previously described.

Things all changed when Android included multiple accounts and security started to get tighter. Initially developers found ways around those measures but too my knowledge, with 4.4.2 no one has found a work around.

Sent from my Nexus 10 using XDA Premium HD app
Google Nexus 5 & 10: [4.4.4] rooted Stock, Franco kernel (on N5, on N10), TWRP, Xposed, GravityBox, SuperSU Pro and ViPER4Android Audio Effects FX
 
rootSU
Old
#4  
rootSU's Avatar
Senior Member
Thanks Meter 11,396
Posts: 22,424
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Quote:
Originally Posted by 3DSammy View Post
Things all changed when Android included multiple accounts and security started to get tighter. Initially developers found ways around those measures but too my knowledge, with 4.4.2 no one has found a work around.

Sent from my Nexus 10 using XDA Premium HD app

One workaround is hijack a system process such as debuggerd (debugger daemon) which runs with higher than su permissions. This method still works but is awkward to exploit manually. Apps such as foldermount use this workaround but not for network mounting, but it shows that it is still possible.
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!

**Sticky Roll-up: All Guides snd Info Threads linked here**



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
 
embhorn
Old
#5  
Member
Thanks Meter 4
Posts: 51
Join Date: Apr 2012
I have a Raspberry Pi running OpenELEC for streaming my locally stored media. I use my Chromecast for streaming Netflix, Google Play media, etc.

I understand what you are trying to do, but a dedicated device works great for me.

That said, you might keep an eye on VLC to see if they start supporting casting to Chromecast. That would likely accomplish what you are asking.
 
sendan
Old
#6  
sendan's Avatar
Senior Member - OP
Thanks Meter 103
Posts: 574
Join Date: Dec 2009
Location: Appleton
Quote:
Originally Posted by rootSU View Post
One workaround is hijack a system process such as debuggerd (debugger daemon) which runs with higher than su permissions. This method still works but is awkward to exploit manually. Apps such as foldermount use this workaround but not for network mounting, but it shows that it is still possible.
This is what I'm going to attempt next, from what I read it can be terribly inconsistent if not done through SSH, so that's a bummer. I just need to get more information on how to do it. Debuggered in general confuses me.

Quote:
Originally Posted by embhorn View Post
I have a Raspberry Pi running OpenELEC for streaming my locally stored media. I use my Chromecast for streaming Netflix, Google Play media, etc.

I understand what you are trying to do, but a dedicated device works great for me.

That said, you might keep an eye on VLC to see if they start supporting casting to Chromecast. That would likely accomplish what you are asking.
This is what I've been wanting to do with my old Galaxy Nexus. I have the HDMI adapter and everything but the screen is broke (the digitizer works), so I plug it into my TV and randomly hit the screen hoping to eventually connect my bluetooth mouse lol. No such luck. I wish I could just boot it into a custom build but that's never gonna happen. Unless OpenELEC works on android devices? Seems unlikely.
 
rootSU
Old
#7  
rootSU's Avatar
Senior Member
Thanks Meter 11,396
Posts: 22,424
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
debuggerd can be replaced with a shell script with the mount command in it and it will run at boot.

It's really messy. I found I had to put the original debuggerd back or the phone would lock up.

Sent from my Nexus 5 using Tapatalk
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!

**Sticky Roll-up: All Guides snd Info Threads linked here**



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following User Says Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
sendan
Old
(Last edited by sendan; 18th February 2014 at 10:42 PM.)
#8  
sendan's Avatar
Senior Member - OP
Thanks Meter 103
Posts: 574
Join Date: Dec 2009
Location: Appleton
WEEEEEOOOOOOO I finally got all my stuff to show in a file manager, now I just need to find a terminal command to trigger media scan on the folder. Right after I eat a bunch of chicken.

Awesome, it works perfectly. And by perfectly I mean it's the messiest thing I've ever done on Android. I'm not really sure how this affects battery and all but thank god this finally works.
 
sendan
Old
#9  
sendan's Avatar
Senior Member - OP
Thanks Meter 103
Posts: 574
Join Date: Dec 2009
Location: Appleton
For anyone interested:

Follow the directions in this post.

I didn't understand the mount command he used so I used

Code:
/system/xbin/busybox mount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /data/media/0/cifs
You also need to use /data/media/0/ otherwise it will only work in already opened apps apparently.

So thanks rootSU...And that should work, I'm going to do it in a way where I don't have to use scriptmanager but that's the gist. All the credit goes to the people in the threads I linked, I have absolutely no idea what I did here and I learned nothing.

Nothing special to see here.
 
sendan
Old
#10  
sendan's Avatar
Senior Member - OP
Thanks Meter 103
Posts: 574
Join Date: Dec 2009
Location: Appleton
Here's a way to unmount it so it doesn't explode your apps when you disconnect WiFi:

/system/bin/debuggerd.binnn

Code:
#!/system/bin/sh
/system/bin/umount_movies.sh
exec /system/bin/debuggerd.bin "$@"
/system/bin/umount_movies.sh

Code:
#!/system/bin/sh
/system/xbin/busybox umount /data/media/0/cifs
/system/xbin/busybox umount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /data/media/0/cifs
Script_eject.sh

Code:
#!/system/bin/sh
mount -o rw,remount /system
sleep1
/system/xbin/busybox mv /system/bin/debuggerd /system/bin/debuggerd.binn
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd.binnn /system/bin/debuggerd
sleep 1
mypid=$(/system/xbin/busybox ps -o pid,comm | /system/xbin/busybox grep 'debuggerd' | /system/xbin/busybox awk 'NR == 1 {print $1}')
/system/bin/kill $mypid
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd /system/bin/debuggerd.binnn
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd.binn /system/bin/debuggerd
sleep 1
mount -o ro,remount /system
I'm automating all this with Tasker.

Script task: (I have it run at boot)

waits 15 seconds
run shell command to kill debuggerd
wait 5 seconds
media action scan card /

Script_eject task: (I have it run when I disconnect from my SSID)

run shell command with the script_eject.sh code
wait 6 seconds
media scan card /

It has been seamless so far, also lol.
Attached Files
File Type: zip Tasker_tasks.zip - [Click for QR Code] (1.0 KB, 14 views)

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes