Gpart: Difference between revisions

From wikinotes
No edit summary
 
No edit summary
 
Line 4: Line 4:
camcontrol devlist  # list all devices
camcontrol devlist  # list all devices
gpart list          # print all disks (with gpt partition tables)
gpart list          # print all disks (with gpt partition tables)
fstyp /dev/da0s1    # detect filesystem type
gpart show /dev/da0  # print partition table for da0
gpart show /dev/da0  # print partition table for da0



Latest revision as of 19:25, 12 February 2022

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)
fstyp /dev/da0s1     # detect filesystem type
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