* [linux-lvm] Altering a Physical Volume's UUID
@ 2006-09-08 12:55 Mark Krenz
2006-09-08 15:35 ` Luca Berra
0 siblings, 1 reply; 3+ messages in thread
From: Mark Krenz @ 2006-09-08 12:55 UTC (permalink / raw)
To: linux-lvm
Hi, I'm using LVM with Xen virtual machines by creating sparse image
files with something like
dd if=/dev/zero of=diskimage bs=1 count=1 seek=1073741824
Then I use a loopback device to use the diskimage as a block device and
create a physical volume, volume group and logical volumes on it.
This all works great, but when I copy the diskimage file to another
file and try to setup a loopback device for it, I get complaints about
there being multiple identifical UUIDs for physical volumes and volume
groups.
So is there a way to change the UUID of a physical volume and volume
group?
If you are wondering why I would need to copy the diskimage file, its
because I'm setting up Xen template images for different OSes that I can
then simply copy into place, make a few modifications and then be on my
way.
--
Mark S. Krenz
IT Director
Suso Technology Services, Inc.
http://suso.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] Altering a Physical Volume's UUID
2006-09-08 12:55 [linux-lvm] Altering a Physical Volume's UUID Mark Krenz
@ 2006-09-08 15:35 ` Luca Berra
2006-09-08 17:11 ` [linux-lvm] Altering a Physical Volume's UUID [solved] Mark Krenz
0 siblings, 1 reply; 3+ messages in thread
From: Luca Berra @ 2006-09-08 15:35 UTC (permalink / raw)
To: linux-lvm
On Fri, Sep 08, 2006 at 12:55:06PM +0000, Mark Krenz wrote:
> So is there a way to change the UUID of a physical volume and volume
>group?
>
i'd try with vgcfgbackup, sed, pvcreate, vgcfgrestore.
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [linux-lvm] Altering a Physical Volume's UUID [solved]
2006-09-08 15:35 ` Luca Berra
@ 2006-09-08 17:11 ` Mark Krenz
0 siblings, 0 replies; 3+ messages in thread
From: Mark Krenz @ 2006-09-08 17:11 UTC (permalink / raw)
To: linux-lvm
Hey, that works! Thank you very much Luca. For other people's
benifit that may find this in a search, here is what I did:
This assumes that you ALREADY have a disk file called lvmdisk1 with lvm partitions on it
# losetup /dev/loop0 lvmdisk1
# vgscan
# vgcfgbackup -f TemplateVG.cfg TemplateVG
Now edit TemplateVG.cfg file and change the IDs for the volume group,
physical volume and logical volumes too. I made it easy by just
incrementing the last character by one, a becomes b, x becomes y, etc.
Keep track of what ID you gave the physical volume.
# vgchange -a n TemplateVG
Now run pvcreate using the --uuid option and use the NEW uuid that you
generated an changed to in the VG config file.
# pvcreate -ff --uuid CFhjSe-EqSc-pnDz-4UcP-ylxh-hcY6-oV6BGR --restorefile TestDiskVG.cfg /dev/loop2
It will complain that it couldn't find the physical volume with the
specified uuid, but it will still create the physical volume.
# vgcfgrestore -f TemplateVG.cfg TemplateVG
# vgchange -a y TemplateVG
That's it, now you can change the volume group name if that's what you
need to do. You should try mounting one of the logical volumes now to
make sure the data is still in tact.
On Fri, Sep 08, 2006 at 03:35:10PM GMT, Luca Berra [bluca@comedia.it] said the following:
> On Fri, Sep 08, 2006 at 12:55:06PM +0000, Mark Krenz wrote:
> > So is there a way to change the UUID of a physical volume and volume
> >group?
> >
> i'd try with vgcfgbackup, sed, pvcreate, vgcfgrestore.
>
> L.
>
> --
> Luca Berra -- bluca@comedia.it
> Communication Media & Services S.r.l.
> /"\
> \ / ASCII RIBBON CAMPAIGN
> X AGAINST HTML MAIL
> / \
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
--
Mark S. Krenz
IT Director
Suso Technology Services, Inc.
http://suso.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-08 17:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-08 12:55 [linux-lvm] Altering a Physical Volume's UUID Mark Krenz
2006-09-08 15:35 ` Luca Berra
2006-09-08 17:11 ` [linux-lvm] Altering a Physical Volume's UUID [solved] Mark Krenz
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).