Wednesday, October 22, 2008 at 3:11 pm by Brady Wilson

Mount NTFS USB drives read-write in FreeBSD

This write-up was tested on FreeBSD 6.2 and 6.3.  As of this writing the NTFS-3g release was 1.2531.
Please let me know if you run into typos or other technical issues when implementing this.

1.) Update the ports collection. 
 
Setup the update:

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean
# cd /usr/ports/net/cvsup
# make install clean
# cp /usr/share/examples/cvsup/ports-supfile /root/ports-supfile
# pico /root/ports-supfile

Make it look something like this:

#######################################################
*default host=cvsup1.us.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs  tag=.
*default delete use-rel-suffix
#comment the below line if you don’t want to update the /src directory
#src-all
#update /usr/ports
ports-all tag=.
#######################################################

Run the update:

# cvsup -L 2 /root/ports-supfile
# portsdb -Uu

Update installed ports:

# portversion -l “<”
# portupgrade -arR
# pkgdb -F

2.) De-install any existing packages.

Older versions don’t work properly for auto mounting in /etc/fstab.  In addition older versions of the kernel module and libraries won’t work with the latest version of fusefs-ntfs.

# cd /usr/ports/sysutils/fusefs-kmod
# make deinstall

# cd /usr/ports/sysutils/fusefs-libs
# make deinstall

# cd /usr/ports/sysutils/fusefs-ntfs
# make deinstall

3.) Install the necessary packages.

# cd /usr/ports/sysutils/fusefs-kmod
# make install clean
# cd /usr/ports/sysutils/fusefs-libs
# make install clean
# cd /usr/ports/sysutils/fusefs-ntfs
# make install clean

4.) Load the kernel module

Enable the kernel module

edit /etc/rc.conf and add:

fusefs_enable=”YES”

Start the module

# /usr/local/etc/rc.d/fusefs start

5.) Attach the USB drive.

Attach the USB drive and check your syslog for the detection of the drive:

# tail -n20 /var/log/messages

Example:

Sep  8 09:19:47 servername kernel: umass0: Seagate FreeAgentDesktop, rev 2.00/0.00, addr 2
Sep  8 09:19:47 servername kernel: da1 at umass-sim0 bus 0 target 0 lun 0
Sep  8 09:19:47 servername kernel: da1: <Seagate FreeAgentDesktop 100D> Fixed Direct Access SCSI-4 device
Sep  8 09:19:47 servername kernel: da1: 40.000MB/s transfers
Sep  8 09:19:47 servername kernel: da1: 476940MB (976773168 512 byte sectors: 255H 63S/T 60801C)
 

6.) Mount the USB drive.

# mkdir /mnt/usbstorage
# mount -t ntfs-3g /dev/da1s1 /mnt/usbstorage

If you get an error about the partition being hibernated:
Error opening partition device: Operation not permitted

Failed to mount ‘/dev/da1s1′: Operation not permitted

The NTFS partition is hibernated. Please resume and shutdown Windows properly, so mounting could be done safely.

Use:

# mount -t ntfs-3g /dev/da1s1 /mnt/usbstorage -o remove_hiberfile

That error message does sometimes point to a conflict in module and library versions though and cannot be fixed until the versions installed are correct.

Notes:

· If you want a persistent mount, be sure to add a mount entry to the /etc/fstab file or a post boot script such as rc.local.

· If you are done with the USB storage drive:

# umount /mnt/usbstorage

Article Topics

Alternative Article:
Work Hard, Play Hard…

December 9, 2008

At Opus Interactive, we work very hard. Our clients would say that they can depend on us to make their IT operations run smoothly and effectively at all times. And we do!
We also play hard – after all it’s only fair. And the culture that has been created at Opus Interactive allows us to make the [...]

Leave a Comment


Article Archives:

  • Work Hard, Play Hard…

    At Opus Interactive, we work very hard. Our clients would say that they can depend on us to make their IT operations run smoothly and effectively at all times. And we do!
    We also play hard – after all it’s only fair. And the culture that has been created at Opus Interactive allows us to make the [...]

    December 9th, 2008

  • SMTP Auth from MySQL and TLS with Courier Authdaemon and Postfix on FreeBSD 7.0

    We needed a set of servers that could easily be load balanced and did nothing but send mail via SMTP.  Many clients need to send their mail from remote locations and will most often not be connected to our network.  To avoid allowing the servers to be used to send spam we had to be [...]

    December 9th, 2008

  • Reinstalling RocketRaid drivers after updating FreeBSD

    After going through the steps to update FreeBSD via cvsup, 3 of the servers didn’t come back up after reboot as fast as the other servers I updated did. After 10 minutes, of the server not coming back up, I realized something likely happened to the raid controller driver that these 3 servers use.
    Once I [...]

    August 19th, 2008

  • Patching BIND for OpenBSD

    Recent security research discovered that there were multiple DNS implementations vulnerable to cache poisoning.This is a multi-vendor vulnerability outlined at the following links (among many others):
    http://secunia.com/cve_reference/CVE-2008-1447
    http://www.kb.cert.org/vuls/id/800113
    In our DNS infrastructure we separate the recursive query DNS servers from the authoritative DNS servers.  We limit recursive queries to our own network ranges.  Our internal DNS servers used [...]

    August 8th, 2008

  • The Real Ironman

    June 28th, 2008
     
    So, I just completed my 1st 1/2 Ironman Triathlon today.  It has been a goal that I have wanted to accomplish for some time.  After 5 months of vigorous training, I had one day to swim 1.2 miles in the frigid Wickiup Reservoir,
     
    ( bike 56 miles around Mt. Bachelor going from 4200 [...]

    August 5th, 2008

Article Comments:

0 Comments