World Library  
Flag as Inappropriate
Email this Article

Extended file attributes

Article Id: WHEBN0003461936
Reproduction Date:

Title: Extended file attributes  
Author: World Heritage Encyclopedia
Language: English
Subject: Btrfs, Attic (backup software), Smack (software), Attribute (computing), Stream (computing)
Collection: Computer File Systems, Metadata
Publisher: World Heritage Encyclopedia

Extended file attributes

Extended file attributes are file system features that enable users to associate computer files with metadata not interpreted by the filesystem, whereas regular attributes have a purpose strictly defined by the filesystem (such as permissions or records of creation and modification times). Unlike forks, which can usually be as large as the maximum file size, extended attributes are usually limited in size to a value significantly smaller than the maximum file size. Typical uses include storing the author of a document, the character encoding of a plain-text document, or a checksum, cryptographic hash or digital certificate, and discretionary access control information.


  • Implementations 1
    • AIX 1.1
    • FreeBSD 1.2
    • Linux 1.3
    • OS X 1.4
    • OS/2 1.5
    • Solaris 1.6
    • Windows NT 1.7
  • See also 2
  • References 3
  • External links 4



In AIX, the JFS2 v2 filesystem supports extended attributes, which are accessible using the getea command.[1] The getea,[2] setea,[3] listea,[4] statea,[5] and removeea[6] APIs support fetching, setting, listing, getting information about, and removing extended attributes.


In FreeBSD 5.0 and later, the UFS1 and UFS2 filesystems support extended attributes, using the extattr_[7] family of system calls. Any regular file may have a list of extended attributes. Each attribute consists of a name and the associated data. The name must be a null-terminated string, and exists in a namespace identified by a small-integer namespace identifier. Currently, two namespaces exist: user and system. The user namespace has no restrictions with regard to naming or contents. The system namespace is primarily used by the kernel for access control lists and mandatory access control. Since FreeBSD 8.0, extended attributes are also supported on ZFS filesystem.


In Linux, the ext2, ext3, ext4, JFS, Squashfs, ReiserFS, XFS, Btrfs, OrangeFS, Lustre, OCFS2 1.6 and F2FS[8] filesystems support extended attributes (abbreviated xattr) when enabled in the kernel configuration. Any regular file or directory may have extended attributes consisting of a name and associated data. The name must be a null-terminated string prefixed by a namespace identifier and a dot character. Currently, four namespaces exist: user, trusted, security and system. The user namespace has no restrictions with regard to naming or contents. The system namespace is primarily used by the kernel for access control lists. The security namespace is used by SELinux, for example.

Extended attributes are not widely used in user-space programs in Linux, although they are supported in the 2.6[9] and later versions of the

  • Eager, Bob (2000-10-28). "Implementation of extended attributes on the FAT file system". Tavi Systems. Retrieved 2013-04-08. 
  • Grünbacher, Andreas (2010). "Linux Extended Attributes and ACLs". Retrieved 2013-04-08. 

External links

  1. ^ CommandgeteaAIX Commands
  2. ^ SubroutinegeteaAIX Technical Reference: Base Operating System and Extensions, Volume 1
  3. ^ SubroutineseteaAIX Technical Reference: Base Operating System and Extensions, Volume 2
  4. ^ SubroutinelisteaAIX Technical Reference: Base Operating System and Extensions, Volume 1
  5. ^ SubroutinestateaAIX Technical Reference: Base Operating System and Extensions, Volume 2
  6. ^ SubroutineremoveeaAIX Technical Reference: Base Operating System and Extensions, Volume 2
  7. ^  – FreeBSD System Calls Manual
  8. ^
  9. ^ "Red Hat Enterprise Linux AS 3 Release Notes (x86 Edition)".  
  10. ^ "Guidelines for extended attributes". 2009-08-21. Archived from the original on 2012-02-04. Retrieved 2013-04-08. 
  11. ^ , from Torvald's GitHub clone of the Linux kernel tree"include/uapi/linux/limits.h"File . Retrieved 2015-03-06. 
  12. ^ "Introduction to attr". Beyond  
  13. ^  – Darwin and Mac OS X System Calls Manual
  14. ^  – Darwin and Mac OS X System Calls Manual
  15. ^  – Darwin and Mac OS X System Calls Manual
  16. ^  – Darwin and Mac OS X System Calls Manual
  17. ^  – Darwin and Mac OS X General Commands Manual


See also

Additionally, NTFS can support infinite-length extended attributes in the form of Alternate Data Streams (ADS), a type of resource fork.

On Windows NT, limited-length extended attributes are supported by FAT, HPFS, and NTFS. This was implemented as part of the OS/2 subsystem. They are notably used by the NFS server of the Interix POSIX subsystem in order to implement Unix-like permissions.

Windows NT

Version 4 of the Network File System supports extended attributes in much the same way as Solaris.

The Solaris operating system version 9 and later allows files to have "extended attributes", which are actually forks; the maximum size of an "extended attribute" is the same as the maximum size of a file, and they are read and written in the same fashion as files. Internally, they are actually stored and accessed like normal files, so their names cannot contain "/" characters and their ownership and permissions can differ from those of the parent file.


Parts of OS/2 version 2.0 and later such as the Workplace Shell uses several standardized extended attributes (also called EAs) for purposes like identifying the filetype, comments, computer icons and keywords about the file. Programs written in the interpreted language Rexx store an already parsed version of the code as an extended attribute, to allow faster execution.

In OS/2 version 1.2 and later, the High Performance File System was designed with extended attributes in mind, but support for them was also retro-fitted on the FAT filesystem of DOS. For compatibility with other operating systems using a FAT partition, OS/2 attributes are stored inside a single file "EA DATA. SF" located in the root directory. This file is normally inaccessible when an operating system supporting extended attributes manages the disk, but can be freely manipulated under, for example, DOS. Files and directories having extended attributes use one or more clusters inside this file. The logical cluster number of the first used cluster is stored inside the owning file's or directory's directory entry. These two bytes are used for other purposes on the FAT32 filesystem, and hence OS/2 extended attributes cannot be stored on this filesystem.


Mac OS X 10.4 and later support extended attributes by making use of the HFS+ filesystem Attributes file B*-tree feature which allows for named forks. Although the named forks in HFS+ support arbitrarily large amounts of data through extents, the OS support for extended attributes only supports inline attributes, limiting their size to that which can fit within a single B*-tree node. Any regular file may have a list of extended attributes. HFS+ supports an arbitrary number of named forks, and it is unknown if OS X imposes any limit on the number of extended attributes. Each attribute consists of a name and the associated data. The name is a null-terminated Unicode string. The Mac OS X APIs support listing,[13] getting,[14] setting,[15] and removing[16] extended attributes from files or directories. The xattr utility may be used from the Terminal as well.[17] Since MacOS 10.6, user space extended attributes are not preserved on save in common Cocoa applications (TextEdit, Preview etc.).


Extended attributes can be accessed and modified using the 'attr' command on most distributions.[12]

For ext2/3/4 and btrfs, each extended attribute is limited to a filesystem block (e.g. 4 KiB), and in practice in ext2/3/4 all of them must fit together on a single block (including names and values). ReiserFS allow attributes of arbitrary size. In XFS the names can be up to 256 bytes in length, terminated by the first 0 byte, and the values can be up to 64KB of arbitrary binary data. As of March 2015, the Linux kernel contains a hard limit of 64KB for the size of each extended attribute value, regardless of the file system in use.[11]

for their use. [10]

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.