Module for managing disks and blockdevices
Return block device attributes: UUID, LABEL, etc. This function only works on systems where blkid is available.
CLI Example:
salt '*' disk.blkid salt '*' disk.blkid /dev/sda
Return all contents of dumpe2fs for a specified device
CLI Example: .. code-block:: bash
salt '*' disk.dump /dev/sda1
Format a filesystem onto a device
New in version 2016.11.0.
Size of the inodes
This option is only enabled for ext and xfs filesystems
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
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
Return the filesystem name of the specified device
New in version 2016.11.0.
CLI Example:
salt '*' disk.fstype /dev/sdX1
Retrieve all info's for all disks parse 'em into a nice dict (which, considering hdparms output, is quite a hassle)
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' disk.hdparms /dev/sda
Get/set Host Protected Area settings
T13 INCITS 346-2001 (1367D) defines the BEER (Boot Engineering Extension Record) and PARTIES (Protected Area Run Time Interface Extension Services), allowing for a Host Protected Area on a disk.
It's often used by OEMS to hide parts of a disk, and for overprovisioning SSD's
Warning
Setting the HPA might clobber your data, be very careful with this on active disks!
New in version 2016.3.0.
CLI Example:
salt '*' disk.hpa /dev/sda salt '*' disk.hpa /dev/sda 5% salt '*' disk.hpa /dev/sda 10543256
Return inode usage information for volumes mounted on this minion
CLI Example:
salt '*' disk.inodeusage
Gather and return (averaged) IO stats.
New in version 2016.3.0.
Changed in version 2016.11.4: Added support for AIX
CLI Example:
salt '*' disk.iostat 1 5 disks=sda
Return partition information for volumes mounted on this minion
CLI Example:
salt '*' disk.percent /var
Resizes the filesystem.
CLI Example: .. code-block:: bash
salt '*' disk.resize2fs /dev/sda1
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)
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.
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
Remove the filesystem information
CLI Example:
salt '*' disk.wipe /dev/sda1
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.disk.html