Questions tagged [xattr]

Extended attributes (commonly called "xattrs") are a way to associate metadata with files/directories in the filesystem.

Extended file attributes can be used to store information such as MIME type, checksums, cryptographic keys/certificates, etc; attributes are not interpreted by the filesystem (unlike the normal file attributes). They require operating system and filesystem support; not all operating systems and/or filesystems support them.

For more about extended file attributes, see the Wikipedia article.

102 questions
25
votes
2 answers

What's the meaning of output of lsattr

I'm wondering what the output of lsattr means.It prints so oddly as follows,when I have tried: lsattr /usr. $ lsattr /usr -----------------e- /usr/local -----------------e- /usr/src -----------------e- /usr/games --------------I--e-…
Hongxu Chen
  • 5,828
  • 8
  • 27
  • 32
23
votes
1 answer

How do I get a dump of all extended attributes for a file?

Getfattr dumps a listing of extended attributes for a selected file. However, getfattr --dump filename only to dumps the user.* namespace and not the security.*, system.*, and trusted.* namespaces. Generally, there are no user namespace…
mdpc
  • 6,736
  • 3
  • 32
  • 46
19
votes
2 answers

preserving extended attributes with cp/rsync

When copying with cp, the extended attributes are not preserved, even with explicit cp -a --preserve=all /source /dest or cp -a --preserve=xattr /source /dest The same is with rsync, i.e. rsync -aq -A -X --delete /source /dest However, on the…
Martin Vegter
  • 69
  • 66
  • 195
  • 326
16
votes
6 answers

How to clone/copy all file/directory attributes onto different file/directory?

I want to copy the attributes (ownership, group, ACL, extended attributes, etc.) of one directory to another but not the directory contents itself. This does not work: cp -v --attributes-only A B cp: omitting directory `A' Note: It does…
Grzegorz Wierzowiecki
  • 13,865
  • 23
  • 89
  • 137
16
votes
1 answer

State of ZFS xattr support in FreeBSD

I'm trying to work out whether or not, or rather to what extend, xattrs are supported in FreeBSD using ZFS. I've read some conflicting information. zfs get xattr lists it as on (default) for /, /usr and /var, but as off (temporary) for all other…
MvG
  • 4,361
  • 2
  • 28
  • 42
15
votes
1 answer

find files with extended attributes

Can I use find to find all files which have extended attributes set? Let's say, I want to find all files with +i, immutable attribute in /foo and its subfolders. I could not find any, mention of extended attributes in man find. Is there any other…
Martin Vegter
  • 69
  • 66
  • 195
  • 326
12
votes
3 answers

Tell if a folder/file is hidden in Mac OS X

I know you can set or unset the hidden flag of a folder/file by doing chflags hidden foo.txt and chflags nohidden foo.txt. But is there anyway of telling whether the folder/file is currently hidden or not? I don't want to just determine if the…
Tyilo
  • 5,891
  • 12
  • 47
  • 61
12
votes
1 answer

How are extended attributes stored and preserved?

I have a small question about extended file attributes. Assume I label my files with metadata in extended attributes (e.g. to account for the integrity - but this does not matter for my question). The questions that arise now: Where are these…
Chris
  • 223
  • 2
  • 5
11
votes
2 answers

Difference between xattr and chattr

What is the relation and the difference between xattr and chattr? I want to know when I set a chattr attribute in Linux what is happening inside the Linux kernel and inode metadata.
Cerberuzs
  • 113
  • 1
  • 4
10
votes
2 answers

`chattr +i` error on NFS

I'm trying to secure my authorized_keys file to prevent it from being modified. I run this: [root@localhost]# chattr +i authorized_keys chattr: Inappropriate ioctl for device while reading flags on authorized_keys I think it may be due to the…
mavillan
  • 3,067
  • 4
  • 22
  • 27
9
votes
1 answer

In docker, "chattr: Operation not permitted while setting flags on file"

I'm ssh'ed into a local Centos 7 docker container* and I'm trying to run sudo chattr +i file1 but I'm getting an error: chattr: Operation not permitted while setting flags on file1 What's going on here? What flags is it talking about? Is there a…
Benjamin Berman
  • 203
  • 1
  • 2
  • 5
9
votes
5 answers

How to set `chattr +i` for my `/etc/resolv.conf `?

My os: debian9. The filesystem on my disk: $ sudo blkid | awk '{print $1 ,$3}' /dev/sda2: TYPE="ext4" /dev/sda1: TYPE="vfat" /dev/sda3: TYPE="ext4" /dev/sda4: TYPE="ext4" /dev/sda5: TYPE="swap" Now to chattr +i for my /etc/resolv.conf : sudo…
scrapy
  • 323
  • 4
  • 12
  • 27
8
votes
1 answer

how to remove quarantine from file permissions in os x

I downloaded a .pem file and my Mac OS X (10.8.2) added an @ sign at the end of the file permissions. This is causing file permission issues. I can't seem to remove the quarantine flag. I even tried the command xattr -d .pem but that…
Arunabh Das
  • 223
  • 3
  • 6
7
votes
1 answer

Extended attribute on symbolic link

I'm trying to set some extended attributes on a symbolic link on Fedora 15. According to setfattr's usage, there is an option -h for such purpose: setfattr 2.4.44 -- set extended attributes Usage: setfattr {-n name} [-v value] [-h] file... …
dummyhuan
6
votes
1 answer

What are costs of storing xattrs on ext4, btrfs filesystems?

I imagine that adding n xattrs of length l of to f files and d directories may generate costs: storage path resolution time / access time ? iteration over directories? (recursive find over (fresh after reboot not-cached) filesystem?) I wonder what…
Grzegorz Wierzowiecki
  • 13,865
  • 23
  • 89
  • 137
1
2 3 4 5 6 7