Editing LVM 2 metadata
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
Quoted 1 line · Michael Jensen
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
Signature · 1 line
[email protected]
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 <[email protected]>
To: LVM general discussion and development <[email protected]>
Sent: Friday, November 14, 2008 6:55:15 PM
Subject: Re: [linux-lvm] Editing LVM 2 metadata
Quoted 1 line · Michael Jensen
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
Signature · 7 lines
[email protected] _______________________________________________ linux-lvm mailing list [email protected] https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
2008/11/15 Michael Jensen <[email protected]>:
Quoted 6 lines
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
*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?*
Quoted 23 lines · David Robinson
2008/11/15 Michael Jensen <[email protected]>:
Quoted 2 lines
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
Quoted 1 line
they present identical contents in the header area (first 256
sectors...).
Quoted 1 line
So the effort is to modify the snapshot (doable with this storage)
without
Quoted 2 lines
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
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Signature · 2 lines
Regards, Himanshu Padmanabhi
Re: [linux-lvm] steps to clone a volume group
In reply to Alasdair G KergonThe 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 <[email protected]>
To: LVM general discussion and development <[email protected]>
Sent: Friday, November 14, 2008 6:55:15 PM
Subject: Re: [linux-lvm] Editing LVM 2 metadata
Quoted 1 line · Michael Jensen
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
Signature · 7 lines
[email protected] _______________________________________________ linux-lvm mailing list [email protected] https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Quoted 3 lines · Michael Jensen
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
Signature · 1 line
[email protected]