Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
3.2. Configuring an LVM Volume with an ext4 File System
This use case requires that you create an LVM logical volume on storage that is shared between the nodes of the cluster.
The following procedure creates an LVM logical volume and then creates an
ext4file system on that volume. In this example, the shared partition
/dev/sdb1is used to store the LVM physical volume from which the LVM logical volume will be created.
LVM volumes and the corresponding partitions and devices used by cluster nodes must be connected to the cluster nodes only.
/dev/sdb1partition is storage that is shared, you perform this procedure on one node only,
- Create an LVM physical volume on partition
pvcreate /dev/sdb1Physical volume "/dev/sdb1" successfully created
- Create the volume group
my_vgthat consists of the physical volume
vgcreate my_vg /dev/sdb1Volume group "my_vg" successfully created
- Create a logical volume using the volume group
lvcreate -L450 -n my_lv my_vgRounding up size to full physical extent 452.00 MiB Logical volume "my_lv" createdYou can use the
lvscommand to display the logical volume.
lvsLV VG Attr LSize Pool Origin Data% Move Log Copy% Convert my_lv my_vg -wi-a---- 452.00m ...
- Create an
ext4file system on the logical volume
mkfs.ext4 /dev/my_vg/my_lvmke2fs 1.42.7 (21-Jan-2013) Filesystem label= OS type: Linux ...