Convert LV to striped: Difference between revisions

From JoBaPedia
Jump to navigation Jump to search
(Created page with "= Convert LV to striped = to convert an lv from the usual linear to striped mode directly is not possible. It needs two steps: create a striped (old style) mirror lv and then...")
 
Line 1: Line 1:
= Convert LV to striped =
To convert an lv from the usual linear to striped mode directly is not possible. It needs two steps: create a striped (old style) mirror lv and then remove the original pv from the mirror.
 
to convert an lv from the usual linear to striped mode directly is not possible. It needs two steps: create a striped (old style) mirror lv and then remove the original pv from the mirror.


Given you have a vg vgdata with pv sdb and lv lvdata
Given you have a vg vgdata with pv sdb and lv lvdata

Revision as of 00:38, 6 March 2017

To convert an lv from the usual linear to striped mode directly is not possible. It needs two steps: create a striped (old style) mirror lv and then remove the original pv from the mirror.

Given you have a vg vgdata with pv sdb and lv lvdata

First extend the vg with a new pv for each stripe, e.g. sdc and sdd for 2 stripes (pvcreate them first)

vgextend vgdata /dev/sdc /dev/sdd

If you want to reuse sdb as a stripe pv you'd have to move the data to one of the new pv's now

pvmove -n /dev/vgdata/lvdata /dev/sdb /dev/sdd

Next mirror the lv to the striped pv's

lvconvert --type mirror --corelog --mirrors 1 --stripes 2 /dev/vgdata/lvdata

Finally remove the linear part (sdb, or sdd if you pvmoved above) from the mirror lv

lvconvert --mirrors 0 /dev/vgdata/lvdata /dev/sdb

Check the result with

vdisplay --maps --all /dev/vgdata/lvdata