Skip to content

External HDD setup

Step-by-step guide to partition, format and auto-mount an external drive with GPT and exFAT for use across Windows, macOS and Linux.



  1. Terminal window
    # Identify the target drive, i.e., /dev/sde
    lsblk
  2. Terminal window
    sudo umount /dev/sde*
  3. Terminal window
    sudo apt install gdisk exfat-fuse exfatprogs -y
  4. Make sure you use the disk /dev/sde not the partition /dev/sde1

    Terminal window
    sudo gdisk /dev/sde
    • Type d to delete the existing partition (/dev/sde1).
    • Defaults to partition 1.
    • Type o to create a new GPT partition table.
    • Confirm with Y.
    • 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)
    • Type w to write the changes.
    • Confirm with Y.
  5. Terminal window
    sudo mkfs.exfat -n MYDRIVE /dev/sde1
  6. Terminal window
    sudo parted /dev/sde print
  1. The first step is to identify the drives that are currently mounted on your system. This will help you locate the external HDD and determine where it’s currently mounted, if at all.

    Terminal window
    lsblk
  2. Each drive in Linux has a unique identifier called the UUID. This step shows you how to obtain the UUID of your external HDD, which will be used for reliable mounting.

    Terminal window
    sudo blkid /dev/sda1
  3. A mount point is a directory where your external HDD will be accessed. In this step, you’ll create a directory that will serve as the location for your drive’s mount.

    Terminal window
    sudo mkdir -p {{EXTERNAL_HDD_PATH_VAR}}
  4. After creating the mount point, it’s important to set the appropriate ownership and permissions for the directory. This ensures that the user or group can access the external HDD properly.

    Terminal window
    sudo chown -R $USER:$USER {{EXTERNAL_HDD_PATH_VAR}} && sudo chmod -R 755 {{EXTERNAL_HDD_PATH_VAR}}
  5. The /etc/fstab file controls how filesystems are mounted during system boot. This step shows you how to modify fstab to automatically mount your external HDD every time the system starts.

    Terminal window
    sudo nano /etc/fstab
  6. You’ll add a new line to the fstab file, below other entries, to specify how your external HDD should be mounted. This entry ensures the drive is automatically mounted at boot time using its UUID.

    Terminal window
    UUID={{EXTERNAL_HDD_UUID_VAR}} {{EXTERNAL_HDD_PATH_VAR}} ext4 auto,nofail,noatime,rw,users,exec 0 0
  7. Before making permanent changes, unmount the drive to ensure it’s safely disconnected from the system. This step avoids any potential data corruption while you edit configuration files.

    Terminal window
    sudo umount /dev/sda1
  8. Once all changes are made, reboot your system to apply the fstab modifications and ensure that your external HDD mounts correctly at startup.

    Terminal window
    sudo reboot