[Q] CIFS mount command with write permission - Android Q&A, Help & Troubleshooting

Hi,
I've been fighting with this for weeks, and I can't seem to get it work.
Situation:
I want to make my Xperia T (CM12.1) into a usenet download machine. I'm hoping to download local, and extract external to my share.
So far I've managed to mount the share, but anything I try won't give an App write permission. I've used ES File Explorer in Root Explorer mode to write, which works, but the specific app for usenet downloading doesn't need root, so it can't write to the share.
What I've tried:
Moving the App to system
Gave him all kinds of write permissions
Changed owner and group from system to root and vice versa
Used several kinds of mount commands
Used several mounting locations (folder on SD, folder in /mnt/remote dir, etc)
Adding the user id (uid) to the mount command, to target the mount for this specific user (which the basic terminal app gave me back as something like 1 and another said my uid was 2 for example, so that's wonderful...)
Adding the Domain of the user of the share
This is my mounting script:
Code:
su --mount-master
mount -o unc=\\\\192.168.*.*\\share1,username=Rubenos,password=*****,uid=1,gid=1,rw,nounix,iocharset=utf8,noperm,file_mode=0777,dir_mode=0777 -t cifs none /mnt/network/share1
I'm executing this from the terminal app within CM.
What am I missing here?
Thx!

Bump

Hi. I've had the same issue on Nexus 5.
Looks like the root of the problem is SELinux. You need to flash an insecure kernel and disable SELinux enforced mode.
Obviously it's not a perfect solution and maybe someone will suggest a better idea how to fix it.

Related

Setting system root as RW default

Hey there?
I've got a question which I can't seem to find anywhere else and YES I have searched this forum and google. However, I may miss it.
Anyway, I've mapped my android phone as a network drive using Samba and changed the smb.conf file to show the System Root directory as well. However, system root is default set as R/O so to mange files USING my computer I need to change the permission to R/W using a file manager (such as root explorer). This is annoying, as I have to keep doing this in order to write to certail directories.
What I wish to do is create a massive guide on all of this to help out the community, however I need one little bit of information.
I would like the / directory (root) to be mounted as R/W as default so that I can quickly edit files on my PC without having to constantly change it to R/O.
If this has been answered before, I do apologize.
Thanks in advance.
Regards,
xxSHABSxx
EDIT:
To make things a bit clearer.
I want something that will automatically mount my phone's root dir into rw upon boot, without custom apps/having to manually mount as rw everytime it reboots. And yes I understand there are apps that do this.
Yes, the root file system is read-only, but it's also volatile. It's restored from the initramfs in the boot image each time you reboot the phone, so only mounting it writeable, doesn't do you very much anyway.
In /init.rc you find a line:
Code:
mount rootfs rootfs / ro remount
This remounts your root read-only. Remove this, and it'll stay writeable. But again, all edits to the root file system are volatile. To change this, you must flash a new boot.img
An easier way would be a root-app remounting it writable again after boot.
kuisma said:
Yes, the root file system is read-only, but it's also volatile. It's restored from the initramfs in the boot image each time you reboot the phone, so only mounting it writeable, doesn't do you very much anyway.
In /init.rc you find a line:
Code:
mount rootfs rootfs / ro remount
This remounts your root read-only. Remove this, and it's stay writeable. But again, all edits to the root file system are volatile. To change this, you must flash a new boot.img
An easier way would be a root-app remounting it writable again after boot.
Click to expand...
Click to collapse
Ahh I figured as much, since Google didn't offer any solutions to me. And flashing is way much more effort than simply having an app that does it for you.
Anyway thanks for the reply!
xxshabsxx said:
Ahh I figured as much, since Google didn't offer any solutions to me. And flashing is way much more effort than simply having an app that does it for you.
Click to expand...
Click to collapse
Or do like I did, move the root to a real ext3 non-volatile file system instead.

[Q] not able to mount system as read/write properly

Hey guys,
I'm having a problem with ES file explorer. After several days I managed to root my HUawei U8800 Ideos X5 (Android 2.3.5) and obviously one of the next steps is installing CWMR. Unfortunately I'm failing here too. I tried to copy the recovery.img to the .cust_backup/image, but it keeps to say copy failed. Root access was given and I checked all four boxes in root settings. Someone in a german forum told me to update the binarys in SU, which failed too (it says sth like copy su to /system -> failed!). I'm not even sure ES FE would work if the binarys would be current.
Is there someone who can help me? Any ideas?
I already tried the app Mount /system (rw / ro). It didn't work with this too.
Thanks a lot.
no ideas?
You must have the /system folder mounted for read and write, default is read-only.
Different folders in the file structure could be located on different file systems, the easiest way to be sure that you have read and write access were you want to put files, imho, is by using root explorer.
If you are rooted and ES have root permissions then the problem is that the folder is non-writable. I don't know the app you tried to use to mount the /system as r/w but it's easy to do in root explorer or through adb shell with a little bit of *nix knowledge (su and mount -o remount,rw).
Should work from terminal emulator app as well.
C:\Users\...>adb push C:\recovery.img /.cust_backup/image/
failed to copy 'C:\recovery.img' to '/.cust_backup/image//recovery.img': Read-on
ly file system
before I typed
adb shell
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Doesn't work. adb etc. is installed.
I'm really desperate about this now, I think something is really wrong with my system partiture or something like that. I consider formatting it, the problem I obviously have is that without CWMR I have no clue how to do that and how to flash an OS after it. Does someone have ideas about the whole issue? Interesting facts about my device: Often I'm not able to flash a stock ROM, it stops somewhere in the middle of the process. Rooting works often, but not always with SuperOneClick or zergrush. At the moment my superuser app says "root app_63" in a red font instead of "root root" in a green font, at least I have current binaries at the moment, but this doesn't work always as well. Seems like I am pretty alone with all these problems, that's why I want to format /system...
Please help me! Thanks
Give root explorer a try!
Sent from my OC ed mind.!
Why would you think that would work? ES File Explorer does basically the same...
Dont EVER try to format /system or u r gonna end up completely bricked. Just take your phone to a service centre and see what can be done. If you are under warranty, replace the mobile.
Hope i helped .
Sent from my GT-S5360 using XDA-Developers App.

[Q] Unable to change file permission on rooted Samsung Galaxy S III

Hi,
I tried changing file permission on one of the folders where I saved my photos to read-only using "Root Browser Lite".
The following error message came up: "Changing permission was not successful. Please note that some file systems do not allow permission changes".
I tried using ES file explorer but it also failed.
Could someone please tell me how I could change the file or folder permission. I wanted to prevent the photos from being accidentally deleted by my children when I let them browse their photos..
My phone I9300 was rooted using CF Auto Root.
Thanks
Get root explorer, it's much better.
Simply long press on a folder and the permissions option is there.
Sent from my GT-I9300 using xda premium
Don't forget to set to rw at the top of root explorer before attempting to change permissions
If you're talking about the internal memory, you can do chattr +i /data/media/[name of folder] to set the immutable bit. EDIT: You need BusyBox installed for the chattr command
This works because /storage/sdcard0 (JB's usual mountpoint for the internal eMMC) is a fake FAT32 file system Google created for compatibility; the internal eMMC can really be found at /data/media, which is of the ext4 filesystem.
For the external memory, you can try SGS3 Easy UMS and set the read only property on the folder using your computer. (I can't find mattrib for Android.) There is no guarantee that Android/Linux programs will obey the RO attribute, however.
The reason why Root Browser Lite & ES File Explorer didn't work is because they work on UNIX file permissions, while a file system formatted using FAT obviously doesn't understand them - it would expect DOS/FAT attributes. That said, though, have you already backed up the data you consider to be important?
100% work
Try this.....
http://forum.xda-developers.com/showthread.php?t=2038243
this will help you 100%..
qwerty12 said:
If you're talking about the internal memory, you can do chattr +i /data/media/[name of folder] to set the immutable bit. EDIT: You need BusyBox installed for the chattr command
This works because /storage/sdcard0 (JB's usual mountpoint for the internal eMMC) is a fake FAT32 file system Google created for compatibility; the internal eMMC can really be found at /data/media, which is of the ext4 filesystem.
For the external memory, you can try SGS3 Easy UMS and set the read only property on the folder using your computer. (I can't find mattrib for Android.) There is no guarantee that Android/Linux programs will obey the RO attribute, however.
The reason why Root Browser Lite & ES File Explorer didn't work is because they work on UNIX file permissions, while a file system formatted using FAT obviously doesn't understand them - it would expect DOS/FAT attributes. That said, though, have you already backed up the data you consider to be important?
Click to expand...
Click to collapse
=============
Thank you all for your advice. The file system explanation betw FAT and ext4 fs makes sense. I have BusyBox installed.
Via Terminal Emulator, when I did "chattr -i /data/media/DCIM/Camera", I got a "permission denied".
Is there something that prevented me from this?
I'm running ICS.
Thanks
Did you type su before the command..
Just asking..
sent from here, there, somewhere!!
zoot1 said:
Did you type su before the command..
Just asking..
sent from here, there, somewhere!!
Click to expand...
Click to collapse
Thanks Zoot1.
I did that.
Image Gallary is still showing /mnt/sdcard/DCIM/Camera as "writeable".
What is the difference between two folders /data/media/DCIM/Camera and /mnt/sdcard/DCIM/Camera?
Thanks,
Note that I used +i in my example invocation of chattr. - removes the attribute; + sets it, which is what you want
Sent from my GT-I9300 using Tapatalk 2
Thanks qwerty12, after 'chattr +i folder name' , I return to root browser lite to change permission on mnt/sdcard/DCIM/Camera, I still get permission denied. What did I do wrong?
Sent from my GT-I9300 using xda app-developers app
Mount System RW
The problem is that your system is currently in RO (Read-Only) mode.
Even if you are root, can't mess with system files if the setup is like that.
ES File Explorer works because it has an option (that DOES work) to mount the system in RW (Read-write) mode.
On my ES File Explorer Version 3.0.0 it goes like this:
Android menú button--->Tools---->Root Explorer--->Mount R/W.
Set: /system (or all of the options) to: RW----->OK.
Now, explore your files using the ES File Explorer interface on your phone and you should be able to erase every file and apk you want even if they are system files.
Vanyna said:
The problem is that your system is currently in RO (Read-Only) mode.
Even if you are root, can't mess with system files if the setup is like that.
ES File Explorer works because it has an option (that DOES work) to mount the system in RW (Read-write) mode.
On my ES File Explorer Version 3.0.0 it goes like this:
Android menú button--->Tools---->Root Explorer--->Mount R/W.
Set: /system (or all of the options) to: RW----->OK.
Now, explore your files using the ES File Explorer interface on your phone and you should be able to erase every file and apk you want even if they are system files.
Click to expand...
Click to collapse
finally its worked for me thx very much dude:laugh::good:

[Q] 4.0.3 HTC Temp Root Question

Hello everybody,
i have gained root access to my phone via backup/restore method through adb where local.prop is stored in /data/. So when i log onto my phone with adb i have root access. I copied busybox, su and the superuser.apk to the right place and removed the local.prop file again. After a reboot I was hoping to remove some crapware off my phone but to my surprise the binaries i copied vanished from the filesystem. So the phone reverted the changes by itself. I did this process several times copying busybox and su to various places referred to by $PATH, but it´s everytime the same after i reboot. The files are gone.
After the first attempts failed i tried to make changes to my phone while logged in as root. I wanted to uninstall unnecessary packages with "pm uninstall" but that failed also. The command just responds "failed". Even when /system is mounted rw (it remounts itself to ro after a while though). I´ve also made changes to /init.rc but they are also gone after a reboot as other changes i´ve made. Basically i wasn´t able to accomplish anything with root access no matter what i did.
So what i want to know is how this black magic works andy why i cant do anything with root. I know how to achieve real root through htc dev and various other methods.
Thanks for reading!
nasenstueber said:
Hello everybody,
i have gained root access to my phone via backup/restore method through adb where local.prop is stored in /data/. So when i log onto my phone with adb i have root access. I copied busybox, su and the superuser.apk to the right place and removed the local.prop file again. After a reboot I was hoping to remove some crapware off my phone but to my surprise the binaries i copied vanished from the filesystem. So the phone reverted the changes by itself. I did this process several times copying busybox and su to various places referred to by $PATH, but it´s everytime the same after i reboot. The files are gone.
After the first attempts failed i tried to make changes to my phone while logged in as root. I wanted to uninstall unnecessary packages with "pm uninstall" but that failed also. The command just responds "failed". Even when /system is mounted rw (it remounts itself to ro after a while though). I´ve also made changes to /init.rc but they are also gone after a reboot as other changes i´ve made. Basically i wasn´t able to accomplish anything with root access no matter what i did.
So what i want to know is how this black magic works andy why i cant do anything with root. I know how to achieve real root through htc dev and various other methods.
Thanks for reading!
Click to expand...
Click to collapse
is your RECOVERY.img
and beside i dont really think your /system is fully mounted rw
mauricio.valladolid said:
is your RECOVERY.img
and beside i dont really think your /system is fully mounted rw
Click to expand...
Click to collapse
Thanks for the reply. i use mount -o remount,rw /system as mount command to get read/write permission on /system. If there is something more to do please let me know. And if the behavior i ve seen is caused by the recovery.img is there something i can do about it?
nasenstueber said:
Thanks for the reply. i use mount -o remount,rw /system as mount command to get read/write permission on /system. If there is something more to do please let me know. And if the behavior i ve seen is caused by the recovery.img is there something i can do about it?
Click to expand...
Click to collapse
why dont you just install ext4 recovery and flash supersu.zip?
I really dont get it why are you trying to do it the hard way

[Q] [help]how to get system folder permission for hdx7

I just play andorid device a few days, but My hdx7 is a little bricked because i deleted some system app. Now I can log in fire os, have adb, usb connected and internal storge, even i can operate device setting app, but i can't open the other app because i don't have a desktop.
I compare system/app folder with the same folder in the amazon bin, found that the folder lack of scores of app, but the other system folder is the same. So I hope can adb push app folder to the system folder, but the pemission denied. I try to remount or mount, it can't work.
if adb root, then "adbd cannot run as root in production builds.
if adb push apk to the app folder, then “permission denied".
if adb remount, then ”remount failed: Operation not permitted".
and I have try adb shell like that:
# su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system
# exit
it didn't work.
my hdx7 have rooted.
My Questions are:
1. If I could push the app folder to the system folder and reset to factory, is my hdx saved?
2. How to get the system folder rw in the situation?
thx for any prompt, although i am a rookie but i will try my best, i wish the adept can help me and will be enormously grateful. Sorry for my poor english.
It sounds to me that you had lost root.
kschang said:
It sounds to me that you had lost root.
Click to expand...
Click to collapse
So i have tried root again like "http://forum.xda-developers.com/showthread.php?t=2544965" said
But it didn't work, please see the attach, But I don't know why.
Sorry for that i'm rookie to andorid and ask so many questions.
randolphling said:
So i have tried root again like "http://forum.xda-developers.com/showthread.php?t=2544965" said
But it didn't work, please see the attach, But I don't know why.
Sorry for that i'm rookie to andorid and ask so many questions.
Click to expand...
Click to collapse
Hmmm... It says you still have root (the prompt changed after "su")
I personally don't use ADB much. I have Root Explorer (grabbed it legally for free from Amazon ages ago) and Wifi Explorer Pro (same method) so I basically WiFi myself the files I need sideloaded then move them around on the device itself. But if you've lost launcher, you have deeper issues.
Have you tried ADB push any launcher? Or even a download store like 1Mobile or Aptoide?
ADB is basically a Linux shell debug into Android, so you need to learn some Unix shell commands. I'm sure you can find ADB guides with the basic commands, like "ls", "cp", and so on.
You need to check the directory and see if the system/app and other system directories are still there. This is one reason I only play with the copy of ROM I have (see Safestrap Recovery).

Categories

Resources