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

learn more… | top users | synonyms (2)

8
votes
4answers
9k 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:...
8
votes
0answers
200 views

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 ...
7
votes
1answer
6k 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. ...
6
votes
1answer
1k views

What does the 'a' attribute in lsattr mean?

I was trying to remove some old history from my .bash_history file, but I was receiving this message: [john ~] /home/john $ mv .bash_history .bas mv: impossible to move `.bash_history' to `.bas': ...
6
votes
2answers
3k views

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 ...
6
votes
1answer
6k views

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 ...
6
votes
1answer
1k 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 ...
6
votes
2answers
2k 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.
6
votes
2answers
13k views

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 -----------------...
5
votes
2answers
1k views

Immutable bit on AIX?

Under Linux I can: chattr +i SOMEFILE so that even root can't modify the SOMEFILE. Are there any similar solutions for AIX?
4
votes
1answer
696 views

What is the effect of setting immutable bit on /boot partition [closed]

What is the effect of setting immutable bit on /boot partition with perspective of security. is it advisable to set the immutable bit (-i) to everything under /boot? Will it enhance or degrade the ...
4
votes
1answer
636 views

Approaches to prevent user from deleting home folder

I think prevent home folder from deleting is a very good idea. So I search possible approaches to do that. I that's what I’m find: Use chattr +i /home/user - even root can't can add/delete/rename ...
4
votes
1answer
345 views

What is this seemingly base64 data set by setfattr?

I have written a short shell script that simply wraps setfattr in a slightly more convenient form for setting the extended attribute that corresponds to a free-text comment: #!/bin/sh test "$2" &&...
4
votes
1answer
947 views

What does the command “chattr +c /some/dir/” do?

I'm trying to keep a bunch of plain text files compressed using the extended attribute option - c on a debian ppc64 system. I ran the following commands: # mkfs.ext4 /dev/test/compressed # mount /dev/...
4
votes
1answer
755 views

change location of $HOME/.Xauthority

Is it possible to change the location for .Xauthority, to something other than $HOME/.Xauthority ? AFAIU, this file is being created every time I log into LXDE, by my login manager slim. The problem ...
3
votes
2answers
5k views

`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 ...
3
votes
2answers
2k views

What does file version mean: lsattr -v

lsattr -v gives me the "version number" of given file(s). What does this mean? On Redhat 7.3, I could've sworn all the version numbers were 1 except those I changed with chattr -v. On Fedora 11, ...
3
votes
1answer
117 views

Edit a file via a script yet maintain the osx tags

On OSX you can have tags which allows you to identify different categories of files. Here are two text files with different tags when viewed in Finder: I have a large number of these files and have ...
3
votes
1answer
4k views

what does the “a” in chattr +ia do?

what does the a in chattr +ia <filename> do? and why would you add the a in combination with the i? note: I know the i is for immutable
3
votes
1answer
69 views

Linux File Capabilities are lost when I modify the file. Is this expected behavior?

When I modify a file, the file capabilities I had set earlier are lost. Is this the expected behavior? I first set a file capability: $ setcap CAP_NET_RAW+ep ./test.txt $ getcap ./test.txt ./test....
3
votes
1answer
1k views

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: ...
3
votes
1answer
94 views

Is it good practice to make an init script's lockfile immutable?

I recently created an init script, and decided to set lockfile to immutable to prevent external interference. The only downside I can think of is that if someone wanted to recursively delete /var/...
3
votes
1answer
2k views

find files with extended attributes [duplicate]

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 ...
3
votes
1answer
123 views

Automatically set file attributes in a given directory

Let's say I want to set one or more attributes (in the chattr sense) on every file created in a given directory. Is there a way to achieve this automatically, like umask does for file permissions ? ...
3
votes
2answers
531 views

See extended attributes with coreutils ls on Mac

I have coreutils installed via MacPorts on my Mac running OS X 10.8.4. I have ls set to use the coreutils version of ls [(GNU coreutils) 8.21] when available: if [ -e /opt/local/libexec/gnubin ]; ...
3
votes
1answer
148 views

Richacl invalid argument when trying to set atributes

I've compiled a kernel to use richacls, and compiled the richacl's utility, (but not the e2fsprogs). I've mounted a loop file with richacl flags /root/fs_prueba_10mb on /media/ext4_con_richacl type ...
2
votes
2answers
6k views

Unable to run 'sudo chmod +w /etc/hosts'

I am logged into my remote VM (running out of ESXi) as user xyz. I wanted to change my /etc/hosts to add some network names that were not visible by default. I first tried to run sudo vi /etc/hosts ...
2
votes
1answer
32 views

ACL and plain old permissions

I have read a bunch of articles, but still cannot get an idea of ACL, so I have following questions. What are benefits of using ACL over old permissions (0777 for example) and changing file owner,...
2
votes
1answer
68 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 ...
2
votes
1answer
242 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/ [...
2
votes
1answer
302 views

How to utilize extended attributes for image preview?

Is there any file browsers for Linux that cache image previews, just like Windows Explorer cache them to a file named Thumbs.db? As in the latest ext3/4 filesystems, an inode can hold extended ...
2
votes
1answer
745 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 ... ...
2
votes
0answers
17 views

On MAC OS X 10.11.4 - Loss of extended file attribute when copying a file

I have a file with a comment as extended attribute. This is how I can see the attribute from the Terminal: mdls -name kMDItemFinderComment path_to_file I get the answer kMDItemFinderComment = "...
2
votes
0answers
445 views

Samba 3 on Arch Linux, streams_xattr behaviour

I'm running Samba 3.6.8-1 on my x64 Arch Linux installation. I recently decided to have my samba share support NTFS's Alternate Data Streams by using streams_xattr or streams_depot. With streams_xattr ...
2
votes
1answer
279 views

How are default permissions determined (on OS X)?

My (limited) understanding of basic Unix is that any files that are created will be created based on the permissions of the creating user. In particular, the group assigned will be the creating user's ...
1
vote
4answers
88 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 ...
1
vote
2answers
661 views

File compression - how to implement in Linux

I would like to be able to compress certain files (that I need to keep, but use rarely) on disk. I noticed that chattr +c flags a file for compression, but it doesn't seem to actually compress files. ...
1
vote
1answer
138 views

attr man page missing?

How does one search for certain manpages (such as http://linux.die.net/man/5/attr)? Trying: man attr and man -K attr don't seem to work. Any ideas why?
1
vote
1answer
37 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 ...
1
vote
0answers
185 views

Unable to delete files even with root, lsattr is also not responding

I have two somehow corrupt files in my second hard disk of my laptop, which has dual boot Ubuntu 15.04 and Windows 7. I keep it mounted as a ntfs formatted partition in media. I share this drive ...
1
vote
0answers
32 views

Is it normal that I need u+w to set extended filesystem attributes?

I noticed that on panfs, Python's copystat fails when the source file does not have the u+w permission bit set; setting attributes fails with Permission denied command line equivalent: (attr_set: ...
1
vote
0answers
332 views

Can I mount a share and enable the user_xattr mount option?

I have a ext4 drive that is mounted using defaults mount options. It is a RedHat Enterprise Linux version 6.5, 64 bits. I can call lsattr on any file on that server. I need to share that drive with 3 ...
1
vote
0answers
23 views

Is the purpose of setting the version number of a file using chattr similar to optomistic locking in a database?

For instance if you record the version number before editing the file, and check it again before saving the file, you can be assured that nobody else wrote to the file while you were editing it. (...
0
votes
2answers
41 views

How can I give files extended attributes in mac os x?

How can I give files extended attributes in mac os x? Mac os x doesn't have the 'setattr' command.
0
votes
1answer
136 views

Cent OS 6.3 Hidden files in shell

I need help, I want to be able to check whether a file is hidden or not in Cent OS 6.3. These are often referred to as (dot) files but I can clearly see Cent OS 6.3 handling these by appending a ~(...
0
votes
0answers
57 views

SOLVED - OpenVZ acl support for Samba

Setting up Samba-4.3.5 as AD domain fileserver in OpenVZ container, running in ProxMox (pve-manager/3.4-6/102d4547 running kernel: 2.6.32-39-pve). Hardware node has enabled acl support for /var/lib/vz....
0
votes
2answers
591 views

Trouble understanding why getfattr -d doe not 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/ ...
0
votes
1answer
851 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 ...
-1
votes
2answers
58 views

if I delete usr/bin/chattr would other components of the system be affected?

I would like to delete chattr, as in /usr/bin/chattr, I am using Linux Mint, do you think other parts of the system would be affected?