pianyu / 0xdroid

Automatically exported from code.google.com/p/0xdroid
0 stars 0 forks source link

about mount ntfs/ext4 sdcard #117

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
the 0x4 on devkit8000 did not support ntfs and ext4 sdcard mount

Original issue reported on code.google.com by chinaren...@gmail.com on 2 Jun 2010 at 5:51

GoogleCodeExporter commented 9 years ago
We have to renice since it is not so common.

Original comment by jserv.tw@gmail.com on 7 Jun 2010 at 8:56

GoogleCodeExporter commented 9 years ago
This package is my porting ntfs-3g to android, and it can run under android 
system, and I can mount ntfs system by command
ntfs-3g, but it still have three problems:
1) the pread and pwrite function is not workable, I modify the pread and pwrite 
function , and it is only a temporary method
2) the pthread_rwlock_t is not workable, i comment it
3) I don't know how to add codes to volmgr_ntfs.c to support auto mount ntfs 
partition.

int vold_ntfs_mount(blkdev_t *dev, volume_t *vol, boolean safe_mode)
{
#if 1
    int rc;
    boolean rw = true;
    char *devpath;
    devpath = blkdev_get_devpath(dev);

#if NTFS_DEBUG
    LOG_VOL("ntfs_mount(%d:%d):", dev->major, dev->minor);
#endif

    if (access(NTFS_3G_PATH, X_OK)) {
        LOG_VOL("ntfs_mount(%d:%d): %s not found (skipping mount)",
             dev->major, dev->minor,  NTFS_3G_PATH);
        return -1;
    }

    int pass = 1;
    do
    {
        char *args[5];
        args[0] = NTFS_3G_PATH;
        args[1] = "-o nls=utf8,fmask=000,dmask=000";
        args[2] = blkdev_get_devpath(dev);
        args[3] = vol->mount_point;
        args[4] = NULL;

        LOG_VOL("Filesystem mount %s: %s\n", blkdev_get_devpath(dev), vol->mount_point);
        rc = logwrap(4, args, 1);

        free(args[2]);

        if (rc == 0)
        {
            LOG_VOL("Filesystem mount completed OK");

            return 0;
        }
    } while (0);

    return 0;

    but I got an error 

I//system/bin/ntfs-3g(  808): Failed to write lock '/dev/block/vold/179:1': Try 
again
I//system/bin/ntfs-3g(  808): Error opening '/dev/block/vold/179:1': Try again
I//system/bin/ntfs-3g(  808): Failed to mount '/dev/block/vold/179:1': Try again

can anyone help me?

Original comment by chinaren...@gmail.com on 17 Jun 2010 at 8:27

GoogleCodeExporter commented 9 years ago
I find that in unix_io.c 
static int ntfs_device_unix_io_open(struct ntfs_device *dev, int flags)

...
if (fcntl(DEV_FD(dev), F_SETLK, &flk)) {
        err = errno;
        ntfs_log_perror("Failed to %s lock '%s'", NDevReadOnly(dev) ? 
                "read" : "write", dev->d_name);
        if (close(DEV_FD(dev)))
            ntfs_log_perror("Failed to close '%s'", dev->d_name);
        goto err_out;
    }

..

the errors occurred here

who can tell me why fcntl F_SETLK error?

Original comment by chinaren...@gmail.com on 20 Jun 2010 at 2:51

GoogleCodeExporter commented 9 years ago
i change the F_SETLK to F_SETLK64 it was ok, it have another problem, after a 
while the ntfs-3g process terminated with exit(0)

Original comment by chinaren...@gmail.com on 25 Jun 2010 at 8:47

GoogleCodeExporter commented 9 years ago
Ho chinaren,
I'm a developer of android-x86.
I'm interesting in your ntfs-3g porting.
I think it's more useful for us since
ntfs is more common on x86 platforms.
Could you provide a full patch so I can give a try?

For ext4 mount, we have added it into android-x86.

Original comment by cwhuang%...@gtempaccount.com on 28 Jun 2010 at 1:22

GoogleCodeExporter commented 9 years ago
Hi, I did not create a patch, and i send the modified source code of ntfs-3g to 
you by mail.

Original comment by chinaren...@gmail.com on 28 Jun 2010 at 1:46

GoogleCodeExporter commented 9 years ago
Hi, My mail is chinaren.taoshi@gmail.com  cwhuang what's your mail? I send the 
source code to your mail failed.

Original comment by chinaren...@gmail.com on 28 Jun 2010 at 2:03

GoogleCodeExporter commented 9 years ago
Hi Chinaren,
I also want to integrate ntfs-3g into Android, I follow the method to build 
fuse+ntfs-3g in 
http://buffalo.nas-central.org/wiki/Linux_NTFS_support#FUSE_.2B_NTFS-3G_.28all_p
latforms.29
But cannot work, can you tell me how you build ntfs-3g for Android (Arm 
platform)and run it successfully?
Thank you.

Original comment by johnnyli...@gmail.com on 8 Nov 2010 at 2:15