salt.modules.blockdev

Module for managing block devices

New in version 2014.7.0.

Deprecated since version Carbon: Merged to disk module

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

Return all contents of dumpe2fs for a specified device

Deprecated since version 2016.3.0: Use disk.dump

args
a list containing only the desired arguments to return

CLI Example:

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

Format a filesystem onto a block device

New in version 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

CLI Example:

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

Return the filesystem name of a block device

New in version 2015.8.2.

device
The name of the block device

CLI Example:

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

Resizes the filesystem.

Deprecated since version 2016.3.0: 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

Deprecated since version 2016.3.0: Use disk.tune

CLI Example:

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

Deprecated since version 2016.3.0: Use disk.tune

CLI Example:

salt '*' blockdev.wipe /dev/sdX1