Skip to contentSkip to conversation

Clone disk with LVM

linux-lvm Ryan Nelson 3 participants 3 messages Jul 2, 2007 – Jul 8, 2007

lore
Share & tools
lore
#0 lore raw

I had a Linux system using LVM for / (root) that was going away for field tests and the users of the system wanted to have a couple hot spares of the drives. Using dd I replicated the disk to two diffrent drives. One drive stored away and the other drive was going to be in the system being rsync'd nightly so that it would have the freshest data on it.

Because of the dd the LVM had the same names and UUIDs for the vg and lg. I was able to change the names however I wasn't successful in change the UUIDs. It didn't even look like there was an option to change the UUIDs for the lv.

What would have been the correct way to achieve a setup like this with LVM? I would assume a mirroring of some sort although I don't know what would be involved for the user if the drive did die and they needed to use the second drive.

Thanks
Ryan

#1 lore raw

On 2 Jul 2007, Ryan Nelson spake thusly:

Quoted 2 lines

Because of the dd the LVM had the same names and UUIDs for the vg and lg. I was able to change the names however I wasn't successful in change the UUIDs. It didn't even look like there was an option to change the UUIDs for the lv.

vgcfgbackup, edit the backup, edit the ids in the logical_volumes sections, check your work carefully, and vgcfgrestore?

(One very nice thing about LVM2 is that all the metadata is textual...)

Signature · 3 lines
`... in the sense that dragons logically follow evolution so they would
 be able to wield metal.' --- Kenneth Eng's colourless green ideas sleep
 furiously
#2 lore raw
In reply to Ryan Nelson
Quoted 2 lines · Ryan Nelson

It didn't even look like there was an option to
change the UUIDs for the lv.

You don't need to. LV UUIDs are always qualified by the VG UUID. Create an LVM2 installation using LVM1 metadata with more than one VG with at least one LV in each and you'll see duplicate LV UUIDs.

Alasdair

Signature · 1 line
[email protected]