LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Help copying a lvm2 disk (http://www.linuxquestions.org/questions/linux-server-73/help-copying-a-lvm2-disk-916385/)

ginda 11-30-2011 11:10 AM

Help copying a lvm2 disk
 
Hello all

I have a dilemma, i need to clone/backup a lvm2 disk to another disk in the same server.

/sda is live disk on /dev/VolGroup00/LogVol00

/sdb is spare disk on /dev/VolGroup00/LogVol01

I need to make an exact copy of /dev/VolGroup00/LogVol00 to /dev/VolGroup00/LogVol01

Could someone help me please.

Thanks in advance

_bsd 11-30-2011 01:17 PM

Always make a backup before reconfiguring LVM

First, I assume you mean /dev/sda and /dev/sdb rather than /sda and /sdb
And when you created LogVol00 and LogVol01 you specified which physical volume to be used with the lvcreate command.

If you simply wish to switch to mirrored logical volumes, you need to remove VolGroup00/LogVol01
Code:

eg: lvremove VolGroup00/LogVol01
which only removes the 2nd logical volume which you have on your spare on /sdb

The physical volume is still part of VolGroup00 so no changes need to take place at the VG level.

However, the LV mirror itself needs, by default, a third physical volume for the log to track synchronization between the mirrored logical volumes. It would be a good idea to add a third PV and put the mirror there. However, you can create the mirror with the mirror stored in memory. If you do so, you're risking mirror sync failure in the event of an untimely shutdown.

To convert /dev/VolGroup00/LogVol00 to use mirroring with an in memory log
Code:

eg: lvconvert --mirrorlog core -m1 VolGroup00/LogVol00
Read up on lvconvert if you wish to create an on disk log.

The above is not the same as making a dd style clone for removal and insertion elsewhere, if that is what you intended, please followup


All times are GMT -5. The time now is 06:32 PM.