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.
Attach the external storage and identify the device. Optionally check for existing partitioning schemes and file systems on the device. 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. Optionally confirm the new boot sector and partition. Construct a new MS-DOS FAT32 file system with optional label. 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. The USB flash drive is now ready to be mounted, used and unmounted again.
# dmesg # gpart show # gpart destroy -F /dev/da0 # gpart create -s mbr /dev/da0 # gpart add -t fat32 /dev/da0 # gpart show # newfs_msdos -L FOOBAR -F 32 /dev/da0s1 # mkdir /mnt/foobar # mount -t msdos /dev/da0s1 /mnt/foobar # cp /home/foobar/foo.* /mnt/foobar/ # df -H /mnt/foobar # umount /mnt/foobar
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.