linux下setfattr命令出錯:setfattr: file0: Operation not supported__linux

來源:互聯網
上載者:User

1.執行命令時出錯:

運行環境為linux,檔案所在的檔案系統為ext4(可通過mount命令查看)

#setfattr -n test-xattr -v "test" file0

setfattr: file0: Operation not supported (提示資訊)


2.查看man setfattr和man 5 attr

其中的man 5 attr部分內容為:

。。。。。。。。。。。

EXTENDED ATTRIBUTE NAMESPACES
       Attribute  names  are  zero-terminated  strings.   The  attribute  name is always specified in the fully qualified namespace.attribute form, eg.
       user.mime_type, trusted.md5sum, system.posix_acl_access, or security.selinux.

       The namespace mechanism is used to define different classes of extended attributes.  These different classes exist for several reasons, e.g. the
       permissions and capabilities required for manipulating extended attributes of one namespace may differ to another.

       Currently  the security, system, trusted, and user extended attribute classes are defined as described below. Additional classes may be added in
       the future.

。。。。。。。。。。。。。

所以可以知道setfattr -n指定的擴充屬性名字要符合一定的要求。


3.按上面的名字要求再次執行命令

#setfattr -n trusted.test-attr -v "test" file0

(可以執行成功了,)

並且可以通過命令查看

#getfattr -d -m "" file0

輸出結果如下:

# file: file0
trusted.test-xattr="test"



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.