Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to hide 1 folder in my pen drive for Windows but from Ubuntu, is it possible if yes then how?

share|improve this question

3 Answers 3

fatattr can do it for VFAT. Not sure about NTFS.

share|improve this answer

you could try renaming to ./.whatever then renaming back with the hide_dot_files mount option enabled...i haven't seen another way to do it yet...

share|improve this answer
tuxera.com/community/ntfs-3g-manual says respecting/setting the hidden attribute is supported, but they don't say a way to DO it. this is my workaround –  hbdgaf Oct 4 '10 at 16:23

With FAT... You can't.

It's really unlikely that your pendrive has NTFS, but:

Using ntfs-3g (not in all driver versions, unfortunately), you can change this information through extended attributes:

(The attribute system.ntfs_attrib_be only exists since ntfs-3g-2010.5.22AC.5) The NTFS attributes are mapped to two four-byte word extended attributes named system.ntfs_attrib and system.ntfs_attrib_be. The value of the former is represented with the endianness of the processor used (suitable for use with system functions such as getxattr(2)), the value of the latter is represented as big-endian and is more convenient for use with commands such as getfattr(1).

The table in that page gives FILE_ATTRIBUTE_HIDDEN = 2, so:

  1. getfattr -h -e hex -n system.ntfs_attrib_be yourfile
  2. Bitwise-OR getfattr's output with 0x2

    $ python
    >>> print hex(0x1234 | 0x2)

    Replace 0x1234 with whatever getfattr printed.

    (A calculator would work just as well.)

  3. setfattr -h -v 0x1236 -n system.ntfs_attrib_be yourfile

    Replace 0x1236 with whatever you got from step 2.

Damn, I should write chmod.ntfs or something.

share|improve this answer
"Damn, I should write chmod.ntfs or something." DOO EET! –  Ignacio Vazquez-Abrams Oct 5 '10 at 8:17
Also, it is possible with VFAT, but not pretty. stackoverflow.com/questions/1648117/… –  Ignacio Vazquez-Abrams Oct 5 '10 at 8:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.