linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Graham Wood <clvm@spam.dragonhold.org>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Newbie of LVM
Date: Fri, 9 Dec 2005 19:48:01 +0000	[thread overview]
Message-ID: <20051209194800.GA7494@dragonhold.org> (raw)
In-Reply-To: <7119d52b0512091138s5615a650q5bad1a566cbde72b@mail.gmail.com>

On Fri, Dec 09, 2005 at 02:38:49PM -0500, Jeff Cousino wrote:
> But couldn't he set up his new drive with LVM copy the data from the
> old drive to it, provided it's large enough and then add the old drive
> to the group?
As long as he can get the downtime to do it, sure.  At that point the
device '/dev/md5' can be added as a PV and the volume grown.

However - to do that he'd need to unmount the existing volume, ideally
for the time it took to do the copy (although there are ways around
that). 

And also, the answer to the initial question is still no, since that's
just a different way to do it.

If the new storage device is big enough (and the solution wanted is not
a RAID that requires the existing disk space to build) then the
following would be a way to do it:

1. Create the PV/VG on the new disk (since it doesn't look as though LVM 
is in use at all on that machine, if it is then do as appropriate)
2. Create the new volume, and mount it under /mnt or something.
3. use rsync to get the two volumes (existing & new) in sync.  The
command I use is:
	rsync --delete-after -av /www /mnt
4. Arrange a downtime of at least 15 minutes, and during that move the
mount points around (after stopping all applications that use /www):
	rsync --delete-after -av /www /mnt # bring the copy up to date
	umount /mnt
	umount /www
	mount <LVM device> /www
5. Restart all the applications

Things to note about this are that not only does it require a lot of
disk space, but it also will be quite slow (especially if there are lots
of little files on /www).  If you start work well before you can arrange
the downtime (last time I did this I had everything in place and had to
wait 2 weeks for the window to do the rotation) then you can keep
running the rsync to keep the two copies closer together and therefore
keep the downtime to a minimum.

A shorter term solution would be to migrate some of the data off /www
and use symlinks.  That would still require a brief downtime to move
around the data - but it doesn't require the big hit.  (e.g. mount the
new partition as /www2 and then move /www/site1 to /www2/site1 and then
create a symlink /www/site1 to /www2/site1 - couple of other things to
be aware of, but that's the principle).

  parent reply	other threads:[~2005-12-09 19:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-09  3:39 [linux-lvm] Newbie of LVM Way Loss
2005-12-09 18:50 ` Anil Kumar Sharma
2005-12-09 19:12 ` Matthew Gillen
2005-12-09 19:38   ` Jeff Cousino
2005-12-09 19:43     ` Matthew Gillen
2005-12-09 19:48     ` Graham Wood [this message]
2005-12-09 19:42   ` Matthew Gillen
2005-12-09 19:57   ` Anil Kumar Sharma
2005-12-09 20:03     ` Anil Kumar Sharma
2005-12-12 15:21   ` Alasdair G Kergon

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=20051209194800.GA7494@dragonhold.org \
    --to=clvm@spam.dragonhold.org \
    --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).