ExFAT directory/file structure corrupt but readable on USB stick

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
madbilly
Posts: 1
Joined: 12 Aug 2021, 22:10

ExFAT directory/file structure corrupt but readable on USB stick

#1 Post by madbilly »

Hello everyone,
I asked this question on superuser.com but I think I'll get a more useful answer here (or you will confirm the answer I got there!) https://superuser.com/questions/1663817 ... -usb-stick

I have a lot of files on a 128GB USB stick to transfer between computers. I've been updating the the stick regularly but manually. Last time I did this I was going to copy from the stick to my main PC under Ubuntu but the directory structure and files are now all messed up - difficult to describe, see the pics. I tried in Windows but the files are still a mess. I tried to the repair the stick with Windows GUI method and then chkdsk but no faults were found, even though there clearly is a fault.

See https://superuser.com/questions/1663817 ... -usb-stick for screenies.

There are 255 folders with nonsense in them. There are then still some valid folders but they shouldn't be in the root. Then there are 16661 messed up files. There are many other files in the root but they shouldn't be there, they should be deeper in the directory structure.

I searched all over stackexchange and the web in general but couldn't find any other example of this. To me it looks like the "file allocation table" got corrupt but still works, somehow. Does ExFAT have a backup FAT I can use a cmd-line utility to point to? Under Windows or Linux?

There are approximately one week's of files I am missing, but it's an important week (it always is, isn't it?!).

Thanks 🙂

recuperation
Posts: 2718
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: ExFAT directory/file structure corrupt but readable on USB stick

#2 Post by recuperation »

madbilly wrote: 12 Aug 2021, 22:14 Hello everyone,
I asked this question on superuser.com but I think I'll get a more useful answer here (or you will confirm the answer I got there!) https://superuser.com/questions/1663817 ... -usb-stick

I have a lot of files on a 128GB USB stick to transfer between computers. I've been updating the the stick regularly but manually. Last time I did this I was going to copy from the stick to my main PC under Ubuntu but the directory structure and files are now all messed up - difficult to describe, see the pics. I tried in Windows but the files are still a mess.
I tried to the repair the stick with Windows GUI method and then chkdsk but no faults were found, even though there clearly is a fault.
I don't know what repairing a stick with Windows GUI method means. Anyway, you had something broken and you should have copied the stick using ddrescue as described in the manual, preferably twice, one copy to keep for the case of a broken stick and another copy to play with.

See https://superuser.com/questions/1663817 ... -usb-stick for screenies.

There are 255 folders with nonsense in them. There are then still some valid folders but they shouldn't be in the root. Then there are 16661 messed up files. There are many other files in the root but they shouldn't be there, they should be deeper in the directory structure.

I searched all over stackexchange and the web in general but couldn't find any other example of this. To me it looks like the "file allocation table" got corrupt but still works, somehow.
I am not familiar with the details of ExFat but corrupted names involve corrupted directories and are not necessarily related to a FAT failure.

Does ExFAT have a backup FAT I can use a cmd-line utility to point to? Under Windows or Linux?
I think there is one backup but it might be already overwritten by your repair efforts. Some hex editors interpret file system structures. Such tool will save you from manual position calculations.

Locked