MyWackoSite: lvm

https://wiki.ebal.gr     Version: 1 (10/31/2013 09:24)
This is an old revision of lvm from 10/31/2013 09:24 edited by EvaggelosBalaskas.

lvm


Hits : 0

lvm basics


physical volumes


# pvs
  PV         VG     Fmt  Attr PSize   PFree  
  /dev/sda2  vg_790 lvm2 a--  465.52g 211.52g		


list physical volumes

# pvdisplay 

# pvdisplay  -C		

volume groups


# vgs
  VG     #PV #LV #SN Attr   VSize   VFree  
  vg_790   1  10   0 wz--n- 465.52g 211.52g		


list all volume groups

# vgscan

# vgdisplay

# vgdisplay -C		


activate all 

# vgchange -ay		


deactivate a specific volume group

# vgchange -an vol_group_1		


activate all logical volumes on a volume group, only

# vgchange -ay vol_group_1		

logical volumes


list logical volumes

# lvs

# lvdisplay -C		


Create a new LVM partition


# lvcreate -L 10G -n /dev/vg_group01/lv_vol01 

# mkfs.ext4 -L lv_vol01 /dev/vg_group01/lv_vol01 

# mount /dev/vg_group01/lv_vol01 /media/		

extend an lvm partition


How to extend an lvm partition:

umount /opt/dnl

lvextend -L +5G /dev/vg01/dnl

e2fsck -f /dev/vg01/dnl

resize2fs /dev/vg01/dnl 

mount /opt/dnl/		

reduce


BASH
lvresize -l +100%FREE -n /dev/vg01/backup