1Rex::Commands::PartitioUns(e3r)Contributed Perl DocumentRaetxi:o:nCommands::Partition(3)
2
3
4

NAME

6       Rex::Commands::Partition - Partition module
7

DESCRIPTION

9       With this Module you can partition your harddrive.
10
11       Version <= 1.0: All these functions will not be reported.
12
13       All these functions are not idempotent.
14

SYNOPSIS

16        use Rex::Commands::Partition;
17

EXPORTED FUNCTIONS

19   clearpart($drive)
20       Clear partitions on drive `sda`:
21
22        clearpart "sda";
23
24       Create a new GPT disk label (partition table) on drive `sda`:
25
26        clearpart "sda",
27         initialize => "gpt";
28
29       If GPT initialization is requested, the `bios_boot` option (default:
30       TRUE) can also be set to TRUE or FALSE to control creation of a BIOS
31       boot partition:
32
33        clearpart "sda",
34         initialize => "gpt",
35         bios_boot => FALSE;
36
37   partition($mountpoint, %option)
38       Create a partition with the specified parameters:
39
40       ondisk
41           The disk to be partitioned. Mandatory.
42
43       size
44           Desired size of the partition in MB. It is mandatory to pass either
45           a "size" or a "grow" parameter (but not both).
46
47       grow
48           If "TRUE", then the partition will take up all the available space
49           on the disk. It is mandatory to pass either a "grow" or a "size"
50           parameter (but not both).
51
52       type
53           Partition type to be passed to "parted"'s "mkpart" command.
54           Optional, defaults to "primary".
55
56       boot
57           Sets boot flag on the partition if "TRUE". Optional, no boot flag
58           is set by default.
59
60       fstype
61           Create a filesystem after creating the partition. Optional, no
62           filesystem is created by default.
63
64       label
65           Label to be used with the filesystem. Optional, defaults to no
66           label.
67
68       mount
69           If "TRUE", try to mount the partition after creating it. Optional,
70           no mount is attempted by default.
71
72       mount_persistent
73           If "TRUE", try to mount the partition after creating it, and also
74           register it in "/etc/fstab". Optional, no mount or "/etc/fstab"
75           manipulation is attempted by default.
76
77       vg  Creates an LVM PV, then creates the specified LVM VG (or extends
78           it, if the VG already exists). Needs "ondisk".
79
80       Examples:
81
82        partition "/",
83          fstype => "ext3",
84          size   => 15000,
85          ondisk => "sda",
86          type   => "primary";
87
88        partition "none",
89          type   => "extended",
90          ondisk => "sda",
91          grow   => 1,
92          mount  => TRUE,
93
94        partition "swap",
95          fstype => "swap",
96          type   => "logical",
97          ondisk => "sda",
98          size   => 8000;
99
100        partition "/",
101          fstype => "ext3",
102          size   => 10000,
103          ondisk => "sda",
104          vg     => "vg0";
105
106
107
108perl v5.34.0                      2022-01-19       Rex::Commands::Partition(3)
Impressum