LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 11-30-2011, 11:10 AM   #1
ginda
Member
 
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, 01:17 PM   #2
_bsd
Member
 
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
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
 
  


Reply


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 06:38 AM
Removing a broken disk from lvm2 Fophillips Linux - Software 2 06-14-2010 05:49 PM
Need to reformat LVM2 disk. Spearhead40 Ubuntu 1 11-03-2007 01:59 PM
Copying one distro on a hard disk to another disk jimmy512 Linux - General 2 11-21-2006 02:19 PM
Convert to SW RAID with LVM2 on existing disk atman1974 Linux - General 1 05-15-2006 12:40 AM


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

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