How to format an external 4 TB HDD to exFAT filesystem and specify allocation unit size?

Using disk utilities or parted I can format an external drive to exFAT, but I can't find the way to specify the allocation unit size.

The only option that looks promising is on the command line tool mkexfatfs

-s sectors-per-cluster

"Number of physical sectors per cluster (cluster is an allocation unit in exFAT). Must be a power of 2, i.e. 1, 2, 4, 8, etc. Cluster size can not exceed 32 MB. Default cluster sizes are: 4 KB if volume size is less than 256 MB, 32 KB if volume size is from 256 MB to 32 GB, 128 KB if volume size is 32 GB or larger. "

However I don't understand how to practically use this option to set an allocation unit size of, say, 2048 B.

How can this be done?


Solution 1:

First figure out which device you want to affect and its mount point by running:

lsblk

Be careful of messing with /dev/sda because that's likely your boot disk. Once you're very sure that you know the proper disk, then unmount it with something like:

sudo umount /media/yourname/somedisk

And now it can be formatted as ExFAT. If you wanted to wipe out sdb you can do:

sudo mkfs -t exfat -s 4 /dev/sdb

(Where "4" is derived from your desired 2048 byte cluster size / 512 byte sector size on most hard disks. If your disk uses 4K sector size, the smallest cluster you can have is the same 4K size, which would be -s 1.)

If there had been any existing partitions on your disk you'll want to remove them first, and info about that can easily be found elsewhere on "ask ubuntu".