linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] creating DD copies of disks
Date: Tue, 20 Sep 2016 10:04:01 +0200	[thread overview]
Message-ID: <8442be16-d9a5-2684-5f59-a01a0da43f81@redhat.com> (raw)
In-Reply-To: <20160917180224.GG3302@soda.linbit>

Dne 17.9.2016 v 20:02 Lars Ellenberg napsal(a):
> 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.

Hi

It might be worth to mention here -  lvm2  is your LEAST problem when you have 
duplicate device in your system.

Udevd  nor  systemd can cope with those device AT ALL.
(you will actually hardly find tool which can handle them).

So once a duplicated identifier appears in your system - all related symlinks
in /dev/by*  or  related attached systemd services  becomes just a random 
unpredictable 'garbage'.

In general user-space tools are unprepared to deal with 'identical' devices.
So IMHO lvm2 is still 'lighting years' ahead here.

You could prepare device filters to actually make your 'duplicate' device 
invisible to lvm2  (as I always HIGHLY recommend to use 'white-list' filter
and let lvm2 process only  'expected' device).
Recent version of lvm2 also do try to 'smartly' guess which one of duplicated 
device is actually in use to further increase protection of a user...

However lvmetad is yet not fully equipped for this - but at least it will 
automatically turn itself off now...

Regards

Zdenek

  reply	other threads:[~2016-09-20  8:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-17  7:29 [linux-lvm] creating DD copies of disks Xen
2016-09-17 13:49 ` Lars Ellenberg
2016-09-17 14:40   ` Xen
2016-09-17 18:02     ` Lars Ellenberg
2016-09-20  8:04       ` Zdenek Kabelac [this message]
     [not found] <368387847.156920.1474117496841.ref@mail.yahoo.com>
2016-09-17 13:04 ` matthew patton
2016-09-17 14:16   ` Xen
2016-09-17 14:53     ` Xen
2016-09-17 15:18       ` Michael D. Setzer II
2016-09-17 15:40         ` Xen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8442be16-d9a5-2684-5f59-a01a0da43f81@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).