简体   繁体   中英

remounting a stubborn sdcard directory back to read-write

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:

  1. 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

  2. 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

  3. 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

  4. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM