简体   繁体   English

将顽固的sdcard目录重新安装回读写

[英]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. 我正在开发一个面向商业市场的应用程序,该应用程序将无法在Play上使用,并且我有一个专门定制的目标设备,但不是我自己设计的。 Certain 3rd party SDK resources need to be installed in the SDCard directory. 某些第三方SDK资源需要安装在SDCard目录中。 That alone is simple to do. 仅此一项就很简单。

The problem I'm facing is that somehow the sdcard directory has been mounted read-only. 我面临的问题是sdcard目录已经以只读方式挂载。 Note there isn't really an sdcard, it's a partition on the internal drive. 请注意,实际上并没有sdcard,它是内部驱动器上的一个分区。 It was actually mount rw at point, something changed and now I'm stuck with read-only sdcard directory. 实际上,它实际上是挂载rw,有所更改,现在我被只读sdcard目录所困。

What I have tried so far: 到目前为止我尝试过的是:

  1. Tried remounting the sdcard mount point. 尝试重新安装sdcard挂载点。 Hasn't worked. 还没工作 Even if i'm logged in as root. 即使我以root用户身份登录。 No errors supplied. 没有提供错误。

    mount -o remount,rw /dev/block/mmcblk1p4 /mnt/sdcard 挂载-o重新挂载,rw / dev / block / mmcblk1p4 / mnt / sdcard

  2. Checked /proc/mounts. 检查了/ proc / mounts。 I can see there in /proc/mounts that sdcard has been mounted ro. 我可以在/ proc / mounts中看到sdcard已被ro挂载。 What I don't know is if there's an fstab equivalent in Android so I change the options. 我不知道是不是在Android中有一个fstab等效项,所以我更改了选项。 I'm told that vold.fstab is where I should go for that but... 有人告诉我vold.fstab是我应该去的地方,但是...

    /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 / 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. 检查了vold.fstab。 That's not the same device shown in /proc/mount. 这与/ 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 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自动/devices/platform/mmci-omap-hs.0/mmc_host/mmc0

  4. Checked logcat output from boot. 检查引导的logcat输出。 Nothing to indicate there was an error for mounting, but then I'm not even sure if mount/vold would report to logcat. 没有任何迹象表明安装有错误,但是我什至不知道mount / vold是否会报告给logcat。 There were however a number of errors that indicated booting applications couldn't write to sdcard. 但是,有许多错误表明引导应用程序无法写入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. 这可以工作一段时间,而且我可以执行一些文件操作,但最终它几乎在几分钟内恢复为RO。

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: 诚然这不是在android上,但我必须安装ntfs-3g并配置fstab:

/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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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