Questions tagged [xattr]

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

Filter by
Sorted by
Tagged with
6 votes
1 answer
13k views

What is the effect of "chattr +a" on a directory

The a Linux file attribute is often documented as applicable to files. chattr(1) manpage: A file with the 'a' attribute set can only be open in append mode for writing. ext4 wiki: 0x20 File ...
Franklin Piat's user avatar
17 votes
6 answers
33k views

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:...
Grzegorz Wierzowiecki's user avatar
4 votes
1 answer
3k views

Can't set extended attributes on ext4 on fedora 22 - operation not supported

I am trying to get extended attributes working on Fedora 22. I can't seem to be able to set the attributes even on my files, but I can read them. Here's how it looks: [jarek@localhost ~]$ cd /tmp/ [...
JarekD's user avatar
  • 43
23 votes
1 answer
23k views

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....
mdpc's user avatar
  • 6,854
19 votes
2 answers
32k views

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. ...
Martin Vegter's user avatar
12 votes
1 answer
5k views

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 ...
Chris's user avatar
  • 223
11 votes
2 answers
7k views

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's user avatar
  • 113
9 votes
5 answers
56k views

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 ...
scrapy's user avatar
  • 333
5 votes
3 answers
8k views

Why doesn't `getfattr -d` show anything?

The successful command from which I started: getfattr -n system.ntfs_times /media/hdd/oldfolder/ output getfattr: Removing leading '/' from absolute path names # file: media/hdd/oldfolder/ ...
bloys's user avatar
  • 51
3 votes
1 answer
1k views

How to apply and use Rich Access Control Lists with BTRFS

I am just learning about Rich Access Control Lists on Linux. My immediate objective is to give members of the group the same rights as the owner for a subdirectory tree (all files and directories ...
MountainX's user avatar
  • 18k
2 votes
1 answer
752 views

Automatically set append attribute for newly created files/folders?

I'm trying to setup a folder so that users can only create or modify files/folders in it, but not delete them. I tried the 'chattr +a' command and got different results in RHEL5.8 and RHEL6.5 ...
Eric Zhang's user avatar
2 votes
1 answer
2k views

immutable-like flag for perms

Is there any chattr flag that would allow me to lock a file's unix permissons, and not change them without resetting the flag? The file itself should still be modifiable, I just want to prevent ... ...
xenoterracide's user avatar
1 vote
4 answers
285 views

I need to make a file undeleteable, but allow it to be modifiable and renameable

I have a script that checks for the presence of a file, and if it exists, read a list of email addresses from it to send notifications. When I don't need to be notified, for instance, when I'm at work ...
user208145's user avatar
  • 2,495
0 votes
1 answer
2k views

Prevent directory permission change (or cronjob to work around)

I have a HostGator dedicated server running CentOS. I have a folder on one user's account where I want all users to be able to have read access, so we keep it chmod'd to 755. HG has a script that runs ...
TecBrat's user avatar
  • 137