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):
However, I cannot mount them via the mount(8) command:
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):
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.
Code:
# ntfs-3g /dev/ada0s3 /mnt/windows
# ntfs-3g /dev/ada1s1 /mnt/data
Code:
$ mount -t ntfs-3g /dev/ada0s3 /mnt/windows
mount: /dev/ada0s3: Operation not supported by device
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
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.