linux下setfattr命令出错:setfattr: file0: Operation not supported

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"



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值