LVM
From Alessandro's Wiki
Revision as of 10:31, 11 July 2013 by Xunil (talk | contribs) (→create a mirror from existing and mounted volume)
from command line
pvdisplay
lvremove
lvdisplay
see the PV's
pvs PV VG Fmt Attr PSize PFree /dev/sda vg_1 lvm2 a-- 930.82g 0 /dev/sdb vg_1 lvm2 a-- 931.31g 931.31g
lvs -a -o +devices
add a disk to a PV
vgextend vg_1 /dev/sdb Volume group "vg_1" successfully extended
remove a disk from PV
vgreduce vg_1 /dev/sdb Removed "/dev/sdb" from volume group "vg_1"
delete a PV
vgremove vg_1 Volume group "vg_1" successfully removed
create a mirror volume
lvcreate -L 931g vg_1 -m 1 vg_1
create a mirror from existing and mounted volume
lvconvert -m1 vg_1/lv_home
- then we check the result:
# pvs;echo;vgs;echo;lvs PV VG Fmt Attr PSize PFree /dev/sda2 vg_1 lvm2 a-- 930.82g 0 /dev/sdb vg_1 lvm2 a-- 931.31g 56.33g
VG #PV #LV #SN Attr VSize VFree vg_1 2 3 0 wz--n- 1.82t 56.33g
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lv_home vg_1 mwi-aom- 874.98g lv_home_mlog 100.00 lv_root vg_1 -wi-ao-- 50.00g lv_swap vg_1 -wi-ao-- 5.84g