Planning for extended attributes
IBM Spectrum Scale supports extended attributes for files, directories, block devices, pipes, and named sockets in a file system.
gpfs.Encryption
user.swift.metadata
system.posix_acl_access
setfattr
and getfattr
and functions such as
setxattr()
and getxattr()
for accessing extended attributes.- In Linux, the following facts are relevant:
- You must have root-level access to work with extended attributes in the system, security, and trusted namespaces.
- To set an extended attribute for a file or file object (directory, block device, pipe, or named socket) you must have write access to the entity.
- The cp --preserve=xattr Linux command copies either the POSIX or the NFSv4 ACL extended attributes when an IBM Spectrum Scale file is copied. Also some Linux system calls are extended to handle attributes for POSIX and NFSV4 ACLs when the system calls are applied to files in IBM Spectrum Scale file systems. For more information, see Managing GPFS access control lists.
- In Windows, the following facts are relevant:
- You must log on as an administrator to work with extended attributes in the system, security, and trusted namespaces.
- Windows has file permissions for reading and writing extended attributes that are separate from its file permissions for reading or writing file data.
- In AIX®, the following facts are relevant:
- IBM Spectrum Scale does not support AIX commands or functions that access extended attributes.
-
The rules for automating file management include a set of functions for accessing, setting, and evaluating extended attributes. For more information, see Extended attribute functions.
-
The mmchattr and mmlsattr commands provide parameters to create, set, get, or delete extended attributes. For more information, see mmchattr command and mmlsattr command.Note: The mmchattr command does not set some DMAPI extended attributes because of their side effects. However, you can set these extended attributes through DMAPI. For more information, see IBM Spectrum Scale Data Management API for GPFS information.
- The GPFS programming interfaces include a set of subroutines for getting and setting extended attributes. For more information, see GPFS programming interfaces.
Fast extended attributes are extended attributes that are stored in the inode of the file or file object so that they can be read or written quickly. Some features of IBM Spectrum Scale require support for fast extended attributes, such as DMAPI, file encryption, and file heat. To work with fast extended attributes, you use the same methods that you use with regular extended attributes.
- Limitations:
- Extended attributes are not encrypted when a file is encrypted.
- Extended attributes cannot be added, deleted, or modified in an immutable or an appendOnly file. This restriction does not apply to extended attributes in the dmapi or gpfs namespaces.
- Size:
- To determine the maximum allowed size of extended attributes, see Q6.11 in IBM Spectrum Scale FAQ in IBM® Documentation.
- Fast extended attributes are stored first in the inode of a file, then, if more space is needed, in a maximum of one overflow block. The overflow block is the same size as the current metadata block size. The maximum space in the overflow block for storing extended attributes is the minimum of 64 KB or the metadata block size.
- Administration commands:
- The mmafmconfig command has parameters that enable or disable extended attributes or sparse file support in the AFM cache.
- The mmclone command does not copy extended attributes.
- See the administration commands in the item "Back up and restore" following.
- Encryption:
- In encryption, file extension keys (FEKs) are stored in the
gpfs.Encryption
extended attribute. It is a good idea to create a file system with an inode size of 4 K or larger to accommodate FEKs that are encrypted several times. If you encounter an error message that says that the extended attributes are too large, you must either change the encryption policy so that the file key is wrapped fewer times, reduce the number of keys that are used to wrap a file key, or create a file system that has a larger inode size. For more information, see the following links:- Encryption policies
- Preparation for encryption
- Error message 6027-3470 [E]
- In encryption, file extension keys (FEKs) are stored in the
- Back up and restore:
- Scale Out Backup and Restore (SOBAR) preserves and restores extended attributes. For more information, see Scale Out Backup and Restore (SOBAR).
- The mmbackup and mmrestorefs commands preserve extended
attributes. The mmrestorefs command has options to restore encryption attributes
and to not restore external attributes. The IBM
Spectrum Protect product has a setting in the dsm.sys configuration file
that omits backing up a file if only an extended attribute is changed
(
SKIPACLUPDATECHECK
). For more information, see Options in the IBM Spectrum Protect configuration file dsm.opt. - The mmrestorefs command has options to restore encryption attributes and to not restore external attributes.
- Disaster recovery
- In outband disaster recovery, if you are transferring files that contain extended attributes, such as object data, you must use a method that transfers extended attributes, such IBM Spectrum Protect, cross-cluster mount, or AFM. For more information, see Creating the outband disaster recovery setup.
- Objects
- In unified file and object access, the identity management modes local_mode and unified_mode have settings for retaining extended attributes. You can set values in the object-server-sof.conf configuration file to copy extended attributes, Windows attributes, and ACLs from an existing object. For more information, see the following links:
- NFS v4
- NFS v4 uses extended attributes to store some of its file attributes. For more information, see Linux ACLs and extended attributes.
Support for extended attributes began in GPFS v2.1. Support for fast extended attributes began in GPFS v3.4. In IBM Spectrum Scale v4.1 and after, fast extended attributes are enabled by default for a file system when the file system is created. For more information, see File system format changes between versions of IBM Spectrum Scale.
mmmigratefs <Device> --fastea
where
<Device> is the device ID of the file system. To verify that extended
attributes are enabled, issue the following
command:mmlsfs <Device> --fastea
For more
information, see Completing the upgrade to a new level of IBM Spectrum Scale.