GhostBSD Partitioning & Formatting Guide (CLI)
View Disk Layout
gpart show
Create a GPT Scheme on a New Disk
gpart create -s GPT /dev/da0
Replace /dev/da0
with the target device.
Creating and Formatting Partitions
FAT32 (for USB drives, UEFI, etc.)
gpart add -t msdosfs -l USBFAT /dev/da0
newfs_msdos -F 32 -L "MYUSB" /dev/da0p1
-F 32
sets FAT32. Use msdosfs
type for FreeBSD-compatible FAT.
ext4 (for Linux compatibility)
Requires sysutils/e2fsprogs
from pkg
.
pkg install e2fsprogs
gpart add -t linux-data -l USBEXT4 /dev/da0
mkfs.ext4 -L MYEXT4 /dev/da0p1
To mount ext4 in GhostBSD:
kldload ext2fs
mount -t ext2fs /dev/da0p1 /mnt
ext4 write support is limited and should be used with caution.
NTFS (for Windows sharing)
Requires fusefs-ntfs
.
pkg install fusefs-ntfs
gpart add -t ntfs -l USBNTFS /dev/da0
ntfs-3g /dev/da0p1 /mnt
To format:
mkntfs -f -L MYNTFS /dev/da0p1
Erasing a Partition
gpart delete -i 1 /dev/da0
gpart destroy -F /dev/da0
Resize Caveats
gpart
can resize partitions with gpart resize -i 1
, but not the file system inside.
- For ext4, use
resize2fs
.
- NTFS and FAT32 resizing is not recommended on FreeBSD. Use Linux or Windows for this purpose.
Useful Notes
/dev/da0p1
refers to GPT partition 1.
/dev/da0s1
refers to MBR slice 1 (less common on modern disks).
- Use
-l LABEL
to assign a friendly name to a partition.