用BusyBox挂载ext2 sd卡

时间:2012-08-17 21:02:11

标签: android busybox

我正在尝试安装我放入平板电脑的SD卡。 SD卡采用ext2格式。我尝试在平板电脑上的终端应用程序中使用BusyBox和以下命令:

busybox mkfs.ext2

但似乎我需要在命令中添加一些参数。我需要添加哪些命令?或者是否有更简单的方法来安装SD卡?

我想不要格式化SD卡,因为它上面有数据;但无论如何阅读它作为ext2格式都可以。

2 个答案:

答案 0 :(得分:2)

你需要 mount ext2文件系统而不是创建文件系统。

根据您的平板电脑,/ dev中的设备可能与我的示例不同。但一般来说,你想要运行一个类似的命令:

busybox mount -t ext2 /dev/block/vold/179:2 /data/sd-ext

其中 / dev / block / vold / 179:2 是您尝试安装的设备。

/ data / sd-ext 是您要将SD卡安装到的路径。

这是mount命令的帮助页面

1|shell@android:/ $ busybox mount -t
option requires an argument -- t
BusyBox v1.20.0.git (2012-03-21 01:44:00 GMT) multi-call binary.

Usage: mount [OPTIONS] [-o OPTS] DEVICE NODE

Mount a filesystem. Filesystem autodetection requires /proc.

    -a      Mount all filesystems in fstab
    -f      Dry run
    -i      Don't run mount helper
    -r      Read-only mount
    -w      Read-write mount (default)
    -t FSTYPE[,...] Filesystem type(s)
    -O OPT      Mount only filesystems with option OPT (-a only)
-o OPT:
    loop        Ignored (loop devices are autodetected)
    [a]sync     Writes are [a]synchronous
    [no]atime   Disable/enable updates to inode access times
    [no]diratime    Disable/enable atime updates to directories
    [no]relatime    Disable/enable atime updates relative to modification time
    [no]dev     (Dis)allow use of special device files
    [no]exec    (Dis)allow use of executable files
    [no]suid    (Dis)allow set-user-id-root programs
    [r]shared   Convert [recursively] to a shared subtree
    [r]slave    Convert [recursively] to a slave subtree
    [r]private  Convert [recursively] to a private subtree
    [un]bindable    Make mount point [un]able to be bind mounted
    [r]bind     Bind a file or directory [recursively] to another location
    move        Relocate an existing mount point
    remount     Remount a mounted filesystem, changing flags
    ro/rw       Same as -r/-w

There are filesystem-specific -o flags.

答案 1 :(得分:1)

应为busybox mount /dev/block/something /mountpointmkfs在Windows

中创建类似format的文件系统

http://www.busybox.net/downloads/BusyBox.html#mount

  

或者有更简单的方法来安装SD卡吗?

它通常会自动发生,如果已经安装在某处,请检查busybox mount不带参数。