I'm developing an application for commercial market that won't be available on Play and I have a specific target device which was custom built, but not by me. Certain 3rd party SDK resources need to be installed in the SDCard directory. That alone is simple to do.
The problem I'm facing is that somehow the sdcard directory has been mounted read-only. Note there isn't really an sdcard, it's a partition on the internal drive. It was actually mount rw at point, something changed and now I'm stuck with read-only sdcard directory.
What I have tried so far:
Tried remounting the sdcard mount point. Hasn't worked. Even if i'm logged in as root. No errors supplied.
mount -o remount,rw /dev/block/mmcblk1p4 /mnt/sdcard
Checked /proc/mounts. I can see there in /proc/mounts that sdcard has been mounted ro. What I don't know is if there's an fstab equivalent in Android so I change the options. I'm told that vold.fstab is where I should go for that but...
/dev/block/mmcblk1p4 /mnt/sdcard vfat ro,relatime,uid=1000,gid=1015,fmask=0202,dmask=0202,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
Checked vold.fstab. That's not the same device shown in /proc/mount.
dev_mount sdcard /mnt/sdcard 4 /devices/platform/mmci-omap-hs.1/mmc_host/mmc1
dev_mount usbdisk /mnt/sdcard/usbdisk auto /devices/platform/ehci-omap.0
dev_mount extsd /mnt/sdcard/extsd auto /devices/platform/mmci-omap-hs.0/mmc_host/mmc0
Checked logcat output from boot. Nothing to indicate there was an error for mounting, but then I'm not even sure if mount/vold would report to logcat. There were however a number of errors that indicated booting applications couldn't write to sdcard.
I'm super confused at this point. Does anyone know of a sure fire way to fix this?
EDIT:
I've tried different mount options this time
mount -w -o remount /dev/block/mmcblk1p4 /mnt/sdcard
This works for awhile, and I'm able to do a few file operations but It eventually reverts back to RO, almost within a couple of minutes.
Managed to solve the problem. The file system had been corrupted thus the system forced remount to read-only. The simple fix was to recreate the file system.
admittedly this wasn't on android but i had to install ntfs-3g and configure fstab thus:
/dev/sda1 /media/mycard ntfs-3g rw,umask=0000,defaults 0 0
or mount with
mount -t cifs -o uid=1000 /dev/sda1 /media/mycard
Related
my Samsung S2 does not boot anymore because I deleted the file
/system/fonts/Roboto-Regular.ttf
I have a copy of this file as
/system/fonts/Helvetica.ttf
How can I copy Helvetica.ttf to Roboto-Regular.ttf in recovery mode?
I have a rooted phone and use PhilZ-cwm6-XWMS2-MOT-5.15.9
Thanks for any help.
I could solve the problem myself.
For anybody having a similar issue:
As mentioned above, I use the rooted kernel PhilZ-cwm6-XWMS2-MOT-5.15.9.
This can also be installed by a zip-file within the recovery mode.
The simple solution now was to modify the shell-script inside this zip-file:
At the end of this shell-script, right before the "exit"-command, I wrote the following shell-commands
# to be sure that /system (still) is mounted read-write:
mount -o remount,rw /system
# copying the font-file:
cp /system/fonts/Helvetica.ttf /system/fonts/Roboto-Regular.ttf
Then I only had to copy the modified zip-file to a micro-sd-card, insert this into the phone, start recovery mode, where I chose from the menu: install zip-file > (external) sdcard > install ...
Then I rebooted the phone, et voilĂ .
Of course, this also reinstalled the kernel, which was not needed but also not a problem to me. (Before doing the above I tried to start a very simple script in a custom zip-file with the "install zip-file" command, to prevent going through the whole procedure of kernel-installation, but did not succeed with this trick. Maybe someone else can find a way.)
I need help figuring out how to install a Google Apps .zip (or gapps package) on an Android device without using recovery. I have not seen this process documented anywhere, and before I go manually copying files from the zip onto a device, I'd like to see if anyone can give me some guidance. The device in question is rooted, but installing a custom recovery (such as Clockwork) is not an option. It seems straightforward enough (as the zip's internal file structure is recognizably an android fsh), but before I go and happily copy a bunch of files to a critical test device I'd like some input as to whether or not there is a preferred method.
It's a little late but i have done this yesterday because i have the same probleme.
The option i use is open a root shell with adb.
Then use the linux mount command
I don't remember the exact command but it's look like this:
"mount -o remount,rw ext4 /system"
And then i copy the file of the system folder of the gapps zip to /system then i reboot my phone and all gapps were installed
Hope it help you or someone who found this like me in the futur.
I want to push a *.mp3 file in to my emulator, but it gives me these 2 errors:
transfer error: Read-only file system
Failed to push selection: Read-only file system
To resolve the problem, i have done these works, but still not working:
1-Using CMD to do this: c:\android-sdk\platform-tools\>abd remount
2-Add these 2 lines to the AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
3-Set the SDcard in emulator configuration as 1024 Mb
The thing that makes me wonderful is that the sdcard folder in file explorer has all the necessary permissions
Here is a solution I found in other site, which is the only way that worked in my case:
In a terminal (I work on Mac OS X) I wnt to sdk/platform-tools directory (to get access to the adb shell) then I typed the following commands:
./adb shell
su
mount -o rw,remount rootfs /
chmod 777 /mnt/sdcard
and then typed exit to exit su, and exit again to exit the adb shell.
#atisman's answer got me working. There are two small bits to add to his response though:
First, picky as it seems, you might need an extra '-' in the unix command line, depending on your local OS. The only way it would work for me was:
mount -o -rw,remount rootfs /
The other item is to make sure you have actually defined the device's SD card with some size. I see you have, but I didn't, so just putting it out there in case anyone else has a similar issue.
Open AVD manager, click on the device you are using... click 'edit' and go to the "SD Card" area. Make sure if "Size" is clicked, that there is a number in the area next to it. Otherwise the SD card can't hold any info.
if some one have same problem in new build of studio . 0.8.9 and above see my solution and it will work like a charm , here : afra mehrparvar solution in the bottom of the page .
Android Emulator sdcard push error: Read-only file system
I am using an ARM full-system simulator (gem5) to run Gingerbread. The Gingerbread image was obtained from the gem5 website, but it is a standard.
Most apps of my interest need an sdcard, so I added "mount -o loop /system/sdcard " to the init.rc file on my Android image. When I boot the simulated system, the applications complain about sdcard not being present on the system.
Does Gingerbread's mount (from toolbox or busybox) support loop mounting image files?
Going by this link, it seems the busybox version used by Gingerbread does have an issue with loop mounting, but I cannot make out if that is the sole issue. If so, how do I replace the busybox version on an Android filesystem? Can I just replace the busybox binary with a newer one?
Let's say you already have a vfat partition image like /sdcard.img, in init.rc you can try adding this:
mount vfat loop#/sdcard.img /mnt/sdcard
Source: https://sourceforge.net/p/ipaq214android/blog/2012/05/mounting-loopback-device-by-initrc/
I have created a directory in my app's internal storage (/data/data/com.my_app) and gave global read/write permissions to the directory via the method
context.getDir(DATA_DIR_NAME, Context.MODE_WORLD_READABLE | Context.MODE_WORLD_WRITEABLE);
Through my app, I verified that the linux file permissions are correct:
drw-rw-rw- app_71 app_71 2010-11-16 18:38 app_data
And I was able to read/write files in-to/out-of the directory app_data just fine. However, one of my developers suddenly wasn't able to write to the directory anymore. Our application has trouble accessing the directory on his device as well.
The strange thing is that the file permission for the directory is still the same. We can't do any sort of writes to the directory, and we can't read any files within the directory anymore either (the files were given global rw permission previously).
The only thing we can do is adb shell ls /data/data/my_app/app_data to see our list of files. Doing adb shell ls -l /data/data/my_app/app_data strangely doesn't return anything. And we can't CD into the directory either.
Does anyone have any pointer on what the problem is or how to solve this? We are at our wit's end.
Much appreciated.
Directories need to have the execute (X) bit set to be able to access the contents of the directory. I don't know the android modes, but look for MODE_WORLD_EXECUTABLE and see if you can set that.
Basically, you need mode 0777 (rwxrwxrwx) for a directory to be globally accessed with all permissions.
The reason ls works is that you have permission to read the filenames in the directory. ls -l does not work, because you cannot access the files in the directory to get the metadata that -l will print.