Obligatory warning: You seem to have found your way to fdisk
. Keep in mind that, like most BSD-Unix-style command line fdisk
tools, the Mac OS X fdisk
's editing feature does not 'do' safeguards, it has even less safeguards than whatever other platform's command line fdisk tool you're thinking of. It will happily let you accidentally use the erase
command (which removes allall the partitions) or edit a partition that Mac OS X is currently using rendering(rendering your system unbootable,) and even has few safeguards against putting numbers that just plain don't make any sense under any circumstances right into the partition table, so please be careful. Its only saving grace is that the changes are only in memory until it writes them, so if you are careful you can exit
without saving.
You can use fdisk
in interactive mode to edit the entries in the partition table. For instance, to edit the partition table on disk 1:
sudo fdisk -e /dev/rdisk1
Then edit your first blank partition table entry (e.g. edit 3
), set it to type AF
, press return for the default to the CHS mode
question, press return to accept the default of starting the partition after the end of the last one, then enter the end sector number you want (the default is the end of the disk; to figure out one for a size you want: divide the size you want by 512 bytes to get the number of sectors you want, and then add that to the start sector number and subtract one to get the end sector number ). Do a print
to make sure it looks okay (nothing has been saved yet, so if there's a mistake you can just exit
(not quit
) at this point and run fdisk
again to start from the beginning.) Then write
to save the partition table over the old one on the disk. Then exit
.
If you get a warning at write
that the changes will require a reboot, that's okay; answer y
, and reboot Mac OS X after exit
ing.
Now the partition table has been updated, but the partition itself still has the whatever old blocks of data were in that space before; Run Disk Utility, and from the Erase tab, choose the new partition, give it a name, and Erase it.