Mounting exfat and ntfs-3 filesystems with fstab

This is useful for microsd cards and other media that uses Windows filesystems.

Type gpart show /dev/da0 to see if the filesystem is based on exfat or ntfs. exfat can show up as an ntfs-3 filesystem, because they are referred to by the same partition code of 0x07.

For exfat, install fusefs-exfat, and for ntfs, install sysutils/fusefs-ntfs. sysutils/fusefs-ntfs-compression is needed for compressed XPRESS or LZX files. If fuse-ntfs-compression is installed afterwards, run libtool --finish /usr/lib/ntfs-3g.

/boot/loader.conf
Code:
fuse_load="YES"
Use kldload fuse to load without rebooting.

/etc/fstab
Code:
/dev/da0s1      /mnt/ntfs      ntfs-3g ro,noauto,late,mountprog=/usr/local/bin/ntfs-3g  0 0
/dev/da1s1      /mnt/microsd         exfat   ro,noauto,late,mountprog=/usr/local/sbin/mount.exfat  0 0

mountprog tells the mounter which program to use for a particular special file type. Create the directory in /mnt/ with mkdir for mounting the file system according to the fstab entry.

Now, you can use mount from the commandline, referring to the mountpoint directory.

Thanks to aragats ', staff's and others' posts for some of this information.
 
Just a little addendum …

In general it is advisable to load kernel modules via kld_list="..." in /etc/rc.conf rather than from /boot/loader.conf. Please see the rc.conf(5) manual page for details. The only exception are modules that are required for booting, but that shouldn't be the case for exFAT or NTFS file systems (or anything else that has noauto and/or late in /etc/fstab).
 
Just a little addendum …

In general it is advisable to load kernel modules via kld_list="..." in /etc/rc.conf rather than from /boot/loader.conf. Please see the rc.conf(5) manual page for details. The only exception are modules that are required for booting, but that shouldn't be the case for exFAT or NTFS file systems (or anything else that has noauto and/or late in /etc/fstab).

so this tutorial has it wrong.. or incomplete.
 
so this tutorial has it wrong.. or incomplete.
Well, it works, but it is inefficient and dangerous. Well, that tutorial also recommends using nano … :p

In general, you should not touch /boot/loader.conf unless you absolutely have to. If you make a mistake, you can render the machine unbootable, and it is not easy to recover from such mistakes. On the other hand, if you put a mistake in /etc/rc.conf, the worst thing that may happen is that you’re being dropped into single-user mode, where you can easily correct the mistake.

It is also an unfortunate fact that loader messages are not saved anywhere. This makes it more difficult to diagnose loader-related problems (except if you use a serial console, but those are becoming less common these days). After the system has booted, you can only review messages starting from the beginning of the kernel’s initialization, see the dmesg(8) command and the /var/log/messages file.
 
Back
Top
OSZAR »