Skip to contentSkip to conversation

How to re-stripe a LV after pvmove?

linux-lvm Olle Liljenzin 4 participants 5 messages Mar 29, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

How can I rearrange a striped volume after pvmove has been run, so that I get back the original structure with the stripes equally distributed on PVs?

/Olle

#1 lore raw
Quoted 5 lines · Olle Liljenzin

Hello,

How can I rearrange a striped volume after pvmove has been run, so that I get back the original structure with the stripes equally distributed on PVs?

I need to presume, that IO to the striped LV was going on during pvmove. Hence restoring the old mapping won't help and will lead to data corruption.

pvmove back using the destination options of the command.

Quoted 8 lines

/Olle

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat GmbH
Consulting Development Engineer                   Am Sonnenhang 11
Storage Development                               56242 Marienrachdorf
                                                  Germany
[email protected]                            PHONE +49  171 7803392
                                                  FAX   +49 2626 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#2 lore raw
Quoted 4 lines · Heinz Mauelshagen
Quoted 2 lines · Olle Liljenzin

Hello,

Quoted 8 lines
Quoted 2 lines

How can I rearrange a striped volume after pvmove has been run, so that I get back the original structure with the stripes equally distributed on PVs?

I need to presume, that IO to the striped LV was going on during pvmove. Hence restoring the old mapping won't help and will lead to data corruption.

pvmove back using the destination options of the command.

Maybe an example is helpful. After the commands below I have two stripes on sdb2 and one on sdb3. How do I move one of the stripes from sdb2 to sdb4?

pvcreate /dev/sdb{1,2,3}
vgcreate vg /dev/sdb{1,2,3}
lvcreate -i 3 -L100M -n lv /dev/vg
vgreduce /dev/vg /dev/sdb1
pvremove /dev/sdb1
pvcreate /dev/sdb4
vgextend /dev/vg /dev/sdb4
lvdisplay -m /dev/vg/lv

--- Logical volume ---

 LV Name                /dev/vg/lv
 VG Name                vg
 LV UUID                NVBrvT-5fZe-0qKA-LCYA-Z9au-X84A-fXYkx3
 LV Write Access        read/write
 LV Status              available
 # open                 0
 LV Size                108.00 MB
 Current LE             27
 Segments               1
 Allocation             inherit
 Read ahead sectors     0
 Block device           253:2
 --- Segments ---
 Logical extent 0 to 26:
   Type                striped
   Stripes             3
   Stripe size         64 KB

Stripe 0:
Physical volume /dev/sdb2
Physical extents 9 to 17
Stripe 1:
Physical volume /dev/sdb2
Physical extents 0 to 8
Stripe 2:
Physical volume /dev/sdb3
Physical extents 0 to 8

#3 lore raw
Quoted 46 lines · Olle Liljenzin
Quoted 9 lines · Heinz Mauelshagen
Quoted 6 lines · Olle Liljenzin

Hello,

How can I rearrange a striped volume after pvmove has been run, so that I get back the original structure with the stripes equally distributed on PVs?

Quoted 5 lines

I need to presume, that IO to the striped LV was going on during pvmove. Hence restoring the old mapping won't help and will lead to data corruption.

pvmove back using the destination options of the command.

Maybe an example is helpful. After the commands below I have two stripes on sdb2 and one on sdb3. How do I move one of the stripes from sdb2 to sdb4?

pvcreate /dev/sdb{1,2,3}
vgcreate vg /dev/sdb{1,2,3}
lvcreate -i 3 -L100M -n lv /dev/vg
vgreduce /dev/vg /dev/sdb1
pvremove /dev/sdb1
pvcreate /dev/sdb4
vgextend /dev/vg /dev/sdb4
lvdisplay -m /dev/vg/lv

--- Logical volume ---

  LV Name                /dev/vg/lv
  VG Name                vg
  LV UUID                NVBrvT-5fZe-0qKA-LCYA-Z9au-X84A-fXYkx3
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                108.00 MB
  Current LE             27
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:2
  --- Segments ---
  Logical extent 0 to 26:
    Type                striped
    Stripes             3
    Stripe size         64 KB
Quoted 9 lines

Stripe 0:
Physical volume /dev/sdb2
Physical extents 9 to 17
Stripe 1:
Physical volume /dev/sdb2
Physical extents 0 to 8
Stripe 2:
Physical volume /dev/sdb3
Physical extents 0 to 8

looks like you need something like this:

pvmove /dev/sdb2:9-17 /dev/sdb4:0-8

#4 lore raw

Yes, it works!

/Olle

Quoted 6 lines · Dave Wysochanski

looks like you need something like this:

pvmove /dev/sdb2:9-17 /dev/sdb4:0-8