Unable to resize/create partiion using gpt
gpt is a tool to edit the GUID partition table of a disk. It only modifies the 
primary and secondary GPT header and table and the MBR. Or with other words: it only modifies the first 34 blocks and the last 33 blocks of a device. This means: if you add a partition starting at block 40 and ending at block 409640 (these are the boundaries of a typical OS X EFI partition) it doesn't write anything to the blocks 40-409640 but only to the GPT headers/tables. 

Adding a partition doesn't result in a file system and far less in a readable file system. To create a file system you have to format the partition with an appropriate tool like newfs_hfs! After formatting a partition the file system is essentially empty except the necessary parts which "represent" the file system like catalog file, allocation file etc.

If you remove a partition with a file system or remove the whole partition table containing several formatted partitions with gpt remove|destroy ... the file system(s) won't be touched. So after restoring a partition or a partition table with the same values they had previously the file system(s) with all content will "reappear".

One (rare) case exists where a partition might be enlarged: if some unallocated disk space is directly "behind" a partition. If you first remove a partition with gpt and then re-add the partition with the same start block but a larger size the previous file system is completely in the boundaries of the new partition. But at least the allocation file (~volume bitmap) is corrupted and the alternative volume header is at the wrong location. Usually such an "intentionally corrupted" file system can be repaired with diskutil repairVolume .... You are highly discouraged though to use this method to enlarge a partition.



Modifying disk partitions with gpt like in your question or as described below will delete any current partition (and its content) with a high probability. To resize (expand or shrink) a current partition while keeping the content use diskutil!

Starting using an empty disk with a default GPT partition table you get the following partition scheme:

sh-3.2# gpt show /dev/disk1
        start         size  index  contents
            0            1         PMBR
            1            1         Pri GPT header
            2           32         Pri GPT table
           34  17179869117         
  17179869151           32         Sec GPT table
  17179869183            1         Sec GPT header


Though newer disks report a logical block size of 512 Bytes they usually have a physical block size of 4096 Bytes.


1st rule: start blocks and partition sizes should be dividable by 8 to align partitions to physical blocks
2nd rule: you can't assign more blocks than available (the max. available number of blocks is: 17179869117 (and aligning to physical blocks: 2147483639 x 8 = 17179869112 blocks)
3rd rule: try to specify a GUID type


One viable option is:

gpt add -b 40 -i 1 -s 17179869112 -t 48465300-0000-11AA-AA11-00306543ECAC /dev/disk1


Or you might add an EFI partition and leave some space at the end of the disk (as Apple does):

gpt add -b 40 -i 1 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B /dev/disk1
gpt add -b 409640 -i 2 -s 17179197368 -t 48465300-0000-11AA-AA11-00306543ECAC /dev/disk1


After adding the partitions you have to format the main partition:

newfs_hfs -J -v "Name" /dev/disk1s1


or if you chose the second partition table (with EFI partition)

newfs_hfs -J -v "Name" /dev/disk1s2