Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Moving LVMs around (http://www.linux-archive.org/gentoo-user/12919-moving-lvms-around.html)

Mick 12-05-2007 02:24 PM

Moving LVMs around
 
Hi All,

Could you please hold my hand sorting some LVMs - I have no experience on this
and would not like to mess it up:

I have create a PV which currently contains /dev/sda5. I have also created a
new PV which contains /dev/sdc1. I want to move /dev/sda5 (11.9G)
to /dev/sdc1 (150G) and then remove /dev/sda5 from this OS and later on from
this machine. How should/could I go about it?
--
Regards,
Mick

Albert Hopkins 12-05-2007 02:45 PM

Moving LVMs around
 
On Wed, 2007-12-05 at 15:24 +0000, Mick wrote:
> Hi All,
>
> Could you please hold my hand sorting some LVMs - I have no experience on this
> and would not like to mess it up:
>
> I have create a PV which currently contains /dev/sda5. I have also created a
> new PV which contains /dev/sdc1. I want to move /dev/sda5 (11.9G)
> to /dev/sdc1 (150G) and then remove /dev/sda5 from this OS and later on from
> this machine. How should/could I go about it?

1. Back up your data!
2. Add /dev/sdc1 to the same VG as /dev/sda5 (vgextend)
3. pvmove -v /dev/sda5 /dev/sdc1
4. Wait a really long time
5. Verify nothing is on sda5 (pvdisplay /dev/sda5)
6. Deallocate sda5 (pvchange -x n /dev/sda5)
7. Remove sda5 from the VG (pvremove)

--
gentoo-user@gentoo.org mailing list

Neil Bothwick 12-05-2007 03:54 PM

Moving LVMs around
 
On Wed, 5 Dec 2007 16:28:27 +0000, Mick wrote:

> Question re. step 2: Does /dev/sdc1 *have* to be added (vgextend) to
> the same VG_old as /dev/sda5, or could it be added (vgcreate) to a new
> VG_new?

It has to be added to do a pvmove. If you want to create a new volume
group, you may as well create it and use rsync to copy the contents of
the old LVs over. If the only reason for the change is to have a
different name, use vgrename either before or after the move. You can't
run vgrename on an in-use VG, so boot into single user mode or from a
live CD.


--
Neil Bothwick

What was the greatest thing BEFORE sliced bread?

Mick 12-05-2007 08:31 PM

Moving LVMs around
 
On Wednesday 05 December 2007, Neil Bothwick wrote:
> On Wed, 5 Dec 2007 16:28:27 +0000, Mick wrote:
> > Question re. step 2: Does /dev/sdc1 *have* to be added (vgextend) to
> > the same VG_old as /dev/sda5, or could it be added (vgcreate) to a new
> > VG_new?
>
> It has to be added to do a pvmove. If you want to create a new volume
> group, you may as well create it and use rsync to copy the contents of
> the old LVs over. If the only reason for the change is to have a
> different name, use vgrename either before or after the move. You can't
> run vgrename on an in-use VG, so boot into single user mode or from a
> live CD.

Thanks Neil,

This is a data partition, so if I unmount it I guess I can vgrename it? Do I
need to run vgchange -a n first?
--
Regards,
Mick

Neil Bothwick 12-05-2007 10:51 PM

Moving LVMs around
 
On Wed, 5 Dec 2007 21:31:35 +0000, Mick wrote:

> This is a data partition, so if I unmount it I guess I can vgrename
> it? Do I need to run vgchange -a n first?

It wouldn't hurt. I've only done this with VGs that contain system
partitions, so I always used a live CD to do it.


--
Neil Bothwick

In the begining, there was nothing.


All times are GMT. The time now is 04:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.