1. LVM – Logical Volume Manager

  Logical Volume Manager

| Commands | Section 2: LVM Logical Volumes >

1. Introduction

https://www.udemy.com/course/a-complete-guide-on-linux-lvm/learn/lecture/13069906#overview

2. The LVM Manager Overview

Traditional Partitioning

  • You cannot resize partitions
  • You cannot add disks together to create a single drive

Using LVM

  • You can combine multiple drives into a single volume group
  • The pool can be subdivided into smaller Logical Volumes (LV)
  • Any remaining space can be added to a LV.
  • Additional drives can be added to the Pool

3 Features of LVM

  • Additional flexibility
  • Disks can be added to the pool then subdivided in to Logical Volumes
  • LVs can be resized
    • LVs can be moved around (advanced)
  • LVM can be though of Dynamic Partitions
    • Create / Resize / Delete “On the fly”

4. LVM Architecture Overview

Terminology

  • PV Physical Volume
    • Can be a whole disk or a partition
  • Volume Groups
    • 1 or more PVs combined into a group
  • LV
    • Partitions of the VG
    • Can be formatted as desired
      • ext4
      • nfs

5. Architecture Diagram

https://www.udemy.com/course/a-complete-guide-on-linux-lvm/learn/lecture/13061948#overview

6. LVM Components

  • Physical Volumes PV
    • Block device
    • LVM Label placed in the second 512 byte sector by default
      • First sector = mbr (Master Boot Record)
        • Can be placed in any of the first 4 sectors
      • Label provides information about
        • Identification
        • Device ordering (since any device can come up in any order when a system is booted)
      • Labels remain persistent across reboots
      • Contains random unique UUID for the physical volume.
    • 3rd & 4th sectors contain metadata
      • See next section

7. Practice Lab

  • About Metatdata
    • How and when the volume was created
    • Information about the Volume Group
      • Name and Unique ID
      • Version Number
        • Incremented whenever the metadata is updated
        • Read write properties
        • Any admin limits on the number of PV and LVs it may contain.

Creating the Physical Volumes

  1. Create the Partition
    1. For a full disk, the first partition starts at 2048 (first 4 512 sectors reserved!)
    2. Use the rest of the disk as Primary p
    3. Type t – 8e (Linux LVM)
    4. Write / Quit
    5. Continue with any remaining disks
  2. Create an LVM physical volume
    1. pvcreate /dev/sdb1
    2. Repeat for any remaining disks
  3. Get data for the individual PVs
    1. pvdisplay /dev/sdb1
      1. PV Name
      2. VG Name
      3. PV size
      4. Allocat

 

 

LEAVE A COMMENT