KB 461005 - Create LVM in Centos/Rocky Linux.

KB 461005 - Create LVM in Centos/Rocky Linux.

What is LVM?

LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes.
With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks.
The physical volumes are combined into logical volumes, with the exception of the /boot partition. The /boot partition cannot be on a logical volume group because the boot loader cannot read it. If the root (/) partition is on a logical volume, create a separate /boot partition which is not a part of a volume group.


How to Create LVM in Centos and Rocky Linux.

Code to create LVM.

  1. yum install -y makecache lvm2
  2. lsblk
  3. pvcreate /dev/sdb /dev/sdc
  4. vgcreate demo_lvm_group /dev/sdb /dev/sdc
  5. lvcreate -L 5G -n demo_lvm_volume demo_lvm_group
  6. mkfs.ext4 /dev/demo_lvm_group/demo_lvm_volume
  7. mkdir /mnt/lvm
  8. mount /dev/demo_lvm_group/demo/lvm_volume /mnt/lvm/
  9. df -h

Code Definition

To install LVM
$yum install -y makecache lvm2

To check available partition
$lsblk

Command to create Physical Volume, here you can define one or more partition name. 
$pvcreate /dev/sdb /dev/sdc

Command to create Logical Volume Group, "demo_lvm_group" is a name, shoulb be change. 
$vgcreate [demo_lvm_group] /dev/sdb /dev/sdc

Command to create Logical Volume, -L is use for define size, -n is use for Logical Volume name "demo_lvm_volume" (Changable). 
$lvcreate -L 5G -n [demo_lvm_volume] [demo_lvm_group]

Command to create file system for newly created Logical Volume.
$mkfs.ext4 /dev/demo_lvm_group/demo_lvm_volume

Create directory and mount Logical Volume
$mkdir /mnt/lvm
$mount /dev/demo_lvm_group/demo/lvm_volume /mnt/lvm/
$df -h

Snapshots





    • Recent Articles

    • KB-630208 | How to use Find and Locate to search for files in Linux

      Purpose To provide Linux administrators and Field Engineers with guidance on using the find and locate utilities to efficiently search for files and directories within a Linux filesystem based on criteria such as name, type, size, timestamps, ...
    • KB-630164 | How to use rsync to Synchronize Files

      Purpose To provide a clear and practical procedure for using the rsync utility to synchronize files and directories between local systems and remote hosts, including push and pull operations, while preserving file attributes and optimizing data ...
    • KB-630107 | How to create a Linux swap file

      Purpose To provide Field Engineers and Linux administrators with a standardized procedure for creating, configuring, and validating a Linux swap file. This procedure helps ensure sufficient virtual memory is available when physical RAM is exhausted ...
    • MSI All-in-One (AIO) PC – Physical Damage Policy for Warranty Claims

      MSI All-in-One (AIO) PC – Physical Damage Policy for Warranty Claims MSI's standard warranty does not cover physical or accidental damage to an All-in-One (AIO) PC. If the damage is determined to be caused by external factors rather than a ...
    • KB 134833 - Troubleshooting NVSM Alert NV-CPU-XX – Unrecoverable CPU Internal Error

      Purpose This document provides a general troubleshooting procedure for the NVIDIA System Management (NVSM) alert NV-CPU-XX, which indicates that a CPU has reported an internal error. The article outlines how to verify whether the alert represents an ...
    • Popular Articles

    • CP Plus Camera and NVR Configuration

      NVR Configuration The CP Plus Pro Series of NVRs have been meticulously designed for providing you with upgraded performance and higher recording quality in your IP video surveillance solution. The robust processor that has been inculcated in this ...
    • KB 775235 - Kerberos Authentication – Overview

      What is Kerberos? Kerberos is a secure authentication method used in our Active Directory (AD) environment (mbuzztech.com). It allows users to: Access multiple systems without re-entering passwords (Single Sign-On – SSO) Log in once Where We Use It ...
    • How to Remove and Reinstall NVIDIA Drivers on Ubuntu

      This article provides step by step guide to completely remove existing NVIDIA drivers and reinstall specific version of the NVIDIA driver on the Ubuntu system Prerequisites Administrative (sudo) access to the Ubuntu system. Internet access to ...
    • KB 692001 - Personal Computers and Servers - Classification and Point of Contact

      We can classify the computers that MBUZZ handles based on their form-factor as below: Tower Workstations, Desktops, Gaming PCs and SFF (Small form factor) PCs fall under this category. These are computers people would use on a desk and rarely move. ...
    • KB 298031 - M.2 SSD Tier List

      The sequential read and write speeds, which are usually the most advertised number, are not a proper benchmark of real-world performance or the quality of an SSD. This article categorizes and tiers SSDs based on factors like the type of NAND flash, ...