Вы находитесь на странице: 1из 15

LVM

A Logical Volume Manager for Linux

Definition of the LVM


the Logical Volume Manager is a subsystem for on-line disk storage management it adds an additional layer to the i/o subsystem of the kernel to get a virtual view on disks LVM enables you to deal with virtual disks and virtual partitions being fully online resizable and movable

LVM Concept1

usage of physical disks, disk partitions, multiple or loop devices as PVs (Physical Volumes; basic allocation device) store metadata in so called VGDAs (Volume Group Descriptor Areas) on the PVs group PVs in VGs (Volume Groups; virtual disks)

LVM Concept2

allocate VG storage to LVs (Logical Volumes; virtual partitions); basic units called PEs (Physical Extents) are mapped to their LEs (Logical Extents). extend and reduce VGs and LVs online use LVs like disks, disk partitions etc. for filesystems, databases etc. access VGs and LVs via device special files named /dev/VolumeGroupName/*

LVM Concept3

build a command and a library layer to ease the integration of different or additional tools or graphical user interfaces

export and import VGs to bring them to or get them from different computer systems
support linear and striped (RAID0) LVs

support snapshot LVs

Storage Architecture
2

PVs

2 PVs

Storage Architecture
VG

with 2 PVs

PV

PV

VG

Storage Architecture
VG

with 2 PVs and 1 LV PV VG PV

LV

PV Commands

pvchange - changes PV attributes pvcreate - initializes VGDA on a PV pvdata pvmove - displays VGDA (debugging) - moves PEs/LEs between PVs pvdisplay - shows PV attributes

pvscan

- searches for PVs

VG Commands1

vgcfgbackup vgcfgrestore vgck vgcreate

- does a VGDA backup - restores VGDA to a PV - check VG - creates a new VG

vgchange - changes VG attributes

vgdisplay - shows VG attributes


vgexport - make VG unknown

VG Commands2

vgextend - extend a VG online vgimport - make a VG known vgmerge - merge two VGs vgmknodes - create device specials vgreduce - reduceVG online

vgremove - delete empty VG

VG Commands3

vgrename - rename an inactive VG vgscan vgsplit - search for VG(s) - split a VG into 2

LV Commands1

e2fsadm

- extend or reduce LV and a contained ext2 Dateisystem (resize2fs needed) - create a new LV - extend LV online

lvchange - change LV attributes


lvcreate lvextend lvdisplay - show LV attributes

LV Commands3

lvreduce

- reduce LV online

lvremove - delete inactive LV lvrename - rename an inactive LV lvscan - search for LVs

LVM Commands

lvmchange lvmdiskscan

- reset LVM in case of a test emergency - search for disks, disk partitions or multiple devices - collect LV read/write data

lvmsadc

lvmsar

- report of collected LV statistic data

lvmcreate_initrd - initial RAM disk support

Вам также может понравиться