salt.modules.blockdev

Module for managing block devices

2014.7.0 新版功能.

Carbon 版后已移除: Merged to disk module

salt.modules.blockdev.dump(device, args=None)

Return all contents of dumpe2fs for a specified device

Carbon 版后已移除: Use disk.dump

args
a list containing only the desired arguments to return

CLI 范例:

salt '*' blockdev.dump /dev/sdX1
salt.modules.blockdev.format(device, fs_type='ext4', inode_size=None, lazy_itable_init=None, force=False)

Format a filesystem onto a block device

2015.8.2 新版功能.

device
The block 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

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.

Carbon 新版功能.

CLI 范例:

salt '*' blockdev.format /dev/sdX1
salt.modules.blockdev.fstype(device)

Return the filesystem name of a block device

2015.8.2 新版功能.

device
The name of the block device

CLI 范例:

salt '*' blockdev.fstype /dev/sdX1
salt.modules.blockdev.resize2fs(device)

Resizes the filesystem.

Carbon 版后已移除: Use disk.resize2fs

CLI Example: .. code-block:: bash

salt '*' blockdev.resize2fs /dev/sdX1
salt.modules.blockdev.tune(device, **kwargs)

Set attributes for the specified device

Carbon 版后已移除: Use disk.tune

CLI 范例:

salt '*' blockdev.tune /dev/sdX1 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.blockdev.wipe(device)

Remove the filesystem information

Carbon 版后已移除: Use disk.tune

CLI 范例:

salt '*' blockdev.wipe /dev/sdX1