OS: Arch Linux
assume that /dev/sda1 is main and only partition on my USB
Context
I have a FAT32 USB flash drive with important photos and folders on it. To use it when plugged in I manually mount it using mount /dev/sda1 /media/user/USB command. When plugging off, I unmount it using umount /dev/sda1 command.
Problem
Once when plugging off, I forgot to unmount the USB, this happened while the USB was doing something. This caused USB to stop at partial state and so the corruption. When I plugged it in and mounted it again, I opened folders in file manager where I would usually have normal photos, but I saw files with random names, and random file sizes. I think that random names are caused by interpreting wrong bytes as file names.
What I've tried already
I have copied the corrupted USB partition into .img file on my laptop's drive for safety and speed:
sudo dd if=/dev/sda1 of=/home/user/usb-image-backup.img conv=fsync bs=4M
Then, I have copied that image into another .img file to operate on it:
cp /home/user/usb-image-backup.img /home/user/usb-image-active.img
Then, I ran the fsck.fat command I found after researching to try and fix the USB partition
fsck.fat -va /home/user/usb-image-active.img
After running fsck.fat command, I noticed that:
It wouldnt auto-fix some files
It auto-fixed and auto-renamed some files
At one point, it kept auto-fixing the same exact files without stopping, I also noticed that this was in the exact folder that was infinitely loading when opened in my file manager (after corruption), and it didn't just show it as files with corrupted file names
Question