Setting file and directory layout fields

Use the setfattr command to set layout fields on a file or directory.

About this task

Important: When you modify the layout fields of a file, the file must be empty, otherwise an error occurs.
For more information, see the setfattr(1) manual page.

Procedure

Modify layout fields on a file or directory.
setfattr -n ceph.TYPE.layout.FIELD -v VALUE PATH
Replace:
  • TYPE with file or dir.
  • FIELD with the name of the field.
  • VALUE with the new value of the field.
  • PATH with the path to the file or directory.
For example,
[root@mon ~]# setfattr -n ceph.file.layout.stripe_unit -v 1048576 test