Skip to content

Format external HDD

This guide will set up a GPT partitioned disk with an exFAT filesystem, compatible with Windows, macOS and Linux. See the steps to format a disk with GPT and exFAT using gdisk and mkfs.exfat below.


  1. Identify drive

    Terminal window
    # Identify the target drive, i.e., /dev/sde
    lsblk
  2. Unmount the partition

    Terminal window
    sudo umount /dev/sde*
  3. Install gdisk

    Terminal window
    sudo apt install gdisk exfat-fuse exfatprogs
  4. Start gdisk on the disk

    Make sure you use the disk /dev/sde not the partition /dev/sde1

    Terminal window
    sudo gdisk /dev/sde
  5. Delete the existing partition

    • Type d to delete the existing partition (/dev/sde1).
    • Defaults to partition 1.
  6. Create a new partition table

    • Type o to create a new GPT partition table.
    • Confirm with Y.
  7. Create the partition

    • Type n to create a new partition.
    • Follow the prompts to create a partition with the default values:
      • Partition number: press Enter (default is 1)
      • First sector: press Enter (default)
      • Last sector: press Enter (default)
      • Partition type: 0700 (Microsoft basic data)
  8. Write changes

    • Type w to write the changes.
    • Confirm with Y.
  9. Format partition as exFAT

    Terminal window
    sudo mkfs.exfat -n MYDRIVE /dev/sde1
  10. Verify partition and filesystem

    Terminal window
    sudo parted /dev/sde print