Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 11-30-2011, 10:10 AM   #1
Registered: Mar 2004
Distribution: SUSE8.2, 9.2, Knoppix
Posts: 323

Rep: Reputation: 31
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
Old 11-30-2011, 12:17 PM   #2
Registered: Jan 2010
Location: Velveeta, USA
Distribution: Xen, Gentoo,Ubuntu,openSUSE,Debian,pfSense
Posts: 98

Rep: Reputation: 8
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
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
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM2 not accessible unless using rescue disk. rorlando Linux - Server 2 10-26-2010 05:38 AM
Removing a broken disk from lvm2 Fophillips Linux - Software 2 06-14-2010 04:49 PM
Need to reformat LVM2 disk. Spearhead40 Ubuntu 1 11-03-2007 12:59 PM
Copying one distro on a hard disk to another disk jimmy512 Linux - General 2 11-21-2006 01:19 PM
Convert to SW RAID with LVM2 on existing disk atman1974 Linux - General 1 05-14-2006 11:40 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration