I just fixed an USB drive that apparently had been hit by a virus. All the top-level directories were invisible on Windows, but visible on GNU/Linux.
First I thought that it was just the “hidden” bit. But turns out it was the “system” bit. I had completely forgotten that one even existed!
After some googling I got this solved by using mtools:
- Create a ~/.mtoolsrc file with this:
drive s: file="/dev/<your-usb-drive"
mtools_skip_check=1 (otherwise it refuses to operate on the drive)
- Check for file attributes with mattrib:
$ mattrib -/ s:
- Fix any broken stuff (this removes the hidden and system bits):
$ mattrib -/ -h -s s:
Hope it saves your neck or the neck of someone that has to use Windows.
Oh, and please, please, don’t make your entire digital life depend on a tiny piece of plastic. Make backups on your real computer, or other drives.