使用 vold 在 Android 设备上挂载第二个分区
我想在运行 Virteous Unity 1.3.0 ROM 的 HTC Vision 的 SD 卡上访问 ext4 分区,而无需使用 Data2SD。我将我的 /system/etc/vold.fstab
文件从以下位置修改为:
dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0
/devices/platform/msm_sdcc.4/mmc_host/mmc2
这样
#dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0
/devices/platform/msm_sdcc.4/mmc_host/mmc2
dev_mount sdcard /mnt/sdcard 1 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.4/mmc_host/mmc2
dev_mount e4vol /mnt/sdcard2 2 /devices/platform/goldfish_mmc.0
/devices/platform/msm_sdcc.4/mmc_host/mmc2
我就可以得到我的第二个分区,带有标签 e4vol,在我的 Android 设备上安装并可用。有两个问题,我认为其中一个显然与另一个有关。
- 我尝试重新挂载根读写并创建挂载点
/mnt/sdcard2
,但它在重新启动后消失了。似乎 Android 过去可能使用mount.conf
创建了此类安装。现在 Gingerbread ROMS 上不存在它。想法? - 这是我在 Android 中安装第二个分区所需要做的全部事情,还是我还需要像
/sdcard
一样创建/sdcard2
?我认为两者都是由 vold 创建为符号链接,如该conf 文件中指定的那样,但我还没有时间检查。
我会询问论坛,但这似乎是一个开发人员问题,而且这是操作系统的最新版本。操作系统的不同版本似乎有很大变化。预先感谢您的耐心和帮助。
更新:因此,将测试挂载移动到 SD 卡,但即使使用持久挂载点,它也不起作用。所以,不确定我哪里出错了。
I want to have access to an ext4 partition, without using Data2SD yet, on the SD card of my HTC Vision running the Virtuous Unity 1.3.0 ROM. I modded my /system/etc/vold.fstab
file from this:
dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0
/devices/platform/msm_sdcc.4/mmc_host/mmc2
To this:
#dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0
/devices/platform/msm_sdcc.4/mmc_host/mmc2
dev_mount sdcard /mnt/sdcard 1 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.4/mmc_host/mmc2
dev_mount e4vol /mnt/sdcard2 2 /devices/platform/goldfish_mmc.0
/devices/platform/msm_sdcc.4/mmc_host/mmc2
So I can get my second partition, with label e4vol, mount and usable on my Android device. Two issues, and I think one obviously has to do with the other.
- I have tried remounting the root read-write and creating the mount point
/mnt/sdcard2
, but it is gone on reboot. Seems like Android might have in the past created such mounts withmount.conf
. Now it does not exist on Gingerbread ROMS. Thoughts? - Is this all I would have to do to get my second partition mounted in Android, or do I also need to create
/sdcard2
like/sdcard
? I presume both are created as symlinks by vold as specified in this conf file, but I have not had time to check yet.
I would ask forums, but this seems like a developer question and this is the most recent release of the OS. It seems to change a lot from version to version of the OS. Thanks in advance for your patience and help.
UPDATE: So, moved the test mount to sdcard, and it did not work, even with a persistent mount point. So, not sure where I am going wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您需要查看/init.rc。
有一些“mkdir /mnt/...”语句。您只需将“mkdir /mnt/sdcard2”和“ln -s /mnt/sdcard2 /sdcard2”添加到此文件中。
但编辑此文件时要小心!
Maybe you'll have to have a look into /init.rc.
There are some "mkdir /mnt/..."-statements. You only have to add your "mkdir /mnt/sdcard2" and "ln -s /mnt/sdcard2 /sdcard2" to this file.
But be careful when editing this file!!!
我查看了 vold 源代码,包括 Icecream-Sandwich:它的最终 mount() 系统调用被硬编码为“vfat”文件系统类型。 ——就算你拿来尝试坐骑,也会失败。
我自己实际上想将我的 ext4 SD 卡挂载到 /sdcard,因为我经常遭受 SD 卡 FAT 文件系统损坏的困扰(而且我不是唯一一个在 Android 上遇到这种情况的人)。
另一种方法是:修改 init/boot 进程以仅将分区挂载到您想要的位置,绕过 vold。
I looked at the vold source up to including Icecream-Sandwich: it’s final mount() system call is hardcoded to the “vfat” file system type. – Even if you get it to try the mount, it would fail.
I myself actually want to mount my ext4 SD card to /sdcard, because I regularly suffer from SD card FAT file system corruptions (and I’m not the only one having those with Android).
The alternative is: modify the init/boot process to just mount the partition where you want, bypassing vold.