Sunday, May 15, 2016

FreeNAS - Mount and Share NTFS Partition at Startup

It is not recommended practice to share out an NTFS disk or partition from FreeNAS. If you just want to get information off of an NTFS formatted drive in FreeNAS, the recommended practice is to do it from Volume Manager > Import Disk.

I did this under FreeNAS 9.10-STABLE.

Before NTFS partitions can be mounted, FUSE must be loaded into the kernel. In FreeNAS GUI, go to System > Tunables, and add

  • Variable fuse_load, value YES, type loader
  • Variable fusefs_enable, value YES, type rc.conf

Now click on Account > Users > Add User, and add a user with an ID of 1001. I checked the 'Microsoft Account' box, and made the username the same as the one I use in Windows, but I'm not sure this is important...

Now open the Shell. Create a persistent mount point by typing mkdir /conf/base/mnt/ntfs_drive

Now find the UUID or name (I used UUID) of your NTFS partition that you want to mount by typing gpart list. Only you will be able to tell which disk and which partition is the correct one. Once you've found it, note the rawuuid value (or the name, which I didn't use).

Now type mount -uw /, then edit the following file with nano like

nano -w /conf/base/etc/fstab

DISCLAIMER: wrongly editing your fstab file might make your system unbootable!

append this line to the file (it is wrapped below but in the file it must all be on one line):

/dev/gptid/{UUID you noted above} /mnt/ntfs_drive fuse rw,user,mountprog=/usr/local/bin/ntfs-3g,uid=1001,gid=1001,windows_names,inherit,late 0 0

Save changes by pressing Ctrl-Shift-x, then y, then Enter. Now close the shell.

In the FreeNAS GUI, go to Services and turn CIFS on. Then click on the wrench to edit the settings. Leave everything as its default value, except for 'Auxiliary Parameters.' In that box, type (on separate lines):
path = /mnt/ntfs_drive
writeable = yes
browseable = yes

This should allow samba to share out the NTFS partition that will be mounted at startup.

The share will not be visible in the FreeNAS GUI under 'View Windows (CIFS) Shares' but it should be visible on the network to other computers.

No comments:

Post a Comment

Thank you for your time and interest in this post!
Comments to this blog are sometimes moderated to prevent spam. Please don't be alarmed if your comment does not appear immediately.