The filesystem type value freebsd-ufs
is exclusive to GPT partition schemes, but you have created an MBR partition scheme. If you wish to use MBR, you will need to create an MBR partition with the type freebsd
, for a BSD disklabel. You will then add labels to this partition such as UFS and swap.
Be very careful using gpart
as it does not have any safeguards. Saving a backup of all your devices' partition tables with gpart backup
is a good practice here. These could be restored later in the event of a mistake. Since modifying a partition table does not change the contents of the partition, restoring the partition table with gpart restore
will easily "fix" these mistakes. Even an experienced user can accidentally use da0
where they meant da1
and delete the wrong partition. See the gpart(8)
man page for additional details and examples.
Because this is a USB stick, and assuming it will simply be used it for external storage, there are two options. The simplest is to not partition the device at all, and create a UFS filesystem that encompasses the entire device with newfs /dev/daX
. The device can then be mounted directly. The downside is that plugging this device into a Windows machine will prompt the user to format it.
If a partition table is required, use GPT partitions instead. First, remove the existing MBR partition table, then create a new GPT partition scheme, and finally add a UFS partition:
gpart destroy <device> # remove existing MBR partition table
gpart create -s GPT <device> # create GPT partition scheme
gpart bootcode -b /boot/pmbr <device> # add protective MBR for legacy apps
gpart add -t freebsd-ufs <device> # add UFS partition spanning device
gpart
will choose the first available sector and create a partition spanning the entire device.
Note, if you want this to be bootable, there are additional steps that must be performed and additional partitions required. The gpart(8)
man page has excellent examples for creating a bootable GPT device.
gpart show da2
prior to doing thegpart add ....