3.8.2. GFS File Attribute

3.8.2. GFS File Attribute

The gfs_tool command can be used to assign (set) a direct I/O attribute flag, directio, to a GFS file. The directio flag can also be cleared.

You can use the gfs_tool stat filename to check what flags have been set for a GFS file. The output for this command includes a Flags: at the end of the display followed by a listing of the flags that are set for the indicated file.


Setting the directio Flag

gfs_tool setflag directio File

Clearing the directio Flag

gfs_tool clearflag directio File

Specifies the file where the directio flag is assigned.


In this example, the command sets the directio flag on the file named datafile in directory /mnt/gfs.

gfs_tool setflag directio /mnt/gfs/datafile

The following command checks whether the directio flag is set for /mnt/gfs/datafile. The output has been elided to show only the relevant information.

[root@tng3-1 gfs]# gfs_tool stat /mnt/gfs/datafile
  mh_magic = 0x01161970


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.