Module for managing BTRFS file systems.
Add a devices to a BTRFS filesystem.
General options:
CLI Example:
salt '*' btrfs.add /mountpoint /dev/sda1 /dev/sda2
Convert ext2/3/4 to BTRFS. Device should be mounted.
Filesystem can be converted temporarily so the further processing and rollback is possible, or permanently, where previous extended filesystem image gets deleted. Please note, permanent conversion takes a while as BTRFS filesystem needs to be properly rebalanced afterwards.
General options:
lost+found
of the partition (removed by default,CLI Example:
salt '*' btrfs.convert /dev/sda1 salt '*' btrfs.convert /dev/sda1 permanent=True
Defragment mounted BTRFS filesystem. In order to defragment a filesystem, device should be properly mounted and writable.
If passed a device name, then defragmented whole filesystem, mounted on in. If passed a moun tpoint of the filesystem, then only this mount point is defragmented.
CLI Example:
salt '*' btrfs.defragment /dev/sda1 salt '*' btrfs.defragment /path/on/filesystem
Remove devices from a BTRFS filesystem.
CLI Example:
salt '*' btrfs.delete /mountpoint /dev/sda1 /dev/sda2
Get known BTRFS formatted devices on the system.
CLI Example:
salt '*' btrfs.devices
List currently available BTRFS features.
CLI Example:
salt '*' btrfs.mkfs_features
Get BTRFS filesystem information.
CLI Example:
salt '*' btrfs.info /dev/sda1
Create a file system on the specified device. By default wipes out with force.
General options:
Options:
salt <host> btrfs.features
for full list of available features)See the mkfs.btrfs(8)
manpage for a more complete description of corresponding options description.
CLI Example:
salt '*' btrfs.mkfs /dev/sda1 salt '*' btrfs.mkfs /dev/sda1 noforce=True
List properties for given btrfs object. The object can be path of BTRFS device, mount point, or any directories/files inside the BTRFS filesystem.
General options:
CLI Example:
salt '*' btrfs.properties /mountpoint salt '*' btrfs.properties /dev/sda1 type=subvol set='ro=false,label="My Storage"'
Resize filesystem.
General options:
CLI Example:
salt '*' btrfs.resize /mountpoint size=+1g salt '*' btrfs.resize /dev/sda1 size=max
Show in which disk the chunks are allocated.
CLI Example:
salt '*' btrfs.usage /your/mountpoint
Return BTRFS version.
CLI Example:
salt '*' btrfs.version
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.btrfs.html