Format a disk on Linux

These are the steps to wipe and format a disk under Linux using [[fdisk]] and [[dd]].

# find the correct disk
fdisk -l

# wipe the disk if it contains old data *careful - choose the correct disk*
dd if=/dev/zero of=/dev/sdx bs=1M status=progress

# prepare the disk (careful - everything gets deleted)
fdisk /dev/sdx

p: display the partition table to know the current partitions. d to delete all the partitions. If you have more than one, repeat this process until there are no partitions left. n to create a new partition. Accept all defaults (primary partition). g to create a new GPT partition table w to write the changes