Saltstack module disk Detailed

disk.tune

Set attributes for the specified device

CLI Example:

    salt '*' disk.tune /dev/sda1 read-ahead=1024 read-write=True

Valid options are: ``read-ahead``, ``filesystem-read-ahead``,
``read-only``, ``read-write``.

See the ``blockdev(8)`` manpage for a more complete description of these
options.

disk.fstype

Return the filesystem name of the specified device

New in version 2016.11.0

device
    The name of the device

CLI Example:

    salt '*' disk.fstype /dev/sdX1

disk.wipe

Remove the filesystem information

CLI Example:

    salt '*' disk.wipe /dev/sda1

disk.percent

Return partition information for volumes mounted on this minion

CLI Example:

    salt '*' disk.percent /var

disk.smart_attributes

Fetch SMART attributes
Providing attributes will deliver only requested attributes
Providing values will deliver only requested values for attributes

Default is the Backblaze recommended
set (https://www.backblaze.com/blog/hard-drive-smart-stats/):
(5,187,188,197,198)

New in version 2016.3.0

CLI Example:

    salt '*' disk.smart_attributes /dev/sda
    salt '*' disk.smart_attributes /dev/sda attributes=(5,187,188,197,198)

disk.resize2fs

Resizes the filesystem.

CLI Example:
    salt '*' disk.resize2fs /dev/sda1

disk.inodeusage

Return inode usage information for volumes mounted on this minion

CLI Example:

    salt '*' disk.inodeusage

disk.format

Format a filesystem onto a device

New in version 2016.11.0

device
    The device in which to create the new filesystem

fs_type
    The type of filesystem to create

inode_size
    Size of the inodes

    This option is only enabled for ext and xfs filesystems

lazy_itable_init
    If enabled and the uninit_bg feature is enabled, the inode table will
    not be fully initialized by mke2fs.  This speeds up filesystem
    initialization noticeably, but it requires the kernel to finish
    initializing the filesystem  in  the  background  when  the filesystem
    is first mounted.  If the option value is omitted, it defaults to 1 to
    enable lazy inode table zeroing.

    This option is only enabled for ext filesystems

fat
    FAT size option. Can be 12, 16 or 32, and can only be used on
    fat or vfat filesystems.

force
    Force mke2fs to create a filesystem, even if the specified device is
    not a partition on a block special device. This option is only enabled
    for ext and xfs filesystems

    This option is dangerous, use it with caution.

CLI Example:

    salt '*' disk.format /dev/sdX1

disk.dump

Return all contents of dumpe2fs for a specified device

CLI Example:
    salt '*' disk.dump /dev/sda1

disk.blkid

Return block device attributes: UUID, LABEL, etc. This function only works
on systems where blkid is available.

device
    Device name from the system

token
    Any valid token used for the search

CLI Example:

    salt '*' disk.blkid
    salt '*' disk.blkid /dev/sda
    salt '*' disk.blkid token='UUID=6a38ee5-7235-44e7-8b22-816a403bad5d'
    salt '*' disk.blkid token='TYPE=ext4'

disk.usage

Return usage information for volumes mounted on this minion

Changed in version 2019.2.0

    Default for SunOS changed to 1 kilobyte blocks

CLI Example:

    salt '*' disk.usage

Guess you like

Origin www.cnblogs.com/randomlee/p/Saltstack_module_disk.html