Module for managing disks and blockdevices
salt.modules.disk.
blkid
(device=None)¶Return block device attributes: UUID, LABEL, etc. This function only works on systems where blkid is available.
命令行接口CLI 范例:
salt '*' disk.blkid
salt '*' disk.blkid /dev/sda
salt.modules.disk.
dump
(device, args=None)¶Return all contents of dumpe2fs for a specified device
CLI Example: .. code-block:: bash
salt '*' disk.dump /dev/sda1
salt.modules.disk.
hdparms
(disks, args=None)¶Retrieve all info's for all disks parse 'em into a nice dict (which, considering hdparms output, is quite a hassle)
2016.3.0 新版功能.
CLI Example: .. code-block:: bash
salt '*' disk.hdparms /dev/sda
salt.modules.disk.
hpa
(disks, size=None)¶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
警告
Setting the HPA might clobber your data, be very careful with this on active disks!
2016.3.0 新版功能.
命令行接口CLI 范例:
salt '*' disk.hpa /dev/sda
salt '*' disk.hpa /dev/sda 5%
salt '*' disk.hpa /dev/sda 10543256
salt.modules.disk.
inodeusage
(args=None)¶返回这个Minion上的挂载的磁盘卷的inode使用情况。
命令行接口CLI 范例:
salt '*' disk.inodeusage
salt.modules.disk.
iostat
(interval=1, count=5, disks=None)¶Gather and return (averaged) IO stats.
2016.3.0 新版功能.
命令行接口CLI 范例:
salt '*' disk.iostat 1 5 disks=sda
salt.modules.disk.
percent
(args=None)¶Return partition information for volumes mounted on this minion
命令行接口CLI 范例:
salt '*' disk.percent /var
salt.modules.disk.
resize2fs
(device)¶Resizes the filesystem.
CLI Example: .. code-block:: bash
salt '*' disk.resize2fs /dev/sda1
salt.modules.disk.
smart_attributes
(dev, attributes=None, values=None)¶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)
2016.3.0 新版功能.
命令行接口CLI 范例:
salt '*' disk.smart_attributes /dev/sda
salt '*' disk.smart_attributes /dev/sda attributes=(5,187,188,197,198)
salt.modules.disk.
tune
(device, **kwargs)¶Set attributes for the specified device
命令行接口CLI 范例:
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.
salt.modules.disk.
usage
(args=None)¶返回这个minion上挂载的磁盘卷的使用情况
命令行接口CLI 范例:
salt '*' disk.usage
salt.modules.disk.
wipe
(device)¶Remove the filesystem information
命令行接口CLI 范例:
salt '*' disk.wipe /dev/sda1