![]() 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.
0 Comments
Leave a Reply. |