* [linux-lvm] RE: linux-lvm Digest, Vol 32, Issue 7
@ 2006-10-12 13:42 Phil Lowden (plowden)
2006-10-12 14:13 ` Alasdair G Kergon
0 siblings, 1 reply; 2+ messages in thread
From: Phil Lowden (plowden) @ 2006-10-12 13:42 UTC (permalink / raw)
To: linux-lvm
> ------------------------------
>
> Message: 8
> Date: Thu, 12 Oct 2006 11:07:10 +0200
> From: "Olivier Verloove" <olivier.verloove@gmail.com>
> Subject: [linux-lvm] Mounting hardware snapshots/clones on the same
> host ?
> Hello,
>
> I've seen this question a few times in the archives but
> without any answer.
>
> Is there a way to activate/mount a copy of a volume group taken with a
> disk-array based point-in-time copy on the same host ?
>
> The issue is that the disk-array based software will copy all
> information on the disk including PVID/VGID's which is confusing for
Linux's LVM.
>
> Special tools are available on other platforms (vgchgid on
> HP-UX, recreatevg on AIX) for this purpose.
>
> Thanks in advance.
>
> Best regards,
> Olivier
I have done this with EMC's Timefinder and SRDF functionality.
Basic steps are:
1. Do the array-based copy.
2. Reinitialze the new PV(s).
3. Edit a copy of the original LVM backup configuration file with
the UUID of the new PV(s), the new VG name, and a new VG UUID.
4. Restore the edited configuration file to the new PV(s).
5. Activate the new VG and use it.
At the risk of overly polluting the list, here are the actual
steps on RHEL 4u4 with native MPIO and Timefinder. The original
VG is "vgphil" and the new one is "vgphilcopy".
Each VG has 2 disks. For simplicity's sake I did this with no
file systems mounted from vgphil, so I don't show any I/O quiescing,
sync'ing, or fsck'ing, which would all be necessary
in the usual case.
# vgs -o +devices vgphil
VG #PV #LV #SN Attr VSize VFree Devices
vgphil 2 1 0 wz--n- 68.07G 67.97G
/dev/mapper/SEMC_____SYMMETRIX______503263048000(0),
/dev/mapper/SEMC_____SYMMETRIX______50326304C000(0)
# symdg create lvmtest
# symld -g lvmtest -sid 3263 add dev 48
# symld -g lvmtest -sid 3263 add dev 4c
# symbcv -sid 3263 -g lvmtest associate dev 361
# symbcv -sid 3263 -g lvmtest associate dev 369
# symmir -g lvmtest -full -noprompt establish
# # wait awhile
# symmir -g lvmtest verify
All of the devices in group 'lvmtest' are in the 'Synchronized or
Restored' state.
# symmir -g lvmtest -noprompt split
'Split' operation execution is in progress for
device group 'lvmtest'. Please wait...
'Split' operation successfully executed for device group
'lvmtest'.
# cp /etc/lvm/backup/vgphil /etc/lvm/backup/vgphilcopy
# pvcreate -ff /dev/mapper/SEMC_____SYMMETRIX______503263361000
Really INITIALIZE physical volume
"/dev/mapper/SEMC_____SYMMETRIX______503263361000" of volume group
"vgphil" [y/n]? y
WARNING: Forcing physical volume creation on
/dev/mapper/SEMC_____SYMMETRIX______503263361000 of volume group
"vgphil"
Physical volume "/dev/mapper/SEMC_____SYMMETRIX______503263361000"
successfully created
# pvcreate -ff /dev/mapper/SEMC_____SYMMETRIX______503263369000
Really INITIALIZE physical volume
"/dev/mapper/SEMC_____SYMMETRIX______503263369000" of volume group
"vgphil" [y/n]? y
WARNING: Forcing physical volume creation on
/dev/mapper/SEMC_____SYMMETRIX______503263369000 of volume group
"vgphil"
Physical volume "/dev/mapper/SEMC_____SYMMETRIX______503263369000"
successfully created
# pvdisplay /dev/mapper/SEMC_____SYMMETRIX______503263361000
|grep UUID
PV UUID W9qfnc-D4g5-U0aa-zPl4-UYLt-ldOX-iY35On
# pvdisplay /dev/mapper/SEMC_____SYMMETRIX______503263369000|grep UUID
PV UUID TiuG51-lgAS-CfY6-rMUU-OXFb-JJ5f-zmktV1
# cp /etc/lvm/backup/vgphilcopy /etc/lvm/backup/vgphilcopy.bck
# # edit vgname and UUID and pv UUIDs
# vi /etc/lvm/backup/vgphilcopy
# diff -C 1 /etc/lvm/backup/vgphilcopy /etc/lvm/backup/vgphilcopy.bck
*** /etc/lvm/backup/vgphilcopy 2006-10-12 09:18:53.000000000 -0400
--- /etc/lvm/backup/vgphilcopy.bck 2006-10-12 09:16:32.000000000
-0400
***************
*** 10,12 ****
! vgphilcopy {
! id = "PlyjQO-PRiR-JtHS-C3f5-SqiG-eJPB-2e3kdz"
--- 10,12 ----
! vgphil {
! id = "plyjQO-PRiR-JtHS-C3f5-SqiG-eJPB-2e3kdz"
***************
*** 21,23 ****
pv0 {
! id = "W9qfnc-D4g5-U0aa-zPl4-UYLt-ldOX-iY35On"
device = "/dev/dm-1" # Hint only
--- 21,23 ----
pv0 {
! id = "hwNSpt-rnD5-CYg1-3Xnk-clv0-2leP-qlKMTz"
device = "/dev/dm-1" # Hint only
***************
*** 30,32 ****
pv1 {
! id = "TiuG51-lgAS-CfY6-rMUU-OXFb-JJ5f-zmktV1"
device = "/dev/dm-2" # Hint only
--- 30,32 ----
pv1 {
! id = "wlM7pO-KFIo-nEBs-Rj0Z-v17Q-x0eQ-6FDnNj"
device = "/dev/dm-2" # Hint only
# vgcfgrestore -f /etc/lvm/backup/vgphilcopy vgphilcopy
Restored volume group vgphilcopy
# vgchange -ay vgphilcopy
1 logical volume(s) in volume group "vgphilcopy" now active
# vgs -a | egrep 'VG|phil'
VG #PV #LV #SN Attr VSize VFree
vgphil 2 1 0 wz--n- 68.07G 67.97G
vgphilcopy 2 1 0 wz--n- 68.07G 67.97G
# vgs -o +devices vgphil
VG #PV #LV #SN Attr VSize VFree Devices
vgphil 2 1 0 wz--n- 68.07G 67.97G
/dev/mapper/SEMC_____SYMMETRIX______503263048000(0),/dev/mapper/SEMC____
_SYMMETRIX______50326304C000(0)
# vgs -o +devices vgphilcopy
VG #PV #LV #SN Attr VSize VFree Devices
vgphilcopy 2 1 0 wz--n- 68.07G 67.97G
/dev/mapper/SEMC_____SYMMETRIX______503263361000(0),/dev/mapper/SEMC____
_SYMMETRIX______503263369000(0)
# lvs -a vgphil
LV VG Attr LSize Origin Snap% Move Log Copy%
lvphil vgphil -wi--- 104.00M
# lvs -a vgphilcopy
LV VG Attr LSize Origin Snap% Move Log Copy%
lvphil vgphilcopy -wi-a- 104.00M
Hope this helps.
Phil Lowden
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-lvm] RE: linux-lvm Digest, Vol 32, Issue 7
2006-10-12 13:42 [linux-lvm] RE: linux-lvm Digest, Vol 32, Issue 7 Phil Lowden (plowden)
@ 2006-10-12 14:13 ` Alasdair G Kergon
0 siblings, 0 replies; 2+ messages in thread
From: Alasdair G Kergon @ 2006-10-12 14:13 UTC (permalink / raw)
To: LVM general discussion and development
On Thu, Oct 12, 2006 at 03:42:42PM +0200, Phil Lowden (plowden) wrote:
> 1. Do the array-based copy.
> 2. Reinitialze the new PV(s).
> 3. Edit a copy of the original LVM backup configuration file with
> the UUID of the new PV(s), the new VG name, and a new VG UUID.
> 4. Restore the edited configuration file to the new PV(s).
> 5. Activate the new VG and use it.
There are tools to help you do that without having to edit/restore
a metadata backup file:
filters to tell lvm2 to only use the disks in the VG you're changing
(easiest to use with --config now)
--uuid options to pvchange and vgchange
vgrename <old_vg_uuid> <new_name>
Alasdair
--
agk@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-12 14:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-12 13:42 [linux-lvm] RE: linux-lvm Digest, Vol 32, Issue 7 Phil Lowden (plowden)
2006-10-12 14:13 ` Alasdair G Kergon
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).