What are extended attributes and immutable files?
AdvancedConceptFilesystem Hierarchy, Inodes & Links
Answer
Extended attributes (xattrs) are name/value pairs attached to inodes, used by SELinux labels (security.selinux), ACLs (system.posix_acl_access) and capabilities (security.capability). Separately, ext4/XFS support inode flags via chattr:
sudo chattr +i /etc/resolv.conf # immutable: even root cannot modify/delete
sudo chattr +a /var/log/audit.log # append-only
lsattr /etc/resolv.conf
getfattr -d -m - /usr/bin/ping
A forgotten +i is a classic "Operation not permitted as root" mystery.
More on Filesystem Hierarchy, Inodes & Links
Explain the purpose of the main top-level directories in the FHS.BeginnerWhat is the "/usr merge"?IntermediateWhat are /proc and /sys?BeginnerWhat is an inode? What does it store and what does it NOT store?BeginnerA disk shows free space but you get "No space left on device". Why?IntermediateWhat is a hard link?Beginner