Tag Info

Hot answers tagged

12

The a attribute means that the file is append-only: you can't overwrite it or delete it, only append data to it. This is explained in the chattr man page. Only root can remove the attribute. The practical consequence is that you can't erase your old history lines. This is presumably intended as a security measure by your system administrator. I'm not ...


9

The answer to you question is filesystem specific. For ext3, for example, have a look at fs/ext3/xattr.c, it contains the following description: 16 /* 17 * Extended attributes are stored directly in inodes (on file systems with 18 * inodes bigger than 128 bytes) and on additional disk blocks. The i_file_acl 19 * field contains the block number ...


9

TL;DR Don't do this unless you have peculiar auditing requirements. It's generally more trouble than it's worth. Explanation The only account that should have write access to /boot is root. If you have root, you can unset immutable bits and pretty much do what you want anyway. The major downside of mounting /boot read-only, setting immutable bits, or ...


6

After quite a bit of trial and error on the commandline, I think I've found the answer. But it isn't a cp-related answer. rsync -ptgo -A -X -d --no-recursive --exclude=* first-dir/ second-dir This does: -p, --perms preserve permissions -t, --times preserve modification times -o, --owner preserve owner ...


6

Found the solution here: ls - get information of the directory specified only, not info about the sub-files/folder Which basically is ls -ldO foo and then you just append | awk '{ print $5 }' to make it display the information


5

NFS doesn't have a concept of immutable files, which is why you get the error. I'd suggest that you just remove write access from everyone instead, which is probably close enough for your purposes. $ > foo $ chmod a-w foo $ echo bar > foo bash: foo: Permission denied The main differences between removing the write bit for all users instead of using ...


5

According to the ls man page, you should be able -O option combined with the -l option to view flags with ls. For example: ls -Ol foo.txt -rw-r--r-- 1 harry staff - 0 18 Aug 19:11 foo.txt chflags hidden foo.txt ls -Ol foo.txt -rw-r--r-- 1 harry staff hidden 0 18 Aug 19:11 foo.txt chflags nohidden foo.txt ls -Ol foo.txt -rw-r--r-- 1 harry staff - 0 18 Aug ...


4

xattr -d requires you to specify which attribute you want to remove. You can find this out by listing the file attributes by passing ls the -@ flag as in: ls -l@ filename Once you know what the attribute is, you can target it for removal with -d or you can use the following to clear all attributes: xattr -c filename


4

From the man page of chattr The ’e’ attribute indicates that the file is using extents for mapping the blocks on disk. It may not be removed using chattr. An extent is a contiguous area of storage in a computer file system, reserved for a file. When a process creates a file, file-system management software allocates a whole extent. When writing to the file ...


4

The letters `acdeijstuADST' select the new attributes for the files: append only (a), compressed (c), no dump (d), extent format (e), immutable (i), data journalling (j), secure deletion (s), no tail-merg‐ ing (t), undeletable (u), no atime updates (A), synchronous directory updates (D), synchronous updates (S), and top of directory ...


4

lsattr -v invokes the EXT2_IOC_GETVERSION ioctl for the file. This, in turn, retrieves the inode's i_generation field. This is a feature primarily intended for use with NFS: each time an inode gets allocated, one has to make sure it gets a new generation. Otherwise, NFS clients with stale file handles may manage to access data that weren't meant for them. ...


4

The attributes as handled by lsattr/chattr on Linux and some of which can be stored by quite a few file systems (ext2/3/4, reiserfs, JFS, OCFS2, btrfs, XFS, nilfs2, hfsplus...) and even queried over CIFS/SMB (when with POSIX extensions) are flags. Just bits than can be turned on or off to disable or enable an attribute (like immutable or archive...). How ...


3

Update After messing around with this some more and looking at the code for chattr and other e2fsprogs, it is clear that the attributes set by chattr and those set by libattr (eg with the command setfattr) are very different. chattr sets ext filesystem flags which simply do not map to an named attribute or namespace. None of them show up with any call to ...


2

Makes sense to have a look at the man page of the programs you use: BUGS AND LIMITATIONS The c', 's', andu' attributes are not honored by the ext2 and ext3 filesystems as implemented in the current mainline Linux kernels. This is not supposed to mean "ext4 works" I guess.


2

Ext2 and family (including ext4) reserve an attribute for compression but don't implement it. This feature was originally put off because there were more urgent things to do, and then it became obsolescent as the size of storage media increased a lot faster than the size of data that isn't already compressed. Most large files today (videos, music, even word ...


2

The specific attribute in this issue is i, the immutable attribute. The file was marked immutable. This means it is unchangeable at all by any user including root. Root can still change the attributes and remove the immutable attribute, but must to so first before making changes to the file, unlike standard no-write permissions to a file which root can ...


2

Correct this will not work over NFS. However, on the server where this directory is exported try run your chattr command. With a couple of gotchas You may need to enable ACLs: $ mount -o remount,acl / (To make that change permanent edit your /etc/fstab) SELinux may get in your way: To find out for sure: $ ls -Z


2

I found this comment in fs/xattr.c: /* In user.* namespace, only regular files and directories can have * extended attributes. For sticky directories, only the owner and * privileged user can write attributes. */ I'm not sure why that is, but there you have it; the kernel won't allow user.* eas on anything but a regular file or ...


2

There is no such flag with Linux chattr. You can either make the file immutable or append-only (in either case, the file's permissions and ownership will be locked), or allow the owner of the file and root to change the permissions. (The immutable attribute on a directory prevents creating or removing files from it but not changing entries' metadata.) If ...


2

Nautilus uses ~/.thumbnails normally. Lots of image viewers do generate thumbs there as well. In the normal sub-dir of my system most of the preview files are about 20 KiB in size. It's kinda disturbing that there're no either sqlite database in single file or cache hierarchy (like f/ff/ffdcd558a…1e5200.png) so some FSes could have poor performance looking ...


2

The man page for chattr contains all the info you need to understand the lsattr output. excerpt The letters `acdeijstuACDST' select the new attributes for the files: append only (a), compressed (c), no dump (d), extent format (e), immutable (i), data journalling (j), secure deletion (s), no tail-merging (t), undeletable (u), no ...


2

A tilde suffix marks a backup file for a few text editors, such as Emacs ('~') and Vim ('.ext~'). Some programs hide these files, as most people don't care about them. The only universal convention for a 'hidden' file is a file with a leading '.', due to a feature-like bug which was widely adopted.


1

I had the same problem. Finally, I was able to set richacls with a version of richacl-tools compiled from the commit 95baa060f677e54de11b00d08aacd563fd059270. It seems that the definition of the kernel richacl-fullset struct richace_xattr did not correspond with the definition in richacl-tools.


1

The wikipedia page on chattr says: chattr is a command in the Linux operating system that allows a user to set certain attributes on a file residing on many Linux filesystems. chflags is the analogous command on modern BSD systems, including OS X. The commands are similar to the attrib command on DOS, OS/2 and Microsoft Windows. Other Unix systems have no ...


1

This is not really an answer, but just a interresting find. I played around with lsattr -v and it seems like each new file you create gets a unique number assigned to it. Im not sure if this is correct, my expirement is documented below. $ mkdir temp # make a new folder $ cd temp $ touch a b c d e f g # create a lot files ...



Only top voted, non community-wiki answers of a minimum length are eligible