1

I have some datasets using XATTR=ON in the past, which actually mapped to LEGACY/DIR, and migrated them to XATTR=SA now for performance reasons. Most of these property changes take effect for newly written data only and the files in the datasets are regularly at least updated using RSYNC during backups.

How do I check the current storage layout used on disk for XATTR?

I've already found something like the following, but that doesn't give me the same results I see online. I've tested it with an explicitly newly created file, added some extended attributes, but the output of ZDB doesn't even seem to change at all.

zdb -dddd <dataset> <inode>

root@srv01:/zpool-hdd/encr# touch test.txt
root@srv01:/zpool-hdd/encr# stat test.txt
  File: test.txt
  Size: 0               Blocks: 1          IO Block: 131072 regular
empty file
Device: 0,60    Inode: 5           Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-11-29 17:39:19.604863843 +0100
Modify: 2024-11-29 17:39:19.604863843 +0100
Change: 2024-11-29 17:39:19.604863843 +0100
 Birth: 2024-11-29 17:39:19.604863843 +0100
root@srv01:/zpool-hdd/encr# zdb -ddddddd zpool-hdd/encr 5
Dataset zpool-hdd/encr [ZPL], ID 37543, cr_txg 750114, 216K, 10
objects, rootbp DVA[0]=<0:fb29d447000:1000> DVA[1]=<0:e8951e4b000:1000>
[L0 DMU objset] fletcher4 uncompressed authenticated LE contiguous
unique double size=1000L/1000P birth=1268365L/1268365P fill=10
cksum=00000024b0170731:00006736da953e0f:009984adba612070:9f9b98f2774578d7
Object  lvl   iblk   dblk  dsize  dnsize  lsize   %full  type
     5    1   128K    512      0     512    512    0.00  ZFS

plain file (K=inherit) (Z=inherit=lz4) 176 bonus System attributes dnode flags: USERUSED_ACCOUNTED USEROBJUSED_ACCOUNTED dnode maxblkid: 0 (bonus encrypted) (object encrypted) Indirect blocks:

root@srv01:/zpool-hdd/encr# setfattr -n user.comment -v "this is a comment" test.txt root@srv01:/zpool-hdd/encr# zdb -ddddddd zpool-hdd/encr 5 Dataset zpool-hdd/encr [ZPL], ID 37543, cr_txg 750114, 216K, 10 objects, rootbp DVA[0]=<0:fb29d447000:1000> DVA[1]=<0:e8951e4b000:1000> [L0 DMU objset] fletcher4 uncompressed authenticated LE contiguous unique double size=1000L/1000P birth=1268365L/1268365P fill=10 cksum=00000024b0170731:00006736da953e0f:009984adba612070:9f9b98f2774578d7

Object  lvl   iblk   dblk  dsize  dnsize  lsize   %full  type
     5    1   128K    512      0     512    512    0.00  ZFS

plain file (K=inherit) (Z=inherit=lz4) 176 bonus System attributes dnode flags: USERUSED_ACCOUNTED USEROBJUSED_ACCOUNTED dnode maxblkid: 0 (bonus encrypted) (object encrypted) Indirect blocks:

root@srv01:/zpool-hdd/encr#

storsan
  • 93
  • 9

0 Answers0