This is the procedure for creating an MBR boot sector and a FAT32 file system on a USB flash drive and other removable media, so it can used for sharing files with Windows, TVs or other devices. This procedure is also known as formatting or partitioning.
Identifying USB flash drive on FreeBSD.
Attach the external storage and identify the device. Optionally check for existing partitioning schemes and file systems on the device.
# dmesg
da0: < USB DISK 3.0 PMAP> Removable Direct Access SPC-4 SCSI device
da0: Serial Number 0718388514F24105
da0: 400.000MB/s transfers
da0: 118200MB (242073600 512 byte sectors)
da0: quirks=0x3<NO_SYNC_CACHE,NO_6_BYTE>
# gpart show /dev/da0
=> 63 60825537 da0 MBR (29G)
63 1 - free - (512B)
64 60825536 1 fat32lba (29G)
Creating MS-DOS FAT32 partioning scheme with GPART on FreeBSD.
Destroy any existing partitioning scheme even if it is not empty. Create a new partitioning scheme with an MBR boot sector. Add a new partition of the FAT32 type. Construct a new MS-DOS FAT32 file system with optional label. This is also known as formatting. The label, that can use up to 11 characters, is used by Windows and some devices to present the file system to the user. Consider putting a physical label on the flash drive as well.
# gpart destroy -F /dev/da0
# gpart create -s mbr /dev/da0
# gpart add -t fat32 /dev/da0
# newfs_msdos -L PROJECTS -F 32 /dev/da0s1
Optionally confirm the new partion scheme.
# gpart show /dev/da0
=> 63 242071337 da0 MBR (115G)
63 242071337 1 fat32 (115G)
Mouting and unmounting MS-DOS FAT32 file system on FreeBSD.
The USB flash drive is now ready to be mounted, used and unmounted again. In this example, Alice wants the directories and files in her projects directory copied with RSYNC, so the repeated command will just udpate the drive with changes since last copy. Because the target file system is FAT32, the owner and group can not be set.
# mount -t msdos /dev/da0s1 /mnt
# rsync -ahv --no-owner -no-group /home/alice/projects/ /mnt/
# sync
# umount /mnt
More about creating file systems.
GPART and NEWFS_MSDOS on FreeBSD Manual Pages. How to mount FAT32 formatted SD memory card on FreeBSD and How to mount exFAT formatted SD memory card on FreeBSD by myself.