All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Editing LVM 2 metadata
@ 2008-11-15  2:37 Michael Jensen
  2008-11-15  2:55 ` Alasdair G Kergon
  2008-11-15  2:56 ` [linux-lvm] Editing LVM 2 metadata Alasdair G Kergon
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Jensen @ 2008-11-15  2:37 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

I have a need to edit the metadata on an LVM2 PV.  It is a storage managed snapshot of a LVM VG.

It appears I can alter the metadata contents that are in the first 128KB of the device (/dev/sda) using dd and vi.

However, after I edited the LABELONE area where the binary copy of the PV UUID is stored (200x offset area) and the ASCII version at 12b0x and 16b0x and reboot - vgscan no longer recognizes the VG.

Question - are all the UUID's - VG, LV, PV generated as a self-check hash to ensure they haven't been bit-picked or otherwise compromised by the storage??

I have downloaded the source, but am not sure yet where to find the code that generates the UUID strings.

Thanks,
Mike


      

[-- Attachment #2: Type: text/html, Size: 1049 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Editing LVM 2 metadata
  2008-11-15  2:37 [linux-lvm] Editing LVM 2 metadata Michael Jensen
@ 2008-11-15  2:55 ` Alasdair G Kergon
  2008-11-15  3:30   ` Michael Jensen
  2008-11-17 22:58   ` [linux-lvm] steps to clone a volume group Michael Jensen
  2008-11-15  2:56 ` [linux-lvm] Editing LVM 2 metadata Alasdair G Kergon
  1 sibling, 2 replies; 7+ messages in thread
From: Alasdair G Kergon @ 2008-11-15  2:55 UTC (permalink / raw)
  To: LVM general discussion and development

On Fri, Nov 14, 2008 at 06:37:51PM -0800, Michael Jensen wrote:
> I have a need to edit the metadata on an LVM2 PV.

Why?

If you really have to, please do this using the supplied tools - it's *much*
easier!

vgcfgbackup gives you a text file, edit it, vgcfgrestore puts it back.

If you need to edit the label too, careful use of pvcreate --restorefile --uuid
plus vgcfgrestore lets you do that.

Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Editing LVM 2 metadata
  2008-11-15  2:37 [linux-lvm] Editing LVM 2 metadata Michael Jensen
  2008-11-15  2:55 ` Alasdair G Kergon
@ 2008-11-15  2:56 ` Alasdair G Kergon
  1 sibling, 0 replies; 7+ messages in thread
From: Alasdair G Kergon @ 2008-11-15  2:56 UTC (permalink / raw)
  To: LVM general discussion and development

On Fri, Nov 14, 2008 at 06:37:51PM -0800, Michael Jensen wrote:
> However, after I edited the LABELONE area where the binary copy of the PV
> UUID is stored (200x offset area) and the ASCII version at 12b0x and 16b0x
> and reboot - vgscan no longer recognizes the VG.
 
If you just need to change the UUIDs to make them unique look in the list
archives for instructions: the tools have options to do that.

Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Editing LVM 2 metadata
  2008-11-15  2:55 ` Alasdair G Kergon
@ 2008-11-15  3:30   ` Michael Jensen
  2008-11-15 12:44     ` David Robinson
  2008-11-17 22:58   ` [linux-lvm] steps to clone a volume group Michael Jensen
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Jensen @ 2008-11-15  3:30 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

The why is because I am attempting to use storage managed snapshots.  The storage can present the master volume and the snapshot as separate LUN's but they present identical contents in the header area (first 256 sectors...). So the effort is to modify the snapshot (doable with this storage) without altering the contents of the master volume.  Hopefully the snapshot with suitable edits to the UUID's would then pass vgscan test.

I am checking the tools now.  One question - do the UUID's employ any sort of hash or check-character scheme to ensure that they haven't been bit-picked or otherwise compromised by the storage??

Thanks,
Mike




________________________________
From: Alasdair G Kergon <agk@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Sent: Friday, November 14, 2008 6:55:15 PM
Subject: Re: [linux-lvm] Editing LVM 2 metadata

On Fri, Nov 14, 2008 at 06:37:51PM -0800, Michael Jensen wrote:
> I have a need to edit the metadata on an LVM2 PV.

Why?

If you really have to, please do this using the supplied tools - it's *much*
easier!

vgcfgbackup gives you a text file, edit it, vgcfgrestore puts it back.

If you need to edit the label too, careful use of pvcreate --restorefile --uuid
plus vgcfgrestore lets you do that.

Alasdair
-- 
agk@redhat.com

_______________________________________________
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/



      

[-- Attachment #2: Type: text/html, Size: 2544 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Editing LVM 2 metadata
  2008-11-15  3:30   ` Michael Jensen
@ 2008-11-15 12:44     ` David Robinson
  2008-11-17 13:29       ` himanshu padmanabhi
  0 siblings, 1 reply; 7+ messages in thread
From: David Robinson @ 2008-11-15 12:44 UTC (permalink / raw)
  To: LVM general discussion and development

2008/11/15 Michael Jensen <beachhangar@yahoo.com>:
> The why is because I am attempting to use storage managed snapshots.  The
> storage can present the master volume and the snapshot as separate LUN's but
> they present identical contents in the header area (first 256 sectors...).
> So the effort is to modify the snapshot (doable with this storage) without
> altering the contents of the master volume.  Hopefully the snapshot with
> suitable edits to the UUID's would then pass vgscan test.

Its easiest if you follow the steps listed here:

https://www.redhat.com/archives/linux-lvm/2007-November/msg00039.html

--Dave

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Editing LVM 2 metadata
  2008-11-15 12:44     ` David Robinson
@ 2008-11-17 13:29       ` himanshu padmanabhi
  0 siblings, 0 replies; 7+ messages in thread
From: himanshu padmanabhi @ 2008-11-17 13:29 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 2141 bytes --]

*Is this issue having connection with it.

Problem*

One IET target is having 2 luns as "Parent LV" and "its snapshot".

When MS initiator connects to it,it gets rebooted.

I came to know through forum that it is due to same disk signatures of the
two disks on initiator side.

If I attach "Parent LV" and "its snapshot" to different targets,then windows
initiator is behaving well.

But in Open-iSCSI initiator under linux,both cases work well,
*
Issues

*both parent lv and its snapshot are taking same IDs probably.How can i
change the id of snapshot.It determines ID internally through timestamps and
some other things.Both takes UUID obviously different.Windows might see
these either as two copies of the same volume or two paths to the same
volume, but their data diverges which causes Windows to freak out.Windows
stores a volume identifier in the MBR/GPT when a disk is first recognized
and uses that identifier for identification of storage volumes.But I cannot
make changes on client(initiator) side as my product is server machine.

basically *what changes should be made on the target side so that initiator
will recognize both as different disks?*

On Sat, Nov 15, 2008 at 6:14 PM, David Robinson <zxvdr.au@gmail.com> wrote:

> 2008/11/15 Michael Jensen <beachhangar@yahoo.com>:
> > The why is because I am attempting to use storage managed snapshots.  The
> > storage can present the master volume and the snapshot as separate LUN's
> but
> > they present identical contents in the header area (first 256
> sectors...).
> > So the effort is to modify the snapshot (doable with this storage)
> without
> > altering the contents of the master volume.  Hopefully the snapshot with
> > suitable edits to the UUID's would then pass vgscan test.
>
> Its easiest if you follow the steps listed here:
>
> https://www.redhat.com/archives/linux-lvm/2007-November/msg00039.html
>
> --Dave
>
> _______________________________________________
> 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/
>



-- 
Regards,
Himanshu Padmanabhi

[-- Attachment #2: Type: text/html, Size: 3058 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] steps to clone a volume group
  2008-11-15  2:55 ` Alasdair G Kergon
  2008-11-15  3:30   ` Michael Jensen
@ 2008-11-17 22:58   ` Michael Jensen
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Jensen @ 2008-11-17 22:58 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 2087 bytes --]

The information shown from a nov 2007 post has been very useful - much appreciated.

There are some circumstances with the case I am working on that complicates the process a bit.

After having removed the master volume from the host and presenting just a snapshot, I have been able to change the physical uuid, and rename the volume group. If I then re-introduce the master volume there is no conflict (no-duplicates) found by the lvm utilities and can mount both sucessfully.

The constraints I am operating under require the master volume not to disappear - i.e. production system and volume.

If I filter out the snapshot and leave the accept (a) portion - "a|.*|" in the filter line, then a conflict is reported by pvscan, but not between sda and sdb but between sdb and the device-mapper string that appears to use the FC WWN.  
If I remove the accept portion then there is no conflict during pvscan.  
If I attempt to do a --
pvchange --uuid /dev/sda
Failed to read physical volume /dev/sda
0 physical volumes changed / 0 physical volumes not changed

Is the filtered out device name (/dev/sda) supposed to be available to the lvm utilities?

thanks,
mike




________________________________
From: Alasdair G Kergon <agk@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Sent: Friday, November 14, 2008 6:55:15 PM
Subject: Re: [linux-lvm] Editing LVM 2 metadata

On Fri, Nov 14, 2008 at 06:37:51PM -0800, Michael Jensen wrote:
> I have a need to edit the metadata on an LVM2 PV.

Why?

If you really have to, please do this using the supplied tools - it's *much*
easier!

vgcfgbackup gives you a text file, edit it, vgcfgrestore puts it back.

If you need to edit the label too, careful use of pvcreate --restorefile --uuid
plus vgcfgrestore lets you do that.

Alasdair
-- 
agk@redhat.com

_______________________________________________
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/



      

[-- Attachment #2: Type: text/html, Size: 3240 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-11-17 22:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-15  2:37 [linux-lvm] Editing LVM 2 metadata Michael Jensen
2008-11-15  2:55 ` Alasdair G Kergon
2008-11-15  3:30   ` Michael Jensen
2008-11-15 12:44     ` David Robinson
2008-11-17 13:29       ` himanshu padmanabhi
2008-11-17 22:58   ` [linux-lvm] steps to clone a volume group Michael Jensen
2008-11-15  2:56 ` [linux-lvm] Editing LVM 2 metadata Alasdair G Kergon

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.