Problem creating mbr partition with gpart

Krzysztof Dajka alteriks at
Thu Nov 18 22:31:33 UTC 2010

Today I had problem with creating mbr partition on my pendrive.
I tried using gpart as I am most familiar with this tool. On clean device I did:

[~] #  gpart create -s mbr da1
da1 created
[~] #  gpart add  -t mbr da1
gpart: Invalid argument

What the heck? In gpart(8) under partition types I can see 'The
symbolic names currently understood are: [...] mbr'
Oh well I tried:

[~] #  gpart add  -t fat da1
gpart: Invalid argument
[~] #  gpart add  -t vfat da1
gpart: Invalid argument
[~] #  gpart add  -t fat32 da1
gpart: Invalid argument
[~] #  gpart add -t msdosfs da1
gpart: Invalid argument

As I was in a little hurry I used sysinstall to create msdosfs
[~] #  /sbin/newfs_msdos /dev/da1s1
Did the thing.

Few moments ago I discovered that I can easily create ntfs partition
[~] #  gpart add -t ntfs da1
da1s1 added

Using decimal values for partition types which isn't mentioned in
gpart(8) is also supported:
[~] #  gpart add -t \!11 da1
da1s1 added

Gpart(8) is unprecise especially itemising in partition types mbr
which is partition scheme.
Remembering decimal values for each partition types is inpractical,
maybe most common should have theirs symbolic name.

More information about the freebsd-stable mailing list