# gpart partition types



## Phishfry (Jan 15, 2018)

I am trying to chase down a script bug and it looks like the `gpart add -type` is the problem.
This script has -t !14 and I am finding it needs -t !12.
https://github.com/freebsd/crochet/blob/master/board/BeagleBone/overlay/root/copy-to-emmc.sh
I am trying to understand the problem and first up is knowing what kind of partitions were intended.
-tpye !12 is fat32 but what is -t !14 ?
The manual is lacking in regards to my Partition Types.
https://www.freebsd.org/cgi/man.cgi?gpart(8)


----------



## Phishfry (Jan 15, 2018)

I see in gpart_ops.c source:

```
{"FAT32", "FAT Type 32",
               "Create a FAT32 filesystem (default)", 1 },
           {"FAT16", "FAT Type 16",
               "Create a FAT16 filesystem", 0 },
           {"FAT12", "FAT Type 12",
               "Create a FAT12 filesystem", 0 },
```

So maybe it goes like this 
fat32=!11
fat12=?
fat16=?


----------



## Phishfry (Jan 15, 2018)

OK -t !12 is FAT16. I wish I could find out what -type !14 is/was. Maybe a typo?

```
root@beaglebone:~ # gpart show
=>     63  7552961  mmcsd0  MBR  (3.6G)
       63    32760       1  !12  [active]  (16M)
    32823  7520184       2  freebsd  (3.6G)
  7553007       17          - free -  (8.5K)

=>      0  7520184  mmcsd0s2  BSD  (3.6G)
        0  7520128         1  freebsd-ufs  (3.6G)
  7520128       56            - free -  (28K)

root@beaglebone:~ # file -s /dev/mmcsd0s1
/dev/mmcsd0s1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "BSD4.4  ", sectors/cluster 8, root entries 512, sectors 32760 (volumes <=32 MB) , sectors/FAT 16, sectors/track 63, heads 255, serial number 0x387f180a, label: "EMMCBOOT   ", FAT (16 bit)
```


----------



## Phishfry (Jan 15, 2018)

This would appear to be a typo using -type !14.

```
echo 'Creating MSDOS FAT16 boot partition on eMMC'
gpart create -s mbr mmcsd1
gpart add -s 16m -t '!14' mmcsd1
gpart set -a active -i 1 mmcsd1
newfs_msdos -L 'EMMCBOOT' -F 16 /dev/mmcsd1s1
```

So from the echo line to -F 16  flag used in disk formatting. This is supposed to be FAT16.


----------



## Phishfry (Jan 15, 2018)

Gonzo pointed me to this:
https://en.wikipedia.org/wiki/Partition_type

So type 14h =!14 and according to wikipedia it can be FAT12 or FAT16.


----------

