Mount Sambashare on Android Rooted - General Questions and Answers

Hello, I have a Xiaomi Redmi Note 9 Pro rooted with magisk and some mods installed.
I wondering if is it possible to mount permanently (with the "fstab" under android) a samba hare in the /storage as a external sd_card and use it as a r/w point.
I've tried to use
Code:
su -c mount -t cifs //<my_adress> /storage/test
in termux but mount doesn't recognize address location.
I probably need to change my command line or install some sambaclient/cifs mod.
Do anyone know how to do this ?
Thanks

Related

[Q] KatKiss ROM 4.2.2 - Asus TF101 - Native CIFS?

Hi guys,
Yesterday, I just flashed the rom KatKiss-4.2.2_226.zip to my TF101. Everthing is working fine but I can't mount CIFS share like a local file system. First of all I was formating /system before flashing the rom and the gapps and after I made a Wipe cache/Dalvik... I think it's the usually way... Right? OK. The device work properly.
My next step was try to mount a CIFS share from my NAS. I want to mount something like //192.168.1.45/media to /sdcard/media in the local storage. Before to try in androd I tried it in Ubuntu and works with the user "guest" in read only:
# mount -t cifs //192.168.1.45/media /tmp/a -o username=guest
When I tried to do it in Andorid I found several errors. At the begin I was thinking in the cifs.ko/md4.ko and nsl_utf8.ko modules but I readed that the ROM have it in the kernel. Not like a module. When I try in the Android's command line I get error like "Key has Expired". I found that this error is allied by the multiuser feature of Android 4.2 and CIFS. Something about the user spaces in the storage.
And now the question: Is it a problem with the modules or a problem with the mounting of CIFS shares in Android 4.2?
Thanks in advances!!
Regards
abocaman said:
Hi guys,
Yesterday, I just flashed the rom KatKiss-4.2.2_226.zip to my TF101. Everthing is working fine but I can't mount CIFS share like a local file system. First of all I was formating /system before flashing the rom and the gapps and after I made a Wipe cache/Dalvik... I think it's the usually way... Right? OK. The device work properly.
My next step was try to mount a CIFS share from my NAS. I want to mount something like //192.168.1.45/media to /sdcard/media in the local storage. Before to try in androd I tried it in Ubuntu and works with the user "guest" in read only:
# mount -t cifs //192.168.1.45/media /tmp/a -o username=guest
When I tried to do it in Andorid I found several errors. At the begin I was thinking in the cifs.ko/md4.ko and nsl_utf8.ko modules but I readed that the ROM have it in the kernel. Not like a module. When I try in the Android's command line I get error like "Key has Expired". I found that this error is allied by the multiuser feature of Android 4.2 and CIFS. Something about the user spaces in the storage.
And now the question: Is it a problem with the modules or a problem with the mounting of CIFS shares in Android 4.2?
Thanks in advances!!
Regards
Click to expand...
Click to collapse
You need to mount it outside of /storage/* or /mnt/shell/*
timduru said:
You need to mount it outside of /storage/* or /mnt/shell/*
Click to expand...
Click to collapse
Hi timduru,
thanks for your cooked rom!! Is really brilliant!! Keep the good work. And thanks for the solution. Just now I'm trying and the cifs mount work very good. My fault was to try to mount the folder in the path. For exemple:
busybox mount -t cifs //192.168.1.69/media/Comics /storage/sdcard0/Comics -o username="user",pass="your password" <-- Not work
busybox mount -t cifs //192.168.1.69/media /data/media -o username="user",pass="your password" <-- Work
And then try in cifs manager and work perfectly!! Always mounting the share without folders in the path, and mounting it in the /data as a destination.
Thank you very much!!:good::good::good::laugh:

[Q] Rooting Arnova84

Hi,
I just bought a cheap simple ARNOVA84 tablet (for 50 €) with android 2.1 to play a little bit and gather experience regarding rooting before I do this on my acer A511
I came so far, that I got adb shell with root ($ -> #). But to get SuperUser or SuperSU running I need also su in /system/bin. But /system is ro. The command
# mount -o rw,remount /dev/mtdblock4 /system
does not work in any combination. I get no error, but
# mount
still shows /system ro
To remount /system google said, I would need su, which in turn I don't have yet I copied su binary to another folder and changed permission to 755. But nevertheless su seems not to work. It just gives me new line with no # and everything I type in, is repeated. I have to break shell with ctrl-c.
The /system is a cramfs and my latest information is, that cramfs is always ro and can not be changed.
1. Is this true and does it mean I can root my tablet only be upgrading it with a modified update.img containing su etc.?
2. Is there no other more safe way to root such device?
3. Does this also mean more modern tablets have another filesystem for /system?
thanks!
Rainer

[Q][Solved][XT897] cifs module for CM 11 (3.0.101 Kernel)?

Hi
I updated my Phone via CyanogenMod Updater .
So i get the "official" CyanogenMod 11-20140104-SNAPSHOT-M2-xt897 with
3.0.101-gbfa6ebb ([email protected] #1) Kernel.
Is a NFS/CIFS module available or
would someone be so kind to compile one =) ?
thx
Fr4nz84 said:
Hi
I updated my Phone via CyanogenMod Updater .
So i get the "official" CyanogenMod 11-20140104-SNAPSHOT-M2-xt897 with
3.0.101-gbfa6ebb ([email protected] #1) Kernel.
Is a NFS/CIFS module available or
would someone be so kind to compile one =) ?
thx
Click to expand...
Click to collapse
Why the quotes around "official"?
Cifs and nfs support is built-in, there's no need for additional loadable kernel modules (you can check https://github.com/CyanogenMod/andr.../arch/arm/configs/msm8960_mmi_defconfig#L3091 )
If mount fails for you, try busybox mount.
Btw., after CM11 M2, Motorola msm8960 2012 devices were unified under moto_msm8960 moniker in CM11.
Later, after the release of the official KitKat update for only a subset of the devices being part of the moto 2012 family, xt897 builds went under moto_msm8960_jbbl (jellybean bootloader) unified builds.
So the latest CM11 builds for xt897 can be found here: http://download.cyanogenmod.org/?device=moto_msm8960_jbbl
For CM12, the builds were separated again, so CM12 builds for xt897 can be found again under http://download.cyanogenmod.org/?device=xt897
A other problem?
Thanks kabaldan.
So then I hava a other problem.
What have I done:
I installed SuperSU v2.46 via OpenRecovery-
I installed BusyBox Free after reboot
In terminal I execute:
su -c setenforce 0 && su --mount-master -c mount -o username=franz,password=XXX,rw,noperm,file_mode=0777,dir_mode=0777 -t cifs //192.168.100.150/daten0 /sdcard/cifs/daten0
I see SuperSU granting access for setenforce and mount.
But the directory is still empty with or without root.
So I was assuming cifs was missing.
What else could be the problem?
It shouldn't a problem on the sever side. I can access it via Windows 7, n900 (maemo) and a cheap Q29 (Android 4.0.4).
P.S.:
Sorry, the quotes was a stupid idea. I was trying to say it’s not the original installed OS.
But it’s simply the stable CyanogenMod 11 via updater. No ROM or whatever.
I've always accessed CIFS shares thru an app like ES File Explorer. Works fine.
Fr4nz84 said:
Thanks kabaldan.
So then I hava a other problem.
What have I done:
I installed SuperSU v2.46 via OpenRecovery-
I installed BusyBox Free after reboot
In terminal I execute:
su -c setenforce 0 && su --mount-master -c mount -o username=franz,password=XXX,rw,noperm,file_mode=0777,dir_mode=0777 -t cifs //192.168.100.150/daten0 /sdcard/cifs/daten0
I see SuperSU granting access for setenforce and mount.
But the directory is still empty with or without root.
So I was assuming cifs was missing.
What else could be the problem?
It shouldn't a problem on the sever side. I can access it via Windows 7, n900 (maemo) and a cheap Q29 (Android 4.0.4).
P.S.:
Sorry, the quotes was a stupid idea. I was trying to say it’s not the original installed OS.
But it’s simply the stable CyanogenMod 11 via updater. No ROM or whatever.
Click to expand...
Click to collapse
CM11 M2 is quite old, so I can't be 100% sure it worked there, but I'm convinced that it worked fine even on such old build.
I mount cifs shares quite regularly on my xt897, so I guess I would have noticed if it was not working anymore in any milestone build.
Regarding SuperSU and BusyBox Free - there's no need to install anything like that, CM has built-in su and also busybox.
I'm on CM12 and I don't plan to restore CM11 any time soon (and certainly not M2, if anything it would be moto_msm8960_jbbl M12 or a recent moto_msm8960_jbbl nightly), but something like this has always worked for me:
Code:
su
mount -o username=franz,password=XXX,rw,noperm,file_mode=0777,dir_mode=0777 -t cifs //192.168.100.150/daten0 /sdcard/cifs/daten0
I've just tested it (indeed with my own server path and user credentials) and it works fine.
To use busybox for mount, just replace "mount -o..." with "busybox mount -o..."
The stock CM busybox resides in /system/xbin , btw.
@arrrghhh good tip! Compared to AndSMB I can at least look at pictures without downloading with hand.
@kabaldan
You are totally right with cat /proc/filesystems I can see the Kernel supports cifs.
I had to install SuperSu because there was no su in terminal available.
After playing around, I was able to mount with:
mount -o username=franz,password=XXX,rw,nodev,relatime,default_permissions,allow_other -t cifs //192.168.100.150/daten0 /sdcard/cifs/daten0
But it’s only available to the terminal where I executed the command. Do I have multiple root users?
I don’t know something in my system feels wrong.
Could there some other security policy I am not aware of?
It works now. It seems it was a update problem.
I wipe/clean the system with Open Recovery
removed all Files and Folders in /system (To remove old apps especially SuperSu)
And installed cm-11-20140104-SNAPSHOT-M2-xt897.zip again with Open Recovery
Now su is there on start and root is managed by the System. And I can mount cifs normally.
Whatever, now the shell seams not proper configured so I get this ^[[A^[[D^[[C for arrow keys, in su.
Also I can't get Link2Sd to work because mount give me constantly "invalid argument"( not more) even when I try it on console. Fells like it don’t want me to mount my second partition.
OK is a problem with the SD Card mount works normally. I tested it with another sd card.

Cannot remount /system partition even when rooted (Sony xperia M2)

I have a Sony xperia M2 D2303 with kitkat 4.4.4 and compilation number 18.3.1.C.1.17.
I have successfully rooted it using KingRoot v4.9.5.
Also I have checked that system is rooted using tools such as root checker and it says rooted.
Now, I am trying to remount /system partition as RW but without succcess.
I have googled and tried several solutions posted here but nothing works for me.
Access to /sys/kernel/security/sony_ric and try to disable sony ric security using:
problem here is that sony_ric folder is empty, I mean, there is no "enable" file and I cannot create it as partition is RO (read-only).
Using ES file explorer or other file explorers as root I have tried to remount partition as RW but it fails.
Code:
echo 0 > enable
Using ROM Toolbox pro, and then from terminal emulator I have tried some commands:
Code:
su
mount -o remount,rw /system
fails.
Code:
su
system/bin/mount -o remount,rw /system
also fails.
Code:
adb shell
su
mount -o rw,remount /system
also fails...
I have tried to install busybox but it fails as well.
I have tried the method explained here but when executing the command:
sh /sdcard/mrw/root.sh
some errors appear as script tries to do things in /system so since it is read-only (not rw) it fails.
Also I have tried the method using SuperSu-me explained here but without success. It completes ok but then SuperSu is executed automatically. SuperSu says to update binaries so I update binaries, then another screen comes saying that another root app was detected, so I press the button to uninstall it and continue installing SuperSu. SuperSu says "Installing ........" and then it crashes, that is, it appears a screen with two buttons, "How to update" and "Reboot". Kingroot, purify apps continued installed and working, and I cannot replace them with SuperSu.
So at this point I have no idea what to do...
My conclusion is that all these tools need to make changes to / and /system but since I have these two partitions set to read-only (cannot make them rw) then all these tools fail. So I think the main cause is that I have / and /system readonly.
Any help will be highly appreciated.
Please, help!

Troubles Mounting System R/W

For some reason I have never been able to mount my system r/w through adb or terminal emulator. I'm not quite sure what I'm doing wrong since I've been doing it for years now. I imagine it has to do with root. I can use ES file explorer and modify system to my hearts content just not through adb or terminal emulator. I am on 7.1.1 Pure Nexus with ElementalX 1.08 and SuperSU with 2.79 binaries. I've tried to mount multiple different ways and all result in same error.
Code:
sailfish:/ # mount -o remount,rw /system
mount: '/dev/block/bootdevice/by-name/system_b'->'/system': Device or resource busy
Nvm found it. I guess it's same as Pixel C.
Code:
mount -o rw,remount /system
Geofferey said:
For some reason I have never been able to mount my system r/w through adb or terminal emulator. I'm not quite sure what I'm doing wrong since I've been doing it for years now. I imagine it has to do with root. I can use ES file explorer and modify system to my hearts content just not through adb or terminal emulator. I am on 7.1.1 Pure Nexus with ElementalX 1.08 and SuperSU with 2.79 binaries. I've tried to mount multiple different ways and all result in same error.
Code:
sailfish:/ # mount -o remount,rw /system
mount: '/dev/block/bootdevice/by-name/system_b'->'/system': Device or resource busy
Click to expand...
Click to collapse
Same here but with Oneplus 3T.
I think its kind of encripted "new way" in Android 7.1.1
Also, if you check the magisk thread there is a way to use the mount remount command inside root browser
mate9-109 said:
Same here but with Oneplus 3T.
I think its kind of encripted "new way" in Android 7.1.1
Click to expand...
Click to collapse
Nope just a different mount syntax not encrypted at all. I was kinda thinking same at first like a security feature or root keeping you from so you don't accidentally modifying system.
mount -o rw,remount /system
Instead of
mount -o remount,rw /system
Geofferey said:
Nope just a different mount syntax not encrypted at all. I was kinda thinking same at first like a security feature or root keeping you from so you don't accidentally modifying system.
mount -o rw,remount /system
Instead of
mount -o remount,rw /system
Click to expand...
Click to collapse
Sadly I tried your new syntax, adb did some stuff, but it does not work either.
Anyway thank you very much, your solution almost got it.
:good::good::good::good::good:

Categories

Resources