LVM

Time:2022-5-14

Understand LVM

This is a flexible hard disk partition, which is suitable for the production system and can be expanded without shutdown In short, there are many benefits.

  • PE

    The smallest management unit. The default unit is 4MB

  • PV

    A plate is a PV

  • VG

    One or more PVS form a VG, which is equivalent to a set of all customizations (of course, multiple sets can also be defined)

  • LV

    A space is divided from VG for mounting.

Related commands

LVM front

The drive letter format needs to be modified to LVM (fdisk / dev / SD?)

  • View disk

    fdisk -l
  • Disk modification format

    fdisk /dev/sd??

PV related commands

  • see

    #View in list form
    pvs
    
    #View details
    pvdisplay
  • establish

    pvcreate /dev/sd??
  • delete

    Precondition: the VG has been removed from the VG

    pvremove /dev/sd??

VG related commands

  • see

    #List view VG brief information
    vgs
    
    #View VG details
    vgdisplay
  • establish

    Vgcreate VG name / dev / sdb1 / dev / sdb2
  • extend

    Vgextend VG name / dev / sdb1
  • delete

    vgremove

LV related commands

  • see

    #View list brief information
    lvs
    
    #View details
    lvdisplay
  • establish

    Create a new LV
    Lvcreate - N LV name - L? G VG name
    Format LV
    Mkfs - t ext4 or XFS LV path
  • extend

    lvextend -L +300G /dev/mapper/centos-root
  • delete

mount

Path directory of Mount LV

Recommended Today

First knowledge of Hadoop architecture

Get to know Hadoop Google’s “troika”“ GFS MapReduce BigTable HDFS HDFSWhat is it? HDFSIt is a distributed file system based on streaming data access mode. It supports the storage of massive data and allows users to form storage clusters with hundreds of computers. Advantages: it can handle large files, support streaming data access (write once, […]