[linux-lvm] creating DD copies of disks
lars.ellenberg at linbit.com
Sat Sep 17 18:02:24 UTC 2016
On Sat, Sep 17, 2016 at 04:40:36PM +0200, Xen wrote:
> Lars Ellenberg schreef op 17-09-2016 15:49:
> >On Sat, Sep 17, 2016 at 09:29:16AM +0200, Xen wrote:
> >>I want to ask again:
> >>What is the proper procedure when duplicating a disk with DD?
> >depends on what you define as "proper",
> >what the desired outcome is supposed to look like.
> >What exactly are you trying to do?
> >If you intend to "clone" PVs of some LVM2 VG,
> >and want to be able to activate that on the same system
> >without first deactivating the "original",
> >I suggest:
> >1) create consistent snapshot(s) or clone(s) of all PVs
> >2) import them with "vgimportclone",
> >which is a shell script usually in /sbin/vgimportclone,
> >that will do all the neccessary magic for you,
> >creating new "uuid"s and renaming the vg(s).
> Right so that would mean first duplicating partition tables etc.
> I will check that out some day. At this point it is already done, mostly. I
> didn't yet know you could do that, or what a "clone" would be, so thank you.
No. You check that out *now*.
It does not matter how you create your "duplicates" "clones" "snapshots"
whatever you name them. If you want, use dd. No one really cares.
What matters is that they are consistent.
Then, if you want to attach them, both original and "duplicate",
you need to change uuids of PV and VG, and the VG name.
And vgimportclone is a script that does all necessary steps for you.
So no, you don't have to write scripts,
or figure out the necessary steps.
Someone else did that for you already.
Just use it.
: Lars Ellenberg
: LINBIT | Keeping the Digital World Running
: DRBD -- Heartbeat -- Corosync -- Pacemaker
: R&D, Integration, Ops, Consulting, Support
DRBD® and LINBIT® are registered trademarks of LINBIT
More information about the linux-lvm