The <command>partman</command> partitioner will handle most disk layouts. For those rare cases where it is necessary to manually set up a disk, you can use the shell as described above and run the <command>parted</command> utility directly using its command line interface. Assuming that you want to erase your whole disk and create a GPT table and some partitions, then something similar to the following command sequence could be used: <informalexample><screen>
mklabel gpt
mkpartfs primary fat 0 50
mkpartfs primary linux-swap 51 1000
mkpartfs primary ext2 1001 3000
set 1 boot on
print
quit
![](/@@/translation-newline)
</screen></informalexample> This creates a new partition table, and three partitions to be used as an EFI boot partition, swap space, and a root file system. Finally it sets the boot flag on the EFI partition. Partitions are specified in Megabytes, with start and end offsets from the beginning of the disk. So, for example, above we created a 1999MB ext2 file system starting at offset 1001MB from the start of the disk. Note that formatting swap space with <command>parted</command> can take a few minutes to complete, as it scans the partition for bad blocks.