Operating System - HP-UX
1826163 Members
4491 Online
109691 Solutions
New Discussion

Re: Mirroring to copy data

 
SOLVED
Go to solution
Coolmar
Esteemed Contributor

Mirroring to copy data

Hi,

We are moving all of our data from a Hitachi to a Shark. I plan on simply using lv mirroring. When the mirroring is complete, then I want to remove the hitachi from the lv and then work from the Shark. My question is, how can I tell when the mirroring is complete? I also ask this because we need to establish some benchmarks so we know roughly how long each lv will take on all our systems.

Thanks,
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: Mirroring to copy data

Hi Sally:

LVM mirroring is done at the logical volume level. Hence:

# lvdisplay -v /dev/vgNN/lvolX|grep stale|wc -l

...will return zero (0) when all mirrors have been synchronized for the logical volume in question.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: Mirroring to copy data

Umm...Well, the mirroring operation will be complete when the 'lvextend' used to establish the mirrors completes.

You can also keep an eye on the progress by doing an 'lvdisplay -v /dev/vg??/lvol?' and looking at the number of extents that are 'stale'. When there are no more stale extents, the mirroring is complete.

To establish a time you could utilize 'timex' along with lvextend.

# timex lvextend -m 1 /dev/vg??/lvol1 /dev/dks/c?t?d?

Coolmar
Esteemed Contributor

Re: Mirroring to copy data

Thanks! I thought that when you lvextend and add the mirror disk that the command comes back but starts/continues the mirroring in the background. I didn't realize that it would hang there (unless you use the &) until the mirror was complete.
Bill Hassell
Honored Contributor

Re: Mirroring to copy data

Using mirroring to replicate data is very reliable but the absolute SLOWEST method there is. I would suggest creating a small lvol, perhaps 1Gb, then lvextend it onto the new SAN and look at the wall clock time. Then for comparison, use dd somethingt like this:

dd if=/dev/vgXX/rlvolYY of=/dev/vgVV/rlvolZZ bs=512k

and compare the time. dd is very fast but read/writes every block regardless of whether there are any files in a particular block. Disk mirroring also mirrors everything but is extremely careful to lock the source extent, read it, write it, check the result and then release the lock. The reason for all this paranoia is that lvextend mirroring can take place on an active volume.


Bill Hassell, sysadmin
Michael Steele_2
Honored Contributor

Re: Mirroring to copy data

I've found putting all of my LVM commands into a executable file speeds things up. Do something like a cat of the LVM command and then the LVM command.
Support Fatherhood - Stop Family Law