![]() Manually, you can use the lvextend command. Remember that one of the features of LVM is that you can extend the size of the LV. Run this playbook and check whether your LV gets created or use the lvs command. name: Create directory data1 if does not exist Make sure that the directory ( /data1 in this example) exists before executing the playbook.Įxample: - name: Create directory data1 if does not exist After formatting, you mount the partition at any directory. In Ansible, use the filesystem modules for formatting any block device with filesystem. Only you can access this LV for storing data. To use this created LV, you have to mount that partition within the filesystem. ![]() In this example, a 2GB VG creates the first LV with a size of 1GB.Įxample: - name: task for creating logical volume When creating an LV, you give options like VG name, size, and an LV name. Generally, a larger PE size provides better performance.Įxample: - name: task for creating volume group You can change the default size while creating the VG. Use the Ansible lvg module to create a PV and a VG with a Physical Extents (PE) size. You can use the lsblk command to check that the partition now exists.Īfter creating the partition, initialize the LV. To initialize requires you to first create both a PV and a VG. Run this playbook using: $ ansible-playbook partition.yml name: playbook for simple 1 GB partition Simply using the Parted module, you can create partitions of any size. In this example, consider /dev/vdb as the disk name. In Ansible, you can use the Parted module for partitioning. ![]() Parted gives you the flexibility to create a partition using MS-DOS or a GUID Partition Table (GPT) partition. In RHEL 8, you create a partition using the Parted utility. You can resize an LV according to the space required. You can create multiple LVs inside a single VG. LV-Logical Volume is just like a standard partition on a disk.VG-Volume Group is a collection of logical volumes (LVs).When you initialize a PV, it creates a label at the start of the device. PV-Physical Volume initialized on disk, partition, or loopback file.Here are a few essential items you need to understand before using LVM: Automate Red Hat Enterprise Linux with Ansible and Satellite. ![]()
0 Comments
Leave a Reply. |