what are exfat disk file name limitations?

1.5k views Asked by At

Have lots of failures copying my disk to another, exFAT disk.
Specifically, file names with ':', '|' chars did not get through.
What is the allowed charset?
Is there a program to solve the issue, like changing the illegal chars to '.'?

3

There are 3 answers

0
Alex B On

One possible solution (works for me) is to rename all the original files replacing the illegal chars, e.g.

find . -name "*[\:\|]*" -execdir rename -v 's/[\:\|]/./g' '{}' \+

Note there are multiple incompatible versions of the rename command, you might need to use prename or perl-rename.

0
josephwb On

I know this is an older question, but in response to the title question, the invalid filename characters are /:*?"|.

0
Jesse On

According to Microsoft's spec there are nine illegal printable characters in exFAT filenames, "*/:<>?\|, along with all 32 nonprinting control codes like you'd probably expect.

On Linux you can verify these with a little toy filesystem:

mkdir exfat-mnt
dd if=/dev/zero of=exfat.dat bs=1M count=32
mkfs.exfat exfat.dat
sudo mount -o loop,users,fmask=000,dmask=000,users exfat.dat exfat-mnt

For example:

$ touch exfat-mnt/file # works
$ touch exfat-mnt/'"'  # won't work
touch: cannot touch 'exfat-mnt/"': Invalid argument