.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Rex::Commands::Partition 3pm" .TH Rex::Commands::Partition 3pm "2023-03-06" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Rex::Commands::Partition \- Partition module .SH "DESCRIPTION" .IX Header "DESCRIPTION" With this Module you can partition your harddrive. .PP Version <= 1.0: All these functions will not be reported. .PP All these functions are not idempotent. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Rex::Commands::Partition; .Ve .SH "EXPORTED FUNCTIONS" .IX Header "EXPORTED FUNCTIONS" .SS "clearpart($drive)" .IX Subsection "clearpart($drive)" Clear partitions on drive `sda`: .PP .Vb 1 \& clearpart "sda"; .Ve .PP Create a new \s-1GPT\s0 disk label (partition table) on drive `sda`: .PP .Vb 2 \& clearpart "sda", \& initialize => "gpt"; .Ve .PP If \s-1GPT\s0 initialization is requested, the `bios_boot` option (default: \s-1TRUE\s0) can also be set to \s-1TRUE\s0 or \s-1FALSE\s0 to control creation of a \s-1BIOS\s0 boot partition: .PP .Vb 3 \& clearpart "sda", \& initialize => "gpt", \& bios_boot => FALSE; .Ve .ie n .SS "partition($mountpoint, %option)" .el .SS "partition($mountpoint, \f(CW%option\fP)" .IX Subsection "partition($mountpoint, %option)" Create a partition with the specified parameters: .IP "ondisk" 4 .IX Item "ondisk" The disk to be partitioned. Mandatory. .IP "size" 4 .IX Item "size" Desired size of the partition in \s-1MB.\s0 It is mandatory to pass either a \f(CW\*(C`size\*(C'\fR or a \f(CW\*(C`grow\*(C'\fR parameter (but not both). .IP "grow" 4 .IX Item "grow" If \f(CW\*(C`TRUE\*(C'\fR, then the partition will take up all the available space on the disk. It is mandatory to pass either a \f(CW\*(C`grow\*(C'\fR or a \f(CW\*(C`size\*(C'\fR parameter (but not both). .IP "type" 4 .IX Item "type" Partition type to be passed to \f(CW\*(C`parted\*(C'\fR's \f(CW\*(C`mkpart\*(C'\fR command. Optional, defaults to \f(CW\*(C`primary\*(C'\fR. .IP "boot" 4 .IX Item "boot" Sets boot flag on the partition if \f(CW\*(C`TRUE\*(C'\fR. Optional, no boot flag is set by default. .IP "fstype" 4 .IX Item "fstype" Create a filesystem after creating the partition. Optional, no filesystem is created by default. .IP "label" 4 .IX Item "label" Label to be used with the filesystem. Optional, defaults to no label. .IP "mount" 4 .IX Item "mount" If \f(CW\*(C`TRUE\*(C'\fR, try to mount the partition after creating it. Optional, no mount is attempted by default. .IP "mount_persistent" 4 .IX Item "mount_persistent" If \f(CW\*(C`TRUE\*(C'\fR, try to mount the partition after creating it, and also register it in \f(CW\*(C`/etc/fstab\*(C'\fR. Optional, no mount or \f(CW\*(C`/etc/fstab\*(C'\fR manipulation is attempted by default. .IP "vg" 4 .IX Item "vg" Creates an \s-1LVM PV,\s0 then creates the specified \s-1LVM VG\s0 (or extends it, if the \s-1VG\s0 already exists). Needs \f(CW\*(C`ondisk\*(C'\fR. .PP Examples: .PP .Vb 5 \& partition "/", \& fstype => "ext3", \& size => 15000, \& ondisk => "sda", \& type => "primary"; \& \& partition "none", \& type => "extended", \& ondisk => "sda", \& grow => 1, \& mount => TRUE, \& \& partition "swap", \& fstype => "swap", \& type => "logical", \& ondisk => "sda", \& size => 8000; \& \& partition "/", \& fstype => "ext3", \& size => 10000, \& ondisk => "sda", \& vg => "vg0"; .Ve