Module for managing partitions on POSIX-like systems.
Some functions may not be available, depending on your version of parted.
Check man 8 parted for more information, or the online docs at:
http://www.gnu.org/software/parted/manual/html_chapter/parted_2.html
In light of parted not directly supporting partition IDs, some of this module has been written to utilize sfdisk instead. For further information, please reference the man page for sfdisk:
man 8 sfdisk
partition.align_check device part_type partition
Check if partition satisfies the alignment constraint of part_type. Type must be "minimal" or "optimal".
CLI Example:
salt '*' partition.align_check /dev/sda minimal 1
partition.check device minor
Checks if the file system on partition <minor> has any errors.
CLI Example:
salt '*' partition.check 1
partition.check device from_minor to_minor
CLI Example:
salt '*' partition.cp /dev/sda 2 3
Prints the system ID for the partition. Some typical values are:
b: FAT32 (vfat)
7: HPFS/NTFS
82: Linux Swap
83: Linux
8e: Linux LVM
fd: Linux RAID Auto
CLI Example:
salt '*' partition.get_id /dev/sda 1
partition.mkfs device fs_type
CLI Example:
salt '*' partition.mkfs /dev/sda2 fat32
partition.mklabel device label_type
Create a new disklabel (partition table) of label_type. Type should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", "pc98", or "sun".
CLI Example:
salt '*' partition.mklabel /dev/sda msdos
partition.mkpart device part_type fs_type start end
CLI Example:
salt '*' partition.mkpart /dev/sda primary fat32 0 639
partition.mkpartfs device part_type fs_type start end
CLI Example:
salt '*' partition.mkpartfs /dev/sda logical ext2 440 670
partition.name device partition name
CLI Example:
salt '*' partition.name /dev/sda 1 'My Documents'
partition.part_list device unit
Prints partition information of given <device>
CLI Examples:
salt '*' partition.part_list /dev/sda
salt '*' partition.part_list /dev/sda unit=s
salt '*' partition.part_list /dev/sda unit=kB
Ask the kernel to update its local partition data
CLI Examples:
salt '*' partition.probe
salt '*' partition.probe /dev/sda
partition.rescue device start end
CLI Example:
salt '*' partition.rescue /dev/sda 0 8056
partition.resize device minor, start, end
CLI Example:
salt '*' partition.resize /dev/sda 3 200 850
partition.rm device minor
Removes the partition with number <minor>.
CLI Example:
salt '*' partition.rm /dev/sda 5
partition.set device minor flag state
CLI Example:
salt '*' partition.set /dev/sda 1 boot on
Sets the system ID for the partition. Some typical values are:
b: FAT32 (vfat)
7: HPFS/NTFS
82: Linux Swap
83: Linux
8e: Linux LVM
fd: Linux RAID Auto
CLI Example:
salt '*' partition.set_id /dev/sda 1 83
partition.toggle device partition flag
Toggle the state of <flag> on <partition>
CLI Example:
salt '*' partition.name /dev/sda 1 boot