{"id":8478,"date":"2020-08-28T12:58:39","date_gmt":"2020-08-28T04:58:39","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=8478"},"modified":"2020-08-28T12:58:39","modified_gmt":"2020-08-28T04:58:39","slug":"getfattr","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/getfattr","title":{"rendered":"getfattr\u547d\u4ee4 – \u83b7\u53d6\u6587\u4ef6\u7cfb\u7edf\u5bf9\u8c61\u7684\u6269\u5c55\u5c5e\u6027"},"content":{"rendered":"\n
getfattr\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u53ef\u4ee5\u83b7\u5f97\u6587\u4ef6\u7cfb\u7edf\u5bf9\u8c61\u7684\u6269\u5c55\u5c5e\u6027\u3002<\/p>\n\n\n\n
\u5bf9\u4e8e\u6bcf\u4e2a\u6587\u4ef6\uff0cgetfattr\u547d\u4ee4\u4f1a\u663e\u793a\u8be5\u6587\u4ef6\u76f8\u5173\u8054\u7684\u6587\u4ef6\u540d\u548c\u8be5\u7ec4\u7684\u6269\u5c55\u5c5e\u6027\u7684\u540d\u79f0\uff08\u548c\u4efb\u9009\u7684\u503c\uff09\u3002<\/p>\n\n\n\n
\u8fd9\u91cc\u7684\u6587\u4ef6\u7cfb\u7edf\u6269\u5c55\u5c5e\u6027\uff0c\u4e0d\u662f\u6211\u4eec\u5e38\u8bf4\u7684lsattr\u547d\u4ee4\u548cchattr\u547d\u4ee4\u4e2d\u6587\u4ef6\u64cd\u4f5c\u7684\u5c5e\u6027\u3002\u8fd9\u91cc\u7684\u6269\u5c55\u5c5e\u6027\u662f\u5b8c\u5168\u81ea\u5b9a\u4e49\u7684\u3002\u6269\u5c55\u5c5e\u6027\u7684\u652f\u6301\uff0c\u4e0d\u540c\u6587\u4ef6\u7cfb\u7edf\u5bf9\u5176\u652f\u6301\u7a0b\u5ea6\u4e0d\u540c\u3002\u67d0\u4e9b\u7cfb\u7edf\u5bf9\u4e8e\u6587\u4ef6\u5173\u8054\u7684\u6269\u5c55\u5c5e\u6027\u7684\u6570\u91cf\u548c\u5927\u5c0f\u8fd8\u6709\u66f4\u4e3a\u4e25\u683c\u7684\u9650\u5236\u3002<\/p>\n\n\n\n
\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>getfattr [\u53c2\u6570][\u8def\u5f84]<\/p>\n\n\n\n \u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n \u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n \u67e5\u770b\/root\/linuxcool.cfg\u6587\u4ef6\u7684\u6269\u5c55\u5c5e\u6027\u503c\uff1a<\/p>\n\n\n\n \u67e5\u770b\u6587\u4ef6\u6307\u5b9a\u7684\u6269\u5c55\u5c5e\u6027\uff1a<\/p>\n\n\n\n [root@linuxcool ~]# getfattr -n ‘trusted.gfid’ -d -e hex --absolute-names $(vs_quick_lookup.sh vm-disk-1.qcow2 | grep $(hostname) | awk -F “:” ‘{print $2}’ )<\/p>\n\n\n\n \u7edf\u8ba1cephfs\u76ee\u5f55\u4e0b\u5b58\u653e\u7684\u6570\u636e\u91cf\u4ee5\u53ca\u6765\u83b7\u53d6\u6587\u4ef6\u7cfb\u7edf\u7ed9\u51fa\u7684\u6269\u5c55\u5c5e\u6027\uff1a<\/p>\n\n\n\n <\/p>\n","protected":false},"excerpt":{"rendered":" getfattr\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u53ef\u4ee5\u83b7\u5f97\u6587\u4ef6\u7cfb\u7edf\u5bf9\u8c61\u7684\u6269\u5c55\u5c5e\u6027\u3002 \u5bf9\u4e8e\u6bcf\u4e2a\u6587\u4ef6\uff0cgetfattr\u547d\u4ee4\u4f1a\u663e\u793a\u8be5\u6587\u4ef6\u76f8 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8478"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=8478"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8478\/revisions"}],"predecessor-version":[{"id":8498,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8478\/revisions\/8498"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=8478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=8478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=8478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}-n<name><\/td> \u5f97\u5230\u547d\u540d\u6269\u5c55\u5c5e\u6027\u503c<\/td><\/tr> -d<\/td> \u83b7\u5f97\u6240\u6709\u6269\u5c55\u5c5e\u6027\u503c<\/td><\/tr> -e<\u7f16\u7801><\/td> \u7f16\u7801\u503c\uff08\u4e3a\u6587\u672c\u3001\u5341\u516d\u8fdb\u5236\u6216base64\u7f16\u7801\uff09<\/td><\/tr> -h<\/td> \u4e0d\u5f15\u7528\u7b26\u53f7\u94fe\u63a5<\/td><\/tr> -R<\/td> \u9012\u5f52\u5230\u5b50\u76ee\u5f55<\/td><\/tr> -m<\u6a21\u5f0f><\/td> \u5305\u62ec\u540d\u79f0\u5339\u914d\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u7684\u5c5e\u6027<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n [root@linuxcool ~]# getfattr -d -m \/root\/linuxcool.cfg<\/pre>\n\n\n\n
[root@linuxcool ~]# getfattr -d -m ceph.dir.* \/mnt\/cephfs<\/pre>\n\n\n\n