copying lvm with the same name

Rick Stevens ricks at nerd.com
Wed Mar 18 19:17:13 UTC 2009


Frank Cox wrote:
> On Tue, 17 Mar 2009 10:45:28 -0700
> Aldo Foot wrote:
> 
>> Get info on the Volume Group (change 00 to 01 for the other volume)
> 
> That's the part that everyone jumps right over.  How do you change the volume
> name on the second volume when both volumes have the same name?  I have not
> found a way to specify "rename the volume on sdb2" or anything similar to that.

Well, don't worry about the volume group (VG) so much.  Yes, /dev/sdb2
is in VolGroup00, but it's probably not being used by any logical
volumes (LVs), but you should confirm with "lvdisplay -v".  If you were
to grow any LVs in that VG (or create a new LV), THEN space on /dev/sdb2
would probably get used.

Remember, a volume group is simply a collection of PVs (physical
volumes).  When you create a logical volume (LV) in some VG, that volume
is created by utilizing free extents from the various PVs in the VG you
specify.

A good example of utilizing this is if you have a mix of drive types in
your system (e.g. SATA and SCSI).  You may create a VG containing all of
the SATA drives (perhaps called "SATA_VG") and different one from the
SCSI drives ("SCSI_VG").  Then, if you need a high-performance LV, you'd 
create it from the "SCSI_VG" group:

	# lvcreate -L 8G -n DB_Vol SCSI_VG

would create an 8GB volume called "DB_Vol" from SCSI drives ONLY.  For
something not so fast, you could create it from the "SATA_VG" group.

Now, back to your question.  If you REALLY want to put /dev/sdb2 into a
new volume group, first make sure none of its space is being used in 
existing LVs (check the output of "lvdisplay -vm").  If it's being used, 
you'll have to first shrink all the filesystems on the LV to clear the
space, then shrink the LV itself using "lvreduce" and specifying the
number of extents that are on /dev/sdb2.

In your case it'll probably be free so you can simply remove it from
VolGroup00:

	# vgreduce VolGroup00 /dev/sdb2

Then you can create a new VG and specify /dev/sdb2 as the first PV in
the group:

	# vgcreate VolGroup01 /dev/sdb2

Voila!  As m' tutor once said, "QED" (quite easily done).

----------------------------------------------------------------------
- Rick Stevens, Systems Engineer                      ricks at nerd.com -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-   I haven't lost my mind.  It's backed up on tape somewhere, but   -
-                       probably not recoverable.                    -
----------------------------------------------------------------------




More information about the fedora-list mailing list