- name: Read device information (always use unit when probing) community.general.parted: device: /dev/sda unit: MiB register: sda_info - name: Extend an existing partition to fill all available space community.general.parted: device: /dev/sda number: "{{ sda_info.partitions | length }}"...
use unit when probing)community.general.parted:device=/dev/sdb unit=MiBregister:sdb_info-name:Remove all partitions from diskcommunity.general.parted:device:/dev/sdbnumber:'{{item.num}}'state:absentloop:'{{sdb_info.partitions}}'-name:Extend an existing partition to fill all available spacecommu...
Fast clone (invasive) - prepare the input device and create minimal archive without the unpartitioned space (shrink last partition, fill with zeroes, compress partitions on the fly, extend last partition): ddarch -i /dev/sdx --in-place --skip-unpart ...
On the other hand, if we’re using the command-line mode, we run thepartedcommand together with the right options. If the command is successful, it doesn’t throw an error and the cursor moves to a new line. We must specify the partition/drive we want to run the command on: $ sudo...