> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/ask/flat/chapter-26-other-file-systems/di-26.1-jie-windows-wen-jian-xi-tong.md).

# 26.1 Windows File Systems

FreeBSD currently requires the user-space driver ntfs-3g for NTFS read/write, and the user-space driver fusefs-exfat for exFAT read/write; FAT32 is natively supported by the kernel for both reading and writing.

## NTFS File System

NTFS is a file system developed by Microsoft, commonly used in Windows operating systems. FreeBSD provides full read/write support for NTFS through the **fusefs-ntfs** package (corresponding to Port **filesystems/ntfs**), facilitating access to and modification of NTFS-formatted storage devices.

### Installing ntfs-3g

Install using pkg:

```sh
# pkg install fusefs-ntfs
```

Alternatively, build through the Ports system:

```sh
# cd /usr/ports/filesystems/ntfs
# make BATCH=yes install clean
```

### Configuring ntfs-3g

Insert an NTFS-formatted device, such as a USB flash drive, into the computer. The device name can then be identified, for example `da0` (corresponding to the device file **/dev/da0p1**).

Edit the **/etc/rc.conf** configuration file to add the fusefs kernel module to the system startup load list:

```sh
# sysrc kld_list+="fusefs"
```

The above command makes the configuration persistent. To apply it immediately, run:

```sh
# kldload fusefs
```

### Manual Mounting

To manually mount an NTFS partition:

Use ntfs-3g to mount **/dev/da0p1** to **/mnt**, set read/write permissions, and specify appropriate owner and permission mask for files:

```sh
# ntfs-3g /dev/da0p1 /mnt -o rw,uid=1000,gid=1000,umask=0
```

Perform some read/write operations:

```sh
# ls /mnt
System Volume Information		di-17.2-jie-linux-wen-jian-xi-tong.md
di-17.1-jie-windows-wen-jian-xi-tong.md	di-17.3-jie-macos-wen-jian-xi-tong.md
# rm /mnt/di-17.3-jie-macos-wen-jian-xi-tong.md
# touch /mnt/test1
```

### Automatic Mounting

NTFS partitions can be configured to mount automatically at boot.

Edit the **/etc/fstab** file and add the following mount information:

```sh
/dev/da0p1      /mnt          	ntfs	mountprog=/usr/local/bin/ntfs-3g,rw,uid=1000,gid=1000,umask=0,late	0	0
```

Verify the mount status:

```sh
# df -h
/dev/da0p1             58G     88M     58G     0%    /mnt
```

Then view the file contents:

```sh
# ls /mnt/
System Volume Information		di-17.2-jie-linux-wen-jian-xi-tong.md
di-17.1-jie-windows-wen-jian-xi-tong.md	test1
```

### Appendix: Formatting a New Device as NTFS

First, a partition table must be created: the device can be set up with either an MBR or GPT partition table.

MBR partition tables are older, so the GPT scheme is used in the following demonstration.

#### Creating an MBR Partition Table

```sh
# gpart create -s mbr da0
# gpart add -t ntfs da0
```

#### Creating a GPT Partition Table

```sh
# gpart create -s gpt da0
# gpart add -t ms-basic-data da0
```

### Formatting an NTFS Partition

> **Warning**
>
> `mkntfs` will format the specified partition, and all data on the partition will be permanently lost. Please confirm the device path is correct.

Create an NTFS file system on the **/dev/da0p1** partition:

```sh
# NTFS_USE_UBLIO=0 mkntfs -vf /dev/da0p1
```

Parameter description:

* `-f`: fast format
* `-v`: verbose output
* `NTFS_USE_UBLIO=0`: UBLIO (User space Block I/O) is a user-space block I/O library used to improve FUSE file system performance. However, in the FreeBSD environment, UBLIO may cause file system corruption and data loss when working with ntfs-3g. In this example, without this parameter to disable UBLIO, the command will become unresponsive.

#### References

* [Bug 206978](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206978)
* [Bug 194526](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194526).

## FAT32 File System

The FAT file system is simple and reliable. Although it falls behind modern solutions in performance, reliability, and scalability, it remains a common choice for data exchange between devices due to its availability across multiple operating systems.

When using the `gpart show` command, FAT32 file systems are typically displayed as the `ms-basic-data` type.

The following command displays detailed information about the `nda1` disk and its partitions, including start position, size, and type:

```sh
# gpart show -p nda1
=>      34  41942973    nda1  GPT  (20G)
  29360128   4194304  nda1p3  ms-basic-data  (2.0G) # FAT32

……other irrelevant output omitted……
```

> **Note**
>
> The file system type must be explicitly specified for mounting.

Mount the **/dev/nda1p3** partition as an msdosfs file system:

```sh
# mount -v -t msdosfs  /dev/nda1p3  /mnt
/dev/nda1p3 on /mnt (msdosfs, local, writes: sync 1 async 0, reads: sync 512 async 0, fsid 7d00000032000000, vnodes: count 1 )
```

* The `-v` parameter is used for verbose output;
* The `-t` parameter is used to specify the file system type.

List the contents of the mount directory:

```sh
# ls /mnt/
me	test1	test2
```

When no longer needed, unmount the file system:

```sh
# umount /mnt
```

## exFAT File System

exFAT (Extended File Allocation Table) is a lightweight file system optimized for flash storage devices (such as USB drives and SD cards). It supports large-capacity files and is widely used across multiple platforms, making it suitable for external storage devices.

To use exFAT on FreeBSD, install the filesystems/exfat package, load the FUSE kernel module, and mount the file system as follows:

### Installing the exFAT Package

Install the exFAT package using pkg:

```sh
# pkg install fusefs-exfat
```

Install using Ports:

```sh
# cd /usr/ports/filesystems/exfat/
# make install clean
```

### Loading the fusefs(4) Kernel Module

Before using FUSE file systems, the fusefs(4) kernel module must be loaded:

```sh
# kldload fusefs
```

Use sysrc(8) to configure the module to load automatically at boot:

```sh
# sysrc kld_list+="fusefs"
```

### Formatting a Disk as exFAT File System

The Port **filesystems/exfat-utils** must be installed separately; it provides the `mkexfatfs` tool for formatting disks to exFAT format.

* Create a GPT partition table

```sh
# gpart create -s gpt ada1
```

* Create a partition containing all remaining space

```sh
# gpart add -t ms-basic-data ada1
```

* Format as exFAT

```sh
# mkexfatfs -n "Mytest" /dev/ada1p1
```

The `-n` option specifies the volume label `Mytest`.

* Verify the file system used by the **/dev/ada1p1** partition:

```sh
# fstyp /dev/ada1p1
exfat
```

### Test Mounting an exFAT Volume

Mount the exFAT volume by specifying its FreeBSD partition name and an existing mount point. The following example mounts **/dev/ada1p1** to **/mnt**:

```sh
# mount.exfat /dev/ada1p1 /mnt
```

Verify the exFAT volume mount status:

```sh
# df -hl
Filesystem            Size    Used   Avail Capacity  Mounted on
/dev/ada1p1            20G    2.7M     20G     0%    /mnt

……irrelevant output omitted……
```

Try reading and writing some files:

```sh
# cd /mnt
# touch test
# mkdir -p test2/test2
# ls -al
total 73
drwxrwxrwx   1 root wheel 32768 May 29 17:39 .
drwxr-xr-x  20 root wheel    22 May 29 17:04 ..
-rwxrwxrwx   1 root wheel     0 May 29 17:39 test
drwxrwxrwx   1 root wheel 32768 May 29 17:39 test2
```

## References

* FreeBSD Project. ntfs-3g manpage\[EB/OL]. \[2026-03-25]. <https://man.freebsd.org/cgi/man.cgi?query=ntfs-3g&sektion=8>. Official technical documentation for ntfs-3g, describing parameter configuration and usage.
* Stephen Sherratt. NTFS on FreeBSD\[EB/OL]. \[2026-03-25]. <https://www.gridbugs.org/ntfs-on-freebsd/>. A systematic explanation of the technical implementation for mounting NTFS file systems on FreeBSD.
* FreeBSD Forums. Why fstab file does not recognize NTFS commands?\[EB/OL]. \[2026-04-19]. <https://forums.freebsd.org/threads/why-file-fstab-file-does-not-recognize-ntfs-commands.91972/>. Discussion of NTFS parameters in the fstab file.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/ask/flat/chapter-26-other-file-systems/di-26.1-jie-windows-wen-jian-xi-tong.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
