Other Startup Script to Mount NTFS Filesystems

I've been trying to figure this out for a while. I have two filesystems (/dev/ada0s3 and /dev/ada1s1) which are formatted with NTFS. I have installed sysutils/fusefs-ntfs and can mount them with ntfs-3g(8):
Code:
# ntfs-3g /dev/ada0s3 /mnt/windows
# ntfs-3g /dev/ada1s1 /mnt/data
However, I cannot mount them via the mount(8) command:
Code:
$ mount -t ntfs-3g /dev/ada0s3 /mnt/windows
mount: /dev/ada0s3: Operation not supported by device
I suppose this is because mount is compiled without ntfs-3g support. Adding a symlink to ntfs-3g in /usr/sbin/mount_ntfs (or /sbin) does not help either.
Thus I cannot mount my ntfs filesystems at startup via /etc/fstab. Since I don't yet completely understand how the rc(8) scripts work yet (and they may be overcomplicated for this task) I decided to write a script that executes ntfs-3g located on the path (/usr/local/bin/custom_mount):
Code:
#!/bin/sh

# Get root device ID
ROOTID=`stat -f %d /mnt`

DEVWIN=/dev/ada0s3
MNTWIN=/mnt/windows
DEVDATA=/dev/ada1s1
MNTDATA=/mnt/data

# Check if windows target exists
if [ -d "${MNTWIN}" ]; then
  ID=`stat -f %d "${MNTWIN}"`

  # Check if root and MNTWIN are located on same device
  if [ ${ID} -eq ${ROOTID} ]; then
  # Mount "windows" filesystem
  echo "Mounting ${DEVWIN} on ${MNTWIN}"
  ntfs-3g "${DEVWIN}" "${MNTWIN}"
  else
  echo "${MNTWIN} is already mounted."
  fi
fi

# Check if data target exists
if [ -d "${MNTDATA}" ]; then
  ID=`stat -f %d "${MNTDATA}"`

  # Check if root and MNTDATA are located on same device
  if [ ${ID} -eq ${ROOTID} ]; then
  # Mount "data" filesystem
  echo "Mounting ${DEVDATA} on ${MNTDATA}"
  ntfs-3g "${DEVDATA}" "${MNTDATA}"
  else
  echo "${MNTDATA} is already mounted."
  fi
fi
But, I don't know how to get this script to launch at startup. I have tried adding it to the /etc/rc.local script. I have also tried the /usr/local/lib/X11/xdm/Xsession script to see if it would run when X starts up. I have tried my local scripts as well, such as ~/.xsession and ~/.profile. The ~/.profile option launches the script when I log into a bash shell, but fails to mount without superuser privileges.
I believe I've tried some other things but have lost track of what all I've attempted. I don't know how I can mount these filesystems on either startup or login.

Please school me on what I am doing wrong as some of these solutions have seemed to work for others from what I have read.
 
This works for me (in /etc/fstab):
Code:
/dev/ada0s3 /mnt/windows ntfs mountprog=/usr/local/bin/ntfs-3g,late 0 0

tobik, it didn't work. I saw a bunch of messages at startup, something like "inappropriate file type or format".

--- Edit ---

fusefs is enabled in /etc/rc.conf:
Code:
$ cat /etc/rc.conf
hostname="AntumD_FreeBSD"
ifconfig_bge0="DHCP"
ifconfig_bge0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
ntpd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"

### Xorg
dbus_enable="YES"

### Desktop environment
hald_enable="YES"
devd_enable="YES"

### Linux compatibility
linux_enable="YES"

### NTFS filesystem support
fusefs_enable="YES"
 
I've got that in mine too:
Code:
$ cat /boot/loader.conf
fuse_load="YES"

--- Edit ---

It appears that the /etc/rc.local method doesn't work because it executes before /usr is mounted... I think.
 
I've made a mistake when I copied the fstab entry. I think you need to add either ro or rw to make it work:
Code:
/dev/ada0s3 /mnt/windows ntfs mountprog=/usr/local/bin/ntfs-3g,late,rw 0 0
If I remove ro from my entry, I get the Inappropriate file type or format error message, too.
 
hello ^^)

I have that exact same problem and even with tobik's solution I still get the Inappropriate file type or format error message :(
and can't get the Windows partitions to mount.

But # ntfs-3g /dev/ada0s3 /mnt/windows mounting works.

I have automounter installed but it automount nothing....

I don't understand why since before I could mount these partitions just by double clicking on its icons...
 
Back
Top