Chattr don't want to work

Hi all!

$ mount | grep home
/dev/sda2 on /home type btrfs (rw,relatime,seclabel,compress=zstd:1,ssd,space_cache=v2,subvolid=256,subvol=/home)

$ ls -l WF.txt 
-rw-r--r--. 1 archer archer 1100 Sep 29  2021 WF.txt

$ lsattr  WF.txt 
---------------------- WF.txt
$ chattr +u  WF.txt 
chattr: Operation not supported while setting flags on WF.txt
$ lsattr  WF.txt 
---------------------- WF.txt
$ chattr +i  WF.txt 
chattr: Operation not permitted while setting flags on WF.txt
$ lsattr  WF.txt 
---------------------- WF.txt
$ 

At first i thought the reason is “compress=zstd:1” mount option.

Then mentioned that I have another drive

mount | grep R1
/dev/sdb on /mnt/R1 type btrfs (rw,relatime,seclabel,space_cache,subvolid=5,subvol=/)'

cd /mnt/R1/DataR/BackUp
$ lsattr Bookmarks  
---------------------- Bookmarks
$ chattr +u  Bookmarks  
chattr: Operation not supported while setting flags on Bookmarks
$ lsattr Bookmarks  
---------------------- Bookmarks

The same.

Before at another Linux I used to put attributes on this disc
Proof=

$ lsattr IAF34
---------------C------ IAF34/Logs
---------------C------ IAF34/Snapshots
---------------C------ IAF34/iaF34.vdi
---------------C------ IAF34/IAF34.vbox-prev
---------------C------ IAF34/IAF34.vbox

Why “Operation not supported” now?
Thanx.

1 Like

Based on man chattr[1], I think that not all the attributes are supported in every file system. For instance, there is no mention of u in the btrfs-man5(5) — BTRFS documentation


  1. BUGS AND LIMITATIONS The 'c', 's', and 'u' attributes are not honored by the ext2, ext3, and ext4 file systems as implemented in the current mainline Linux kernels. Setting 'a' and 'i' attributes will not affect the ability to write to already existing file descriptors. ↩︎

:thinking: …disappointed… :disappointed_relieved:

What do you use that option for?
Because if

u      When a file with the 'u' attribute set is deleted, its
              contents are saved.  This allows the user to ask for its
              undeletion.

You could consider btrfs snapshots.

1 Like

OK
Thanx

2 Likes