Product SiteDocumentation Site

Chapter 4. XFS Practical Exercises - 04 - Extended Attributes

4.1. Overview
4.1.1. Goals
4.1.2. Prerequisites
4.1.3. Setup
4.2. Exercises
4.2.1. Exercise 1 – ACLs and EA Interface
4.2.2. Exercise 2 - ondisk form of the EA (ACL)
4.2.3. Exercise 3 – attr2 filesystem
4.2.4. Exercise 4 – ondisk EA’s in different formats
4.2.5. Exercise 5 - attr2 and inode literal space competition
4.3. Questions
4.4. Answers

4.1. Overview

Extended Attributes (EA's) are used for attaching structured meta information to a file or inode and below we will give an example using an ACL. In the lab we will look at how we store an ACL in an EA and how this EA can be stored in various forms on the disk in XFS. Finally, we will look at how the EA's compete for inode space with the data extents and how variable this can be when attr2 is turned on for an XFS filesystem.

4.1.1. Goals

  • To understand what EA's are in XFS
  • The interfaces to manipulate EA's
  • Summary of the ondisk formats
  • The competition for inode space between data extents and EA extents
  • Becoming more familiar with xfs_db(8) for looking at inodes

4.1.2. Prerequisites

Some knowledge of what Extended Attributes (EA's) and Access Control Lists (ACL's) are would be beneficial.

4.1.3. Setup

  • Need a scratch filesystem to play with as root
  • In the examples we will refer to this device and mount point through these environment variables, for example:
    export SCRATCH_MNT=/mnt/scratch
    export SCRATCH_DEV=/dev/sda8
    
  • acl and attr packages installed
  • xfsprogs package installed
  • xfstests/src/makeextents binary; the directory path for this is called $BINDIR
    export BINDIR=/home/fred/src/xfs-cmds/xfstests/src
    
  • For the attr2 exercises:
    • a kernel which supports XFS attr2 format
    • a mkfs.xfs which supports XFS attr2 format