linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] LVM - help replacing a drive.
@ 2006-02-21 17:14 Dave Schile
  2006-02-21 18:51 ` David Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Schile @ 2006-02-21 17:14 UTC (permalink / raw)
  To: linux-lvm

Hi,

This is a simple question, but I really don't want to lose any data, so I'd 
really appreciate it if someone could give me a quick rundown on how this is 
done. I've searched around and read the LVM Howto but Im still not 
comfortable with this specific scenario:

I have a simple implementation of LVM that creates logical volume from 
/dev/hda3 and /dev/hdc1. /dev/hda is a 250G drive that holds the filesystem 
on /dev/hda1, but only /dev/hda3 is part of the volume group. /dev/hdc1 is a 
100G drive with only one partition and its part of the volume group.

I want to replace /dev/hdc1 with a 250G drive I just bought. Right now the 
whole logical volume is 334G. All of that is allocated and none is free as 
far as physical extens go. However, I only have 119G of data on the whole 
logical volume. Is there any way to tell where physically that data resides? 
I cannot do a pvmove (as I understand it) because I have no free extens on 
/dev/hda3. Is it better to make extens available somehow on /dev/hda3 and do 
a pvmove? or should I install the new drive somewhere else, like /dev/hdb, 
then add it to the volume group and do a pvmove? If that's the case, then 
will it screw up the volume group when I move the new drive into its 
permanent location at /dev/hdc?

I know that's a lotta questions, but I really need some clarification. If 
anyone can help I'll be very thankfull.

Dave Schile

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] LVM - help replacing a drive.
  2006-02-21 17:14 [linux-lvm] LVM - help replacing a drive Dave Schile
@ 2006-02-21 18:51 ` David Brown
  0 siblings, 0 replies; 2+ messages in thread
From: David Brown @ 2006-02-21 18:51 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Feb 21, 2006 at 05:14:41PM +0000, Dave Schile wrote:

> This is a simple question, but I really don't want to lose any data, so I'd 
> really appreciate it if someone could give me a quick rundown on how this 
> is done. I've searched around and read the LVM Howto but Im still not 
> comfortable with this specific scenario:

I just did something similar, and it seemed to work fine.

> I have a simple implementation of LVM that creates logical volume from 
> /dev/hda3 and /dev/hdc1. /dev/hda is a 250G drive that holds the filesystem 
> on /dev/hda1, but only /dev/hda3 is part of the volume group. /dev/hdc1 is 
> a 100G drive with only one partition and its part of the volume group.

Sounds like a reasonable setup.

# lvs --segments -o +devices
will show you the device (and offset) of each segment of each logical
volume.  It is the most concise way to see where everything is at.

> I want to replace /dev/hdc1 with a 250G drive I just bought. Right now the 
> whole logical volume is 334G. All of that is allocated and none is free as 
> far as physical extens go. However, I only have 119G of data on the whole 
> logical volume. Is there any way to tell where physically that data 
> resides? I cannot do a pvmove (as I understand it) because I have no free 
> extens on /dev/hda3. Is it better to make extens available somehow on 
> /dev/hda3 and do a pvmove? or should I install the new drive somewhere 
> else, like /dev/hdb, then add it to the volume group and do a pvmove? If 
> that's the case, then will it screw up the volume group when I move the new 
> drive into its permanent location at /dev/hdc?

Well, assuming that you volume on /dev/hda3 is about 84G, you don't have
enough space to store all of your data on that drive.

If you have another interface to add another drive, that is by far the
easiest way to do it.  I've even added a physical volume on a USB drive,
but I'm not sure I recommend it.

LVM will have no problem with the drives moving around.  Part of each
physical volume is a uuid, and it builds the volume group out of those, not
specific locations.  This does, of course, assume that your startup scripts
are correct.

So, after you add /dev/hdb and partition /dev/hdb1 as your lvm partition.

  # pvcreate /dev/hdb1
  # vgextend vgname /dev/hdb1
  # pvmove /dev/hdc1
    .. Wait ..
  # lvs --segments -o +devices
     Make sure everything is off of /dev/hdc1
  # vgreduce vgname /dev/hdc1

Now you should be able to remove the hdc drive, and put the new drive on
its own controller.

And, standard caveat, do a backup before trying any of this.

Dave

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-21 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-21 17:14 [linux-lvm] LVM - help replacing a drive Dave Schile
2006-02-21 18:51 ` David Brown

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).