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.
-
Identify drive
Terminal window # Identify the target drive, i.e., /dev/sdelsblk -
Unmount the partition
Terminal window sudo umount /dev/sde* -
Install gdisk
Terminal window sudo apt install gdisk exfat-fuse exfatprogs -
Start gdisk on the disk
Make sure you use the disk
/dev/sde
not the partition/dev/sde1
Terminal window sudo gdisk /dev/sde -
Delete the existing partition
- Type
d
to delete the existing partition (/dev/sde1). - Defaults to partition
1
.
- Type
-
Create a new partition table
- Type
o
to create a new GPT partition table. - Confirm with
Y
.
- Type
-
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)
- Partition number: press
- Type
-
Write changes
- Type
w
to write the changes. - Confirm with
Y
.
- Type
-
Format partition as exFAT
Terminal window sudo mkfs.exfat -n MYDRIVE /dev/sde1 -
Verify partition and filesystem
Terminal window sudo parted /dev/sde print