Format USB as exFAT with fdisk
To format a drive to exFAT using fdisk, follow these steps:
sudo fdisk -l to list all storage devices and their partitions. Carefully identify the correct device (e.g., /dev/sdb) and partition (e.g., /dev/sdb1) you wish to format, ensuring you do not select your system's boot drivesudo fdisk /dev/sdX (replace sdX with your device identifier, e.g., sdb). In the fdisk menu, type o to create a new DOS partition table Then, type n to create a new partition, and press Enter twice to accept the default first and last sectors, creating a single partition that uses the entire drivefdisk menu, type t to change the partition type. Enter 7 to set the type to HPFS/NTFS/exFAT For drives larger than 2TB using a GPT partition table, the correct type is Microsoft Basic Data (GUID: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7), which can be set using gdisk instead of fdiskw to write the partition table to the disk and exit fdisk. Confirm the action when promptedmkfs.exfat command to create the filesystem on the newly created partition. Replace /dev/sdXn with your actual partition (e.g., /dev/sdb1) and LABEL with your desired volume name. The command is sudo mkfs.exfat -n "LABEL" /dev/sdXn This command formats the partition and creates the exFAT filesystemsudo fsck.exfat /dev/sdXn A successful check will report "File system checking finished. No errors found."Note: For Linux kernels 5.4 and later, exFAT support is built into the kernel, so you only need the exfat-utils package. On older systems, you might need exfatprogs Ensure the necessary tools are installed with sudo apt-get install exfat-utils or sudo apt install exfatprogs