* [linux-lvm] combining two vg's into one
@ 2004-01-28 21:24 Chris Conn
2004-01-28 23:38 ` Ken Fuchs
0 siblings, 1 reply; 5+ messages in thread
From: Chris Conn @ 2004-01-28 21:24 UTC (permalink / raw)
To: linux-lvm
I've got 2 vg's on two different partitions on
different disks, one is my root vg and the other
has /usr, /var and /tmp filesystems. I'd like to
keep them on separate disks but use the same vg
if I can, but I'm unsure how to combine them. Do
I have to move the lv's on disk2 out of their vg
or can I just expand the vg on disk1 to include
them? The filesystems are all ReiserFS, system
is Slackware Linux 9.1.
Thanks for any advice,
=====
Chris Conn
cmcgoat@swbell.net http://storm.cadcam.iupui.edu/~cmcgoat
Austin, TX
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] combining two vg's into one
2004-01-28 21:24 [linux-lvm] combining two vg's into one Chris Conn
@ 2004-01-28 23:38 ` Ken Fuchs
2004-01-29 1:30 ` Christopher Mark Conn
0 siblings, 1 reply; 5+ messages in thread
From: Ken Fuchs @ 2004-01-28 23:38 UTC (permalink / raw)
To: linux-lvm
Chris Conn wrote:
>I've got 2 vg's on two different partitions on
>different disks, one is my root vg and the other
>has /usr, /var and /tmp filesystems. I'd like to
>keep them on separate disks but use the same vg
>if I can, but I'm unsure how to combine them.
To keep / on one disk and /usr, /var and /tmp on another
disk, one volume group per disk as described above is the
best way to do this. There is no advantage to combining
the two volume groups together given that one wants to
keep logical volumes exclusively on one disk or the other.
Combining the two volume groups into one volume group
would allow logical volumes to span the two disks and
lvm striping, but that is contrary to the desire to keep
each logical volume exclusively on a particular disk.
>Do I have to move the lv's on disk2 out of their vg
>or can I just expand the vg on disk1 to include
>them? The filesystems are all ReiserFS, system
>is Slackware Linux 9.1.
Logical volumes can't be moved between volume groups.
If the physical extents of two volume groups are the
same and the limits of the destination group are not
exceeded, the two volume groups can be merged using
vgmerge(8). Go to step 9 below.
To join two volume groups with unequal logical extents:
1) Back up all logical volumes.
2) Remove all logical volumes in one volume group,
preferably the volume group NOT containing /,
using lvremove(8).
3) Remove all physical volumes from the volume
group to be removed using vgreduce(8).
4) Finally remove that volume group using vgremove(8).
5) Add all physical volumes that were in the removed
volume group into the remaining volume group using
vgextend(8)
6) Within the remaining volume group, create all logical
volumes removed in step 2 using lvcreate(8)
7) Create the desired filesystems for each logical
volume created in step 6.
8) Restore from backup each filesystem created in
step 7.
9) Modify /etc/fstab and any other configuration files
to reflect the volume group name change in the
"moved" (removed/recreated) volumes.
Sincerely,
Ken Fuchs <kfuchs@winternet.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] combining two vg's into one
2004-01-28 23:38 ` Ken Fuchs
@ 2004-01-29 1:30 ` Christopher Mark Conn
2004-01-29 6:15 ` Patrick Caulfield
0 siblings, 1 reply; 5+ messages in thread
From: Christopher Mark Conn @ 2004-01-29 1:30 UTC (permalink / raw)
To: linux-lvm
Ken Fuchs <kfuchs@winternet.com> writes:
>>I've got 2 vg's on two different partitions on
>>different disks, one is my root vg and the other
>>has /usr, /var and /tmp filesystems. I'd like to
>>keep them on separate disks but use the same vg
>>if I can, but I'm unsure how to combine them.
>
> To keep / on one disk and /usr, /var and /tmp on another
> disk, one volume group per disk as described above is the
> best way to do this. There is no advantage to combining
> the two volume groups together given that one wants to
> keep logical volumes exclusively on one disk or the other.
>
> Combining the two volume groups into one volume group
> would allow logical volumes to span the two disks and
> lvm striping, but that is contrary to the desire to keep
> each logical volume exclusively on a particular disk.
Thanks Ken, that's one thing I was wondering, is it
better to keep one vg per pv. Sounds like I'm already
set up the way I need to be.
--
Chris Conn
cmcgoat@swbell.net http://storm.cadcam.iupui.edu/~cmcgoat
Austin, Texas, USA
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [linux-lvm] combining two vg's into one
2004-01-29 1:30 ` Christopher Mark Conn
@ 2004-01-29 6:15 ` Patrick Caulfield
2004-01-29 10:49 ` Ken Fuchs
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Caulfield @ 2004-01-29 6:15 UTC (permalink / raw)
To: linux-lvm
On Thu, Jan 29, 2004 at 12:30:13AM -0600, Christopher Mark Conn wrote:
> Ken Fuchs <kfuchs@winternet.com> writes:
>
>
> Thanks Ken, that's one thing I was wondering, is it
> better to keep one vg per pv. Sounds like I'm already
> set up the way I need to be.
>
I don't think so. One of the major points of LVM is that volumes can span
physical disks and you can transparently add disks to the systems and grow
existing LVs over them.
To merge two Volume Groups, try the "vgmerge" command. The only prerequisite is
that they have the same PE size (which is set at vgcreate time).
--
patrick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] combining two vg's into one
2004-01-29 6:15 ` Patrick Caulfield
@ 2004-01-29 10:49 ` Ken Fuchs
0 siblings, 0 replies; 5+ messages in thread
From: Ken Fuchs @ 2004-01-29 10:49 UTC (permalink / raw)
To: linux-lvm
>On Thu, Jan 29, 2004 at 12:30:13AM -0600, Christopher Mark Conn wrote:
>> Thanks Ken, that's one thing I was wondering, is it
>> better to keep one vg per pv. Sounds like I'm already
>> set up the way I need to be.
Patrick Caulfield wrote:
>I don't think so. One of the major points of LVM is that volumes can span
>physical disks and you can transparently add disks to the systems and grow
>existing LVs over them.
That is true, but LVM must be configured to the user's desires. In this
case, Chris Conn wants / on one physical volume (actually a whole disk)
and /usr, /var and /tmp on another physical volume (again a whole disk).
The easiest way to ensure that these four logical volumes never span the
two disks is to define one volume group per disk. Ideally one would
define a single volume group, but then one would have to use pvmove(8)
to keep each logical volume on a physical volume.
If Chris needs more flexibility, he can use vgmerge(8), pvmove(8) and
optionally vgsplit(8) to get logical volumes where he wants them.
>To merge two Volume Groups, try the "vgmerge" command. The only
>prerequisite is that they have the same PE size (which is set at
>vgcreate time).
The sum of the attributes of the two volume groups must also be within
the limits of the destination volume group. If any limit is exceeded,
vgmerge should refuse to do the merge. Has this requirement changed?
Sincerely,
Ken Fuchs <kfuchs@winternet.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-01-29 10:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-28 21:24 [linux-lvm] combining two vg's into one Chris Conn
2004-01-28 23:38 ` Ken Fuchs
2004-01-29 1:30 ` Christopher Mark Conn
2004-01-29 6:15 ` Patrick Caulfield
2004-01-29 10:49 ` Ken Fuchs
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.