Jump to content
  • 0

Setting or unset certain attributes to a file.


Go to solution Solved by Shahriar Shovon,

Question

sudo chattr +a A_b.txt

OUTPUT:

chattr: Invalid argument while reading flags on A_b.txt

Quote

I couldn't find anything wrong with the command.  But the command never succeeded.

System Info:

Operating System: Arch Linux
Kernel Version: 5.8.13-arch1-1
OS Type: 64-bit

Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
  • Solution
On 10/9/2020 at 4:59 PM, Farhaan Mahmud said:

sudo chattr +a A_b.txt

OUTPUT:

chattr: Invalid argument while reading flags on A_b.txt

System Info:

Operating System: Arch Linux
Kernel Version: 5.8.13-arch1-1
OS Type: 64-bit

Hi Farhaan,
What filesystem are you using on Arch Linux? BTRFS or EXT4?

  • Thanks 1
Link to post
Share on other sites
  • 0
8 hours ago, Farhaan Mahmud said:

I'm using ext4 filesystem.

I think, you have the immutable flag set on that file.

 

First, remove the immutable flag from the file as follows:

$ sudo chattr -i A_b.txt

 

Then, you should be able to set the append attribute as follows:

$ sudo chattr +a A_b.txt

image.png.250f01239aaea503ef24ac6c8f8bd2a4.png

 

I hope this helps.

Shovon

Link to post
Share on other sites
  • 0
Quote

I think, you have the immutable flag set on that file.

It doesn't have any flag because i just created this file using cat command and redirected some text on that file. Moreover if i have had changed any attribute on that file i could see the flag using sudo lsattr A_b.txt but lsattr also showing lsattr: Invalid argument While reading flags on A_b.txt

I think something went wrong with the package e2fsprogs 1.45.6-3 

ls -l 

Output:

-rwxrwxrwx 1 fma fma 226 Oct  8 12:59 A_b.txt

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...