views:

1984

answers:

2

I am looking for the way to mount NTFS hard disk on FreeBSD 6.2 in read/write mode.

searching google, I found that NTFS-3G can be a help.

Using NTFS-3G, there is no problem when I try to mount/unmount NTFS manually:

mount: ntfs-3g /dev/ad1s1 /home/admin/data -o uid=1002,

or

umount: umount /home/admin/data

But I have a problem when try to mount ntfs hard disk automatically at boot time.

I have tried:

  • adding fstab: /dev/ad1s1 /home/admin/data ntfs-3g uid=1002 0 0
  • make a script, that automatically mount ntfs partition at start up, on /usr/local/etc/rc.d/ directory.

But it is still failed. The script works well when it is executed manually.

Does anyone know an alternative method/ solution to have read/write access NTFS on FreeBSD 6.2?

Thanks.

A: 

What level was your script running at? Was it a S99, or lower?

It sounds like either there is a dependency that isn't loaded at the time you mount, or that the user who is trying to mount using the script isn't able to succeed.

In your script I suggest adding a sudo to make sure that the mount is being performed by root:

/sbin/sudo /sbin/mount ntfs-3g /dev/ad1s1 /home/admin/data -o uid=1002, etc

Swap the sbin for wherever the binaries are.

Paul Hargreaves
+1  A: 

After some ways I tried before. The last, I tried to add ntfs-3g support by change the mount script on mount.c Like this:

use_mountprog(const char *vfstype)

{

    /* XXX: We need to get away from implementing external mount
     *      programs for every filesystem, and move towards having
     *      each filesystem properly implement the nmount() system call.
     */

    unsigned int i;
    const char *fs[] = {
    "cd9660", "mfs", "msdosfs", "nfs", "nfs4", "ntfs",
    "nwfs", "nullfs", "portalfs", "smbfs", "udf", "unionfs",
    "ntfs-3g"
    NULL
    };

    for (i = 0; fs[i] != NULL; ++i) {
            if (strcmp(vfstype, fs[i]) == 0)
                    return (1);
    }

    return (0);

}

Recompile the mount program, and it works!

Thanks...