Log in

Registration

Diego Escalante Urrelo: Removing the hidden/system bit of vfat/fat32 files on GNU/Linux

Posted: April 21, 2012 / in: Linux / No comments

Huelga, on flickr

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:

  1. Create a ~/.mtoolsrc file with this:
    1
    2
    drive s: file="/dev/&lt;your-usb-drive"<br />
    mtools_skip_check=1 (otherwise it refuses to operate on the drive)
  2. Check for file attributes with mattrib:
    1
    $ mattrib -/ s:
  3. Fix any broken stuff (this removes the hidden and system bits):
    1
    $ 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.

Article source: Go to Source
Feed source: http://planet.debian.org/rss20.xml
License: The original licenses are retained – MIT (Expat) License

Tags: , , , , , , , ,

© Copyrights and Licenses, 2014 - Linux-Support.com The Professional Linux and OSS Services Portal