Do any filesystems support multiple forks / streams on directories?

1

1

Apple's HFS+ supports multiple forks such as the old data and resource forks. NTFS supports alternate data streams. I believe some *nix filesystems also have some support for multiple file forks or streams.

Given that directories (folders) are just a kind of file at the filesystem level, I'm wondering if any of the filesystems which support this feature support it for dirs as well as files? (Or indeed directories in the alternate forks / streams?)

I'm mostly asking out of curiosity rather than wanting to use such a feature. But one use it would have would be additional metadata for directories, which seems to be the most common use for these streams for files currently.

hippietrail

Posted 2012-12-09T00:49:11.203

Reputation: 3 699

1NTFS supports Alternate Data Streams on directories. I don't know about the various Linux filesystems, though. – Andrew Lambert – 2012-12-09T02:48:22.553

@Amazed: If you could provide a reference in an answer I would accept it. – hippietrail – 2012-12-09T02:56:21.687

1I don't have one handy, sorry. – Andrew Lambert – 2012-12-09T06:50:59.573

@Amazed: Well I eventually found this stated in a couple more places too, just none of them very official looking to link to from here ... – hippietrail – 2012-12-09T22:50:57.657

Answers

1

The ext2, ext3, ext4, JFS, ReiserFS, XFS, Btrfs and OCFS2 1.6 filesystems support extended attributes for a limited amount of metadata

In order to use them, the filesystems need to have xattrs enabled, for example:

mount /dev/sda1 /mountpoint -o user_xattr

Then you can set attributes:

setfattr -n "nameofmetadata" -v "valueofmetadata" /mountpoint/myfile

And get attributes:

getfattr /mountpoint/myfile

Paul

Posted 2012-12-09T00:49:11.203

Reputation: 52 173