yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] :
I dont know about your problem, but about folder going missing after reboot. I got a solution for you:

Copy these content and save as CHOOSE_A_NAME.sh on /etc/init.d:

#!/system/bin/sh

#

# Create and Mount Dir

#

sleep 70

su

mount -wo remount /

mkdir /mnt/cifs

mkdir /storage/cifs

chmod 777 /mnt/cifs

chmod 777 /storage/cifs

ln -s /mnt/cifs /storage/cifs

mount -ro remount /

Now everytime you reboot your phone those folders/permissions and links will be created. That sleep 70, i put that option there because i dont know if there's any side effect using mount command after system boot. So it will take 70 secs to run those commands.

Im not a specialist on android but im using this script to create my mount point under /mnt/obb/Cypher and it's working pretty well.
[Android Software/Hacking General [Developers Only]] ozgreg:
You be better off installing a custom kernel with those modules (or compile your own) as I do not believe the standard CM 10.1 kernel has those modules..

---------- Post added at 10:29 AM ---------- Previous post was at 10:26 AM ----------

FYI any custom directory under /mnt will be deleted as /mnt is re-created during the init.d boot process. CM 10.1 has a custom init script that you should be able to use to re-create the missing directories..
[Android Software/Hacking General [Developers Only]] lopez1_de:
Thanks. But do I need this two modules? I'm a german user. I know for what I need UTF8, but I don't know for what reasons I used md4.ko before. And on CM9 & 10 both where placed in /system/lib/modules. I insmod them manually.

Is it supported to use another kernel with CM10.1?

Or should I better try to compile it for my own? I'm a Windows programmer. But where do I find the source code for 3.4.0-perf-g3186d08?

Thanks for all this great help. :good:
[Android Software/Hacking General [Developers Only]] ozgreg:
If you are using a N7 you can give motley Kernel a try as it has CIFS/UTF8, NFS, NTFS r/w, TUN - built-in so just flash the kernel and you will not need any additional modules.. I been using it with CM 10.1 and it has proven for me to be very rock solid via CIFS Manager..
[Android Software/Hacking General [Developers Only]] lopez1_de:
I found the kernel for my Nexus 4 and flashed it.

http://xdaforums.com/showthread.php?t=2021437

But had no luck with cifs again. I know that the share I use is ok, because "File Manager" can browse it. I will ask my questions in the motley thread now. Thanks.
[Android Software/Hacking General [Developers Only]] VanillaG0rilla:
Is this able to be made into a flashable for a rom on the nexus 7?
[Android Software/Hacking General [Developers Only]] moncojoe:
Fix for empty app-mounted directories

Any news from Google about this issue?

Also, great job on patching.
[Android Software/Hacking General [Developers Only]] vorcers:
I made a flashable kernel some time ago...

http://xdaforums.com/showthread.php?t=2107224
[Android Software/Hacking General [Developers Only]] dw7017:
The debuggerd method worked well for my use case, which was simply to mount my home movie (samba) server at /sdcard/Movies/cifs. I am using a Nexus 4 running Faux kernel, but with stock Android 4.2.1 ROM (JOP40D). Here is my flow :

- Replace debuggerd with your own script that performs the mount then runs the renamed original debuggerd (debuggerd.bin below). Android starts the debuggerd service at boot, and at that point the mount will fail as wireless is not connected. However, Android will automatically restart debuggerd if it is killed. So we create another script that kills debuggerd and use a ScriptManager widget to call that script at the click of a button. Assuming wireless is connected, the mount will succeed when debuggerd is rerun by Android.

1. /system/bin/debuggerd

#!/system/bin/sh
/system/bin/mount_movies.sh
exec /system/bin/debuggerd.bin "$@"

2. /system/bin/mount_movies.sh

#!/system/bin/sh
/system/xbin/busybox umount /sdcard/Movies/cifs
/system/xbin/busybox mount -t cifs -o ip=<ip_address>,unc=\\\\<ip_address>\\shared,user=<username>,pass=<password> //<ip_address>/shared /sdcard/Movies/cifs

3. /system/xbin/kill_debuggerd.sh

#!/system/bin/sh
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

I then used SManager app and added kill_debuggerd.sh to its favourites. Then used SMWidget to add a button to launcher that runs this script when clicking the button.

[There is nothing special about debuggerd, you can choose to replace any process that is started by init.rc and doesn't specify oneshot. The important thing is that Android will rerun your script when the its process is killed :)]
[Android Software/Hacking General [Developers Only]] lopez1_de:
Thanks! This is the first solution that works for me on default Cm10.1 Nexus 10. I invested so many hours to get it running. Without Cifs the tablet is almost useless for my personal use.

Too bad that the cyanogenmod team does not compile a nls_utf8.ko. :'( As a german user I need it for any file with a special character. And I have a lot of this files.

---------- Post added at 03:44 PM ---------- Previous post was at 03:20 PM ----------

But finally, the app has to be started before mounting again. I updated to today's version of CM. Never ending story. ;)
[Android Software/Hacking General [Developers Only]] sjf53t8i:
Tried it on Galaxy Nexus with stock Android 4.2.1. Process works and folder gets mounted but mount point content still isn't visible to other apps. But I do see the content in 'adb shell'.

Any other ideas or recommendations I could try?
[Android Software/Hacking General [Developers Only]] bubbleguuum:
Since Android 4.2.2 and the adb RSA change, it is not possible anymore to execute "adb shell mount...", as adb will always report the device as offline when connected to localhost. This breaks any script dealing with mounting, which worked previously fine.

I've opened an android issue for it. If you feel this is important, please star this issue.

It makes mounting without modified kernels even more difficult.

I tried to workaround it by replacing adb/adbd binaries of a 4.2.2 install by 4.2.1 binaries, but it didn't work (device still offline).

Maybe I missed something though.

It would be nice if a workaround could be found to restore the ability to run "adb shell" in loopback mode (eg on device).
[Android Software/Hacking General [Developers Only]] bountygiver:
isnt the newset 4.2.2 update requires you to use the newest adb on your pc since they added some security features?
[Android Software/Hacking General [Developers Only]] thereal_bigjake:
Yes

Nexus 7 | PA 3.0 4.2.2 | M-kernel | Nova
[Android Software/Hacking General [Developers Only]] sjf53t8i:
Look here how to circumvent adb device offline: http://code.google.com/p/android/issues/detail?id=48126
[Android Software/Hacking General [Developers Only]] bi00:
Hi dudes,

is there a utf8 kernel module available?

I did not find any under /system/lib/module...
[Android Software/Hacking General [Developers Only]] lopez1_de:
I also need them (CM10.1). Every time again for a new kernel. I opened a issue:

https://jira.cyanogenmod.org/browse/CYAN-442

http://forum.cyanogenmod.org/topic/67353-kernel-module-for-utf8/
[Android Software/Hacking General [Developers Only]] firiel:
Am using a supported kernel on a stock 4.2.2 (mr1). How can I apply the Dalvik change and the init.rc to the stock rom ? Can you give me any installation guide or something ?
[Android Software/Hacking General [Developers Only]] NicoGa:
I would also be very interested in knowing a way to apply such mods to the stock rom 4.2.2 !
[Android Software/Hacking General [Developers Only]] CreatiV92:
fix mount

I have Nexus 7 android 4.2.2 build JDQ39

I can not mount the external cache memory stick. Do I understand correctly, your patch will fix it? How can I install .diff file?
[Android Software/Hacking General [Developers Only]] NicoGa:
Wrong thread. You just need to use the free app called stickmount
[Android Software/Hacking General [Developers Only]] CreatiV92:
You misunderstood. I have Stickmount, and it works fine.

I want to carry cache games on the external flash drive with the command "bind mount", but I can not. All of the Nexus 7 with 4.2.2 can not move the cache. So I wanted to use the patch "dalvik.diff", just do not know how to install it, the forum did not find information on installation .diff on android. Or is it not help?
[Android Software/Hacking General [Developers Only]] madmack:
I'm actually working on an app that should do just that.

Google for FolderMount here on xda.
[Android Software/Hacking General [Developers Only]] CreatiV92:
Thank you!! It's really work.
[Android Software/Hacking General [Developers Only]] DualJoe:
And what if we want to overlay something inside the slave mountpoints? I'm trying to figure out how to overlay my obb folder in init.d.
[Android Software/Hacking General [Developers Only]] vorcers:
Use /data/media/0

Short: Mount inside /data/media/0

Long:

1. You can't use for bind mountpoints inside /storage. Use some other place, like /.

2. Mount inside /data/media/0

Example for your example:

mount -o bind /mounts/sdcard1/obb /data/media/0/Android/obb

This should make your files available inside /mnt/sdcard and all other virtual mountpoints. Android redirects this somehow.

But I don't know if the games are also working with this. You need to test this.
[Android Software/Hacking General [Developers Only]] DualJoe:
The problem is that root has a different mountspace/context than standard android users. Root's obb folder is empty here (tested with SSHd) whereas using any filebrowser within Android shows the proper folder content. Anything done on root level will not lead to success. Even scripts/commands in init.d are not processed on the same mountspace as SSHd.

We probably need something to change context like mentioned in 1st post indeed to get this fixed completely...
[Android Software/Hacking General [Developers Only]] vorcers:
Thats correct... /data/media/0/Android/obb is empty, and /mnt/sdcard/Android/obb not.

The obb are located at my nexus 7 under /data/media/obb. If I create a folder there, it gets also redirected to /data/media/0/Android/obb. Try bind your folder there.

And I want to clarify, that my suggestions always need the dalavik/kernel patch.
[Android Software/Hacking General [Developers Only]] DualJoe:
mount -o bind /storage/sdcard1/obb /data/media/obb

does work from SSH but not from init.d. :(

Maybe init.d runs prior Zygote/slavemounts...
[Android Software/Hacking General [Developers Only]] aznrice2k4:
OMFG... I'm going to add that to my kernel and see if it fixes the mounting sd card issue on the HTC ONEXL. If it works, I'm gonna donate you some money. I've been slaving over this issue for weeks!
[Android Software/Hacking General [Developers Only]] redhonker:
"Unable to chmod /mnt/cifs: Read-only file system"

Version: CyanogenMod 10.1-20130403-UNOFFICIAL-smba1002

Does this build have the fix?

Thanks
[Android Software/Hacking General [Developers Only]] xdadevnube:
Firstly, I want to say thanks to everyone for the useful information on this thread.

I have to ask is it possible to apply the dalvik patch to a stock-based ROM on the Verizon Galaxy S 4?

If so, are there any resources or guides that one could point me to so I could attempt to patch the ROM with the files in the OP?

I finally got CIFS working on the GS4, but the directories are empty.

*EDIT*

I just ended using a ROM with empty mount directories fix included (CM-based ROM.) Now I got CIFS working. Woohoo!
[Android Software/Hacking General [Developers Only]] wang3192:
How to do it?

"I just ended using a ROM with empty mount directories fix included (CM-based ROM.) Now I got CIFS working. Woohoo![/QUOTE]"
[Android Software/Hacking General [Developers Only]] vua777:
hacking time for me

many thanks Dev!
[Android Software/Hacking General [Developers Only]] R3dDr4g0n:
With CIFS manager I can mount /mnt/cifs. All files are there. Is there now a possibility to mount in /stoage, so the folder is not empty? So Poweramp find the files. Excuse my bad English :rolleyes:

I use CM 10.1.3 RC1

Edit: Solution!!

Many thanks
[Android Software/Hacking General [Developers Only]] Trev186:
Hi,

So I am trying to mount CIFS off the "Mnt" folder

How do I apply these changes?

Anyone know a step by step video or something? I desperately need this

$50 for the first person who can show me what to do :)
[Android Software/Hacking General [Developers Only]] DualJoe:
Any solution for CM10.2? The only workaround i found so far is starting /system/bin/ssh in /system/init.d at bootup. All folders mounted within this ssh shell are globally accessible.

I'm not sure if it's related to that specific binary, if it's a "timing" thing (started before zygote) or something else.

Anyone know a better solution?
[Android Software/Hacking General [Developers Only]] Trev186:
So I tried making my own script to Mnt CIFS on my Galaxy S4:

Hi,

I have a WIFI and a 3G version both are giving me trouble. All apps I have tried fail cause none have an option to mount a system folder.

Any ways here are my scripts:

for 3G

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

mkdir /system/cifs

mkdir /system/cifs/localMountDir

busybox mount -t cifs //IPADDRESS:445/ /system/cifs/localMountDir -o unc=\\\\IPADDRESS:445\\,username=X,password=X

was not sure if I need to specify a port (445) or not..either way I cannot connect it says no such device

WIFI script:

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

mkdir /system/cifs

mkdir /system/cifs/localMountDir

busybox mount -t cifs //192.168.0.150/b /system/cifs/localMountDir -o unc=\\\\192.168.0.150\\b,username=X,password=X

Again i tried this with & without port no luck

I have been able to connect via ANDSMB app while over wifi (not over 3 G yet) so I know the above information should connect at least when on WIFI.

Using this guys blog post for inspiration

http://www.wyattspace.com/2013/08/1...ount-cifs-network-samba-shares/#comment-28381

This thread mentions it is possible to work around the multiuser issue but I did not see anyone post a script or anything. All discussion has been focused on incorporating it directly into ROMs which is not a viable option for me
[Android Software/Hacking General [Developers Only]] vorcers:
Well, as an alternative you can use the debuggerd Method which I tried to descibe in this Thread. It is the same method as Chainfire uses for stickmount and doesn't need "changes" to the rom. In this thread, all the given technics are based on changing the rom. But the debuggerd method also isn't really easy...

I already think about writing an app, which can do booth, mounting with the "normal" and the debuggerd method. (Booth, for mounting usb and network shares)
[Android Software/Hacking General [Developers Only]] redhonker:
I am running PAC-man 4.3 (CM 10.2), CIFS manager, and ES File Explorer

The first time I mount a share, it will open in ES as an empty folder. I'd have to unmount and remount, open it again. Good chance it will show the content but not always.

When it does show content, if I try to install an APK in the remote folder, it will generate error "there was a problem parsing the package". However, I can copy the file to a local folder and then install successfully.

And I can't seem to write to any mounted folder.

Any way to fix this?

Thanks
[Android Software/Hacking General [Developers Only]] vanyas:
Hello. I apply patch for kernel and init.rc to 3.4.0 kernel from Samsung SM-T525 (android 4.4.2), but it doesn't work.

Mounted folder is empty for any user, expect user, that mount it. Of cource mount point is outside /storage

In dmesg: "Failed to mount /mnt/shell/emulated as MS_SLAVE: -22"

upd: I remove remount /mnt/shellemulated from kernel patch, and now it works
[Android Software/Hacking General [Developers Only]] 白い熊:
Old thread, but I've yet to discover a functional method of mounting storage with userspace access on Kitkat, this recommendation is the closest I've found.

I'm using a Note 4, no custom kernel. On the Note 3 the debuggerd hack discussed here also works, however on a Note 4 the debuggerd hack and the above approach both only give write access for the superuser.

Concretely, I'm mounting an SD card formatted in ext4. Using the above I:

- mount it to /data/media/test

- bindmount /data/media/test to /data/media/0/test

This way a regular user can view content in /storage/sdcard/test (which is /data/media/0/test) but it's only read access, even the superuser can't write there. The superuser can read/write /data/media/test which is then visible in /storage/sdcard/test but no write access for a regular user anywhere.

Damn stupid Google "improvements"...

Anyone succeed in mounting anything read/write in Android 4.4.2 anyway without kernel compilation?
[Android Software/Hacking General [Developers Only]] DualJoe:
That's due to FUSE-fs file permission conversion (vfat/sdcard->ext4/data->vfat/storage - ends up in read-only). I compensate that with an intermediate mountpoint (sdcardx1) in init.d. It waits for vold to bring up sdcard1 and then 'bind mount' it. If you do it yourself before vold it will fail and you will suffer corresponding functions in Android. The huge timer of 120*2 secs is to survive dexopt process when updating rom (when apps get counted up). Usually the counter just runs below 10 depending how fast your system boots up. You can see it if you enable 'debug' redirection.

Do not bind mount /sdcard1/Android/* to /sdcard/Android/*. These folders are both registered in Android (system folder). Use something like 'Android2' on sdcard1 instead (see below).

#!/system/bin/sh

# Debugging - if enabled redirects shell output to file
# exec &> /data/initd.txt

(
for i in `seq 1 120`; do
if [ "$(busybox ls -A /storage/sdcard1)" ]; then
busybox mount -o remount,rw /
mkdir /storage/sdcardx1
busybox mount -t vfat /dev/block/mmcblk1p1 /storage/sdcardx1 -o rw,relatime,fmask=0111,dmask=0000,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
# busybox mount -o bind /storage/sdcardx1 /mnt/media_rw/sdcard1
busybox mount -o bind /storage/sdcardx1/Android2/obb /data/media/obb
busybox mount -o bind /storage/sdcardx1/Android2/data /data/media/0/Android/data
busybox mount -o bind /storage/sdcardx1/Download /data/media/0/Download
busybox mount -o bind /storage/sdcardx1/DCIM /data/media/0/DCIM
busybox mount -o remount,ro /
break
else
sleep 2
fi
echo loopcount $i
done
) &
[Android Software/Hacking General [Developers Only]] 白い熊:
The problem is, I don't think the Note 4 has init.d support, and I'd rather do this without building a custom kernel if possible.

So, obviously it will not bring up sdcard1... I was looking for a way to mount the card manually after the phone has booted.

Is there a way to achieve a similar effect without init.d support?
[Android Software/Hacking General [Developers Only]] DualJoe:
There are solutions to add init.d support to some stock roms. But if you have access to init.rc service starts like debuggerd or sshd you can inject scripts there as well.
[Android Software/Hacking General [Developers Only]] 白い熊:
I'm experimenting with it now. Was able to get the FUSE mount. Thanks. One question that I can't find any info on anywhere:

Is there a way to influence the file owneship and permissions on the files created in the FUSE mountpoint? I understand FUSE doesn't use file permissions, however underlying files on the primary system are all root:1028 owned and 660 for files and 770 for dirs. This is not satisfactory, can I change it somehow?

--

白い熊
[Android Software/Hacking General [Developers Only]] DualJoe:
https://source.android.com/devices/storage/config-example.html

localhost / # /system/bin/sdcard
no source path specified
usage: sdcard [OPTIONS] <source_path> <dest_path>
-u: specify UID to run as
-g: specify GID to run as
-w: specify GID required to write (default sdcard_rw)
-t: specify number of threads to use (default 2)
-d: derive file permissions based on path
-l: derive file permissions based on legacy internal layout
-s: split derived permissions for pics, av (requires -d or -l)
[Android Software/Hacking General [Developers Only]] jocala:
Sorry about resurrecting this thread, but I patched a 3.4 kernel for the Amazon Fire TV; Both patches applied w/o error, but mount contents are still invisible to apps. Where's the most likely place to look to diagnose the problem?
[Android Software/Hacking General [Developers Only]] DualJoe:
You don't necessarily need to patch the kernel. On latest Android versions it shouldn't be a problem anymore (at least for non-stock/custom roms). If you have an older Android version you can try SuperSU's --mount-master option.
[Android Software/Hacking General [Developers Only]] jocala:
The Fire TV is running Amazon's version of JB, but it has the invisible mount contents symptom, so I thought I'd give the patches a try.
[Android Software/Hacking General [Developers Only]] DualJoe:
Yes, that's a known problem on these Android versions. I once also created a patched CIFS Manager for that. Its based on the --mount-master feature. I'm not sure though if SuperSU still supports that function.
[Android Software/Hacking General [Developers Only]] Lord_Flaya:
Old thread, but figure I'll see if anyone can help. I'm on 7.1.2 pure Nexus and Franco kernel (CIFS support). I can create the mount in CIFS manager (patched), but shares are empty. Tried the --mount-master command in terminal, but no luck. Response says no such command.

Anyone care to help?
[Android Software/Hacking General [Developers Only]] Wilsonb:
SM-N920T

Rooted Android 7.0 Kernel w/ NFS, CIFS support

Using Mount Manager 1.0.41

I have NFS,FTP, SMB shares avail via my Router

I can't figure this out..

1st thing, I have not seen any mention of the modules. Do I need to load them to get this to work? Where to get them?

2nd I keep getting 'Failed to connect to server' , what should the syntax be? smb://ip address/share folder ?, doesn't seem to work

3rd The local mount point is not able to mount inside /mnt, or at least I don't have permissions to create a cifs folder in there.

Please help.

I would like to get this working so I can use Titanium Backup to backup on mounted share and schedule overnight.
[Android Software/Hacking General [Developers Only]] DualJoe:
You probably don't have SuperSU installed.

1) 'cat /proc/filesystems' should show a cifs entry. Usually it's built into the kernel directly.

2) Depends on kernel, cifs module and user space tools. Try to find some examples from other users.

3) The root folder is mounted read-only. Try 'mount -o remount,rw /'.
[Android Software/Hacking General [Developers Only]] Lord_Flaya:
I have chainfires systemless root. I'm on nougat 7.1.2
[Android Software/Hacking General [Developers Only]] DualJoe:
Maybe mount-master isn't available on Android 7. Check 'su --help' manually. Otherwise i don't know.
[Android Software/Hacking General [Developers Only]] Lord_Flaya:
Thanks. -mm --mount-master is present.

However it doesn't work.

Perhaps it's an issue with systemless root...?

Will inquire about it at SuperSU thread.
[Android Software/Hacking General [Developers Only]] DualJoe:
This rather looks like a syntax error. What's your exact command line?
[Android Software/Hacking General [Developers Only]] Lord_Flaya:
su --mount-master -c busybox mount -o username=guest,rw,noperm,iocharset=utf8 -t cifs //192.168.0.xx/cifsshare /data/media/0/mounts/cifsshare
[Android Software/Hacking General [Developers Only]] DualJoe:
I think you're missing the mandatory single quotes:

su --mount-master -c 'busybox mount -o username=guest,rw,noperm,iocharset=utf8 -t cifs //192.168.0.xx/cifsshare /data/media/0/mounts/cifsshare'
[Android Software/Hacking General [Developers Only]] Lord_Flaya:
Still shows up empty
[HTC One S] Gman355:
Does anybody know the location of the transmitter on the htc one s, i'm trying to see if theres anything i can do to boost my signal in a couple key areas ie my apartment and at work.
[HTC One S] Darknites:
I believe its at the top and the plastic at the top is part of it too.