Module for managing XFS file systems.


Defragment mounted XFS filesystem. In order to mount a filesystem, device should be properly mounted and writable.

CLI Example:

salt '*' xfs.defragment /dev/sda1

Get known XFS formatted devices on the system.

CLI Example:

salt '*' xfs.devices
salt.modules.xfs.dump(device, destination, level=0, label=None, noerase=None)

Dump filesystem device to the media (file, tape etc).

Required parameters:

  • device: XFS device, content of which to be dumped.
  • destination: Specifies a dump destination.

Valid options are:

  • label: Label of the dump. Otherwise automatically generated label is used.
  • level: Specifies a dump level of 0 to 9.
  • noerase: Pre-erase media.

Other options are not used in order to let xfsdump use its default values, as they are most optimal. See the xfsdump(8) manpage for a more complete description of these options.

CLI Example:

salt '*' xfs.dump /dev/sda1 /detination/on/the/client
salt '*' xfs.dump /dev/sda1 /detination/on/the/client label='Company accountancy'
salt '*' xfs.dump /dev/sda1 /detination/on/the/client noerase=True

Estimate the space that an XFS filesystem will take. For each directory estimate the space that directory would take if it were copied to an XFS filesystem. Estimation does not cross mount points.

CLI Example:

salt '*' xfs.estimate /path/to/file
salt '*' xfs.estimate /path/to/dir/*

Get filesystem geometry information.

CLI Example:

salt '*' /dev/sda1

Display XFS dump inventory without restoration.

CLI Example:

salt '*' xfs.inventory
salt.modules.xfs.mkfs(device, label=None, ssize=None, noforce=None, bso=None, gmo=None, ino=None, lso=None, rso=None, nmo=None, dso=None)

Create a file system on the specified device. By default wipes out with force.

General options:

  • label: Specify volume label.
  • ssize: Specify the fundamental sector size of the filesystem.
  • noforce: Do not force create filesystem, if disk is already formatted.

Filesystem geometry options:

  • bso: Block size options.

  • gmo: Global metadata options.

  • dso: Data section options. These options specify the location, size,

    and other parameters of the data section of the filesystem.

  • ino: Inode options to specify the inode size of the filesystem, and other inode allocation parameters.

  • lso: Log section options.

  • nmo: Naming options.

  • rso: Realtime section options.

See the mkfs.xfs(8) manpage for a more complete description of corresponding options description.

CLI Example:

salt '*' xfs.mkfs /dev/sda1
salt '*' xfs.mkfs /dev/sda1 dso='su=32k,sw=6' noforce=True
salt '*' xfs.mkfs /dev/sda1 dso='su=32k,sw=6' lso='logdev=/dev/sda2,size=10000b'
salt.modules.xfs.modify(device, label=None, lazy_counting=None, uuid=None)

Modify parameters of an XFS filesystem.

CLI Example:

salt '*' xfs.modify /dev/sda1 label='My backup' lazy_counting=False
salt '*' xfs.modify /dev/sda1 uuid=False
salt '*' xfs.modify /dev/sda1 uuid=True

Prunes the dump session identified by the given session id.

CLI Example:

salt '*' xfs.prune_dump b74a3586-e52e-4a4a-8775-c3334fa8ea2c