Terry : LVM Commands

LVM commands

Scan commands

lvmdiskscan  --  Scan for all devices visible to LVM2

pvscan  --  Scan all disks for physical volumes
vgscan  --  Scan all disks for volume groups and rebuild caches
lvscan  --  Scan (all disks) for logical volumes

Report commands

pvs  -- Report information about physical volumes
vgs  -- Report information about volume groups
lvs  --  Report information about logical volumes

Display commands

pvdisplay  --  Display attributes of physical volume
vgdisplay  --  Display attributes of volume groups
lvdisplay  --  Display attributes of a logical volume

Change commands

pvchange  -- Change attributes of physical volume
vgchange  --  Change attributes of volume group
lvchange  --  Change attributes of a logical volume
lvmchange  --  Change attributes of the logical volume manager

Load kernel module to support lvm2

modprobe dm-mod

Mount a partition (logical volume) on lvm managed disk (suppose the volume group is ubuntu, logical volume to be mounted is home)

Activate all known volume groups

vgchange -a y

Or specify the logical volume to be activated

lvchange -a y /dev/ubuntu/home

Display attributes of a logical volume

lvdisplay

Mount

mount /dev/ubuntu/home /media/home

Reference

man lvm

Run the following command^^

terry@tux:~$ man lvm | sed -n '/^COMMANDS/,/^OPTIONS/p' | grep .
COMMANDS
       The following commands implement the core LVM functionality.
       pvchange — Change attributes of a physical volume.
       pvck — Check physical volume metadata.
       pvcreate — Initialize a disk or partition for use by LVM.
       pvdisplay — Display attributes of a physical volume.
       pvmove — Move physical extents.
       pvremove — Remove a physical volume.
       pvresize — Resize a disk or partition in use by LVM2.
       pvs — Report information about physical volumes.
       pvscan — Scan all disks for physical volumes.
       vgcfgbackup — Backup volume group descriptor area.
       vgcfgrestore — Restore volume group descriptor area.
       vgchange — Change attributes of a volume group.
       vgck — Check volume group metadata.
       vgconvert — Convert volume group metadata format.
       vgcreate — Create a volume group.
       vgdisplay — Display attributes of volume groups.
       vgexport — Make volume groups unknown to the system.
       vgextend — Add physical volumes to a volume group.
       vgimport — Make exported volume groups known to the system.
       vgimportclone — Import and rename duplicated volume group (e.g. a hard?
       ware snapshot).
       vgmerge — Merge two volume groups.
       vgmknodes  — Recreate volume group directory and logical volume special
       files
       vgreduce — Reduce a volume group by removing one or more physical  vol?
       umes.
       vgremove — Remove a volume group.
       vgrename — Rename a volume group.
       vgs — Report information about volume groups.
       vgscan — Scan all disks for volume groups and rebuild caches.
       vgsplit  —  Split  a  volume group into two, moving any logical volumes
       from one volume group to another by moving entire physical volumes.
       lvchange — Change attributes of a logical volume.
       lvconvert — Convert a logical volume from linear to mirror or snapshot.
       lvcreate — Create a logical volume in an existing volume group.
       lvdisplay — Display attributes of a logical volume.
       lvextend — Extend the size of a logical volume.
       lvmchange — Change attributes of the logical volume manager.
       lvmdiskscan — Scan for all devices visible to LVM2.
       lvmdump — Create lvm2 information dumps for diagnostic purposes.
       lvreduce — Reduce the size of a logical volume.
       lvremove — Remove a logical volume.
       lvrename — Rename a logical volume.
       lvresize — Resize a logical volume.
       lvs — Report information about logical volumes.
       lvscan — Scan (all disks) for logical volumes.
       The following commands are not implemented in LVM2 but might be in  the
       future: lvmsadc, lvmsar, pvdata.
OPTIONS

 

Logical Volume Manager (excellent wiki page)