linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "Thierry Thelliez" <thierry.thelliez.tech@gmail.com>
To: linux-lvm@redhat.com
Subject: [linux-lvm] Live Cloning of Root LVM (or Dynamic LVM?)
Date: Wed, 18 Jul 2007 11:38:18 -0600	[thread overview]
Message-ID: <42f5c4430707181038y689c36dbvb4a75dd6d5539478@mail.gmail.com> (raw)

Hello,

I wanted to perform a live clone of a remote server main drive . The
constraint would be to do that while the system is still running
(without booting from a LiveCD). In case of crash or damage to the OS
or applications settings, the idea would be to be back with minimal
intervention: just remove the bad drive and boot from the clone.

I thought it could be easy but I am encountering some problems with
LVM configuration duplication.

Below are the steps I followed:
1- Main OS
The OS is installed on the main drive:
/hda1 = /boot ext3
/hda2 = LVM
The LVM is itself split in three:
VolGroup00/LogVol00 = /  ext3
VolGroup00/LogVol01 = swap
VolGroup00/LogVol02 = /data

2- Clone preparation
I added a second drive for the cloning. Manually configured the
partitions and LVM to look like the main drive.
/hdb1 = /boot ext3  (fdisk then mkfs.ext3 and e2label)
/hdb2 = LVM (fdisk then LVM created with Fedora core 6 LVM GUI)
The LVM is itself split in three:
VolGroup01/LogVol00 = /  ext3
VolGroup01/LogVol01 = swap (+mkswap /dev/VolGroup01/LogVol01)
VolGroup01/LogVol02 = /data

(In my current configuration the two drives are not the same
brand/size. Also I am not trying to clone the /data volume. So
everything is the same size but the */LogVol02 volumes).

3- Copy
I created a snapshot of VolGroup00/LogVol00 and dd it to VolGroup01/LogVol00
Of course the above is taking VolGroup00 references to the VolGroup01
The /boot was copied with cp -av

4- Modification of LVM references.
I booted from a knoppic CD to mount hdb and modify few LVM references
(changed VolGroup00 to VolGroup01).
/boot/grub/grub.conf
/etc/fstab
/boot/initrd-xyz.fc6.img (with gzip, cpio,..)

5- MBR
Still under knoppic CD, I also created an MBR (mounted proc and dev,
then chroot to the clone drive, then grub root and setup).

Now if I boot from the clone, the MBR seems to work. Grub starts. But
just after the 'Uncompressing kernel' message, I get an error about
allocating Ram0 (grow_buffer: requested out of range block ... for
device Ram0). I am guessing the a reference of the VolGroup00 is left
somewhere. Or maybe a swap definition issue?

Any suggestions on what to clean on the clone to make it working?
Somehow I was hoping that the LVM information would be dynamically
read. But there must be some hidden references left.

Thanks
Thierry

             reply	other threads:[~2007-07-18 17:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18 17:38 Thierry Thelliez [this message]
2007-07-20  4:47 ` [linux-lvm] Re: Live Cloning of Root LVM (or Dynamic LVM?) Thierry Thelliez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42f5c4430707181038y689c36dbvb4a75dd6d5539478@mail.gmail.com \
    --to=thierry.thelliez.tech@gmail.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).