Gpart

From wikinotes
Revision as of 19:21, 8 March 2020 by Will (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

gpart is a BSD tool for working with partition tables. Similar to linux's fdisk.

camcontrol devlist   # list all devices
gpart list           # print all disks (with gpt partition tables)
gpart show /dev/da0  # print partition table for da0

# create/destroy partition table
sudo gpart destroy -F da1 
gpart create -s gpt /dev/da0

# create partitions
gpart add -s 160G -t freebsd-ufs /dev/da0
newfs -U da0p1                               # create new ufs filesystem on da0p1