lib/filesystem_utils.pm

str_to_mb

Format number and unit from KB, MB, GB, TB to MB

parted_print

Print dev partition info by MB

partition_num_by_start_end

Get partition number by given device partition start and end

partition_num_by_type

Get the first parition number by given device and partition/FS type. e.g. extended, xfs Return -1 when not find

free_space

Get all information (start, end, size) about the bigest free space Return a hash contain start, end and size

mountpoint_to_partition

Get partition by mountpoint, e.g. give /home get /dev/sda3

partition_table

Get partition table information by giving device

create_partition

Create a new partition by giving device, partition type and partition size part_type (extended|logical|primary)

remove_partition

Remove a partition by given partition name, e.g /dev/sdb5

format_partition

Format partition to target filesystem

df_command

Returns the value of the "df -h" output in given column, for a given partition

  df_command([partition=>$partition , column=> $column])

get_partition_size

Return the value of the defined partition size

  get_partition_size($partition)

get_used_partition_space

Returns the value of used space of the defined partition

  get_used_partition_space($partition)