Skip to contentSkip to conversation

pvmove: moving a mirror logical volume not supported?

linux-lvm Jens Wilke 3 participants 4 messages Sep 6, 2006 – Sep 7, 2006

lore
Share & tools
lore

Jens Wilke

author
#0 lore raw

Hello!

When trying to do a pvmove on a mirrored logical volume I get the message "No data to move..."

pvmove /dev/dasdx1
Skipping mirror LV m1m
Skipping mirror LV m1m_mlog
Skipping mirror image LV m1m_mimage_0
Skipping mirror image LV m1m_mimage_1
No data to move for main

Looking in the pvmove code reveals that mirror lvs are intentionally skipped:

--snip--

		if (lv->status & MIRRORED) {
			log_print("Skipping mirror LV %s", lv->name);
			continue;
		}
		if (lv->status & MIRROR_LOG) {
			log_print("Skipping mirror log LV %s", lv->name);
			continue;
		}
		if (lv->status & MIRROR_IMAGE) {
			log_print("Skipping mirror image LV %s", lv->name);
			continue;
		}

--snip--

What is the reason for this?

Best,

Jens

#1 lore raw
Quoted 1 line · Jens Wilke

What is the reason for this?

No code to do this has yet been written. There should be no fundamental problems with doing it.

Alasdair

Signature · 1 line
[email protected]
#2 lore raw
Quoted 5 lines · Alasdair G Kergon
Quoted 1 line · Jens Wilke

What is the reason for this?

No code to do this has yet been written. There should be no fundamental problems with doing it.

pvmove is a wrong approach to the problem too, imo. PVs are just storage devices for a VG. By moving LVs (or the PEs that the LV resides on), you accomplish the same. When there are no PE in use on a PV, it is easy enough to reduce the VG to remove the PV.

Like in this scenario when you want to move a VG from an internal disk to, let's say SAN volume (with pseudo-commands):

Assuming VG is pn /dev/scsi and new disk is /dev/sandisk.

# extendvg myvg /dev/sandisk
# lvmirror myvg copies=1 strict=1

(one mirror, allocate strict so copies are on different PVs)

Now check that LVs are in sync and that all is OK with the new disk...

# lvmirror myvg copies=0 remove=/dev/scsi
# reducevg myvg /dev/scsi

This strategy would assume that mirroring is done in PE/LE mapping levels.

I have no idea if Linux LVM mirroring supports this. If anyone have links to good LVM docs for the mirroring features that will come with LVM in RHEL5 I would appreciate it.

Signature · 6 lines
//Morten Torstensen
//Email: [email protected]
//IM: [email protected] [email protected]

And if it turns out that there is a God, I don't believe that he is evil.
The worst that can be said is that he's an underachiever.
author
#3 lore raw
In reply to Alasdair G Kergon
Quoted 5 lines · Alasdair G Kergon
Quoted 1 line · Jens Wilke

What is the reason for this?

No code to do this has yet been written. There should be no fundamental problems with doing it.

pvmove does alreay something usefull if the skip on the mirror image is removed.

Problem is, that this is not fool proof because the allocation contraints for a mirror need to be checked to maintain redundance.

Looking on the allocator and looking on lvconvert, I think, doing it right will be a very ambitious task, or is my thinking wrong?

Does it make sense to support "simple cases" of moving mirror images for the case that we have a source and a target specified and the target is empty or does not contain other images of the same mirror?

On the other hand it is also possible to do a
lvconvert -m0; pvmove; lvconvert -m1

Best,

Jens