From: Xen <list@xenhideout.nl>
To: linux-lvm@redhat.com
Subject: Re: [linux-lvm] Can't work normally after attaching disk volumes originally in a VG on another machine
Date: Wed, 28 Mar 2018 12:08:25 +0200 [thread overview]
Message-ID: <7ee70f0127cdc11fcee196aaf2b8c81e@xenhideout.nl> (raw)
In-Reply-To: <0fd9ce65-75da-f685-b7d1-c5ee9eecda3a@gmail.com>
Zdenek Kabelac schreef op 28-03-2018 0:17:
> Hi
>
> This is why users do open BZ if they would like to see some
> enhancement.
>
> Normally cache is integral part of a volume - so it's partially
> missing - whole volume is considered to be garbage.
>
> But in 'writethrough' mode there could be likely possible better
> recovery.
>
> Of course this case needs usability without --force.
>
> So please open RFE BZ for this case.
It goes into the mess I usually get myself into; if you "dd copy" the
disk containing the origin volume before uncaching it, and then go to
some live session where you only have the new backup copy, but you want
to clean up its LVM,
then you now must fix the VGs in isolation of the cache; I suppose this
is just the wrong order of doing things, but as part of a backup you
don't really want to uncache first, as that requires more work to get it
back to normal after.
So you end up in a situation where the new origin copy has a reference
to the cache disk --- all of this assumes writethrough mode --- and you
need to clear that reference.
However, you cannot, or should not, attach the cache disk again; it
might get effected, and you don't want that, you want it to remain in
its pristine state.
Therefore, you are now left with the task of removing the cache from the
VG, because you cannot actually run vgimportclone while the cache disk
is missing.
The obvious solution is to *also* clone the cache disk and then run
operations on the combined set, but this might not be possible.
Therefore, all that was left was:
vgreduce --remove-missing --force
cd /etc/lvm/archive
cp <latest backup> /etc/lvm/backup/<vg>
cd /etc/lvm/backup
vi <vg>
" remove cache PV, and change origin to regular linear volume, and add
" the visible tag
vgcfgrestore <vg>
# presto, origin is restored as regular volume without the cache
vgimportclone -i <vg> <bla>
# now have distinct volume group, VG UUID and PV UUID
So the problem is making dd backups of origin, perhaps dd backups should
be avoided, but for some purposes (such as system migration) file copies
are just
more work
in general, and can complicate things as well, for instance if there are
NTFS partitions or whatnot.
And disk images can be nice to have, in any case.
This was the use case basically.
next prev parent reply other threads:[~2018-03-28 10:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 8:30 [linux-lvm] Can't work normally after attaching disk volumes originally in a VG on another machine Gang He
2018-03-23 9:04 ` Xen
2018-03-26 6:04 ` Gang He
2018-03-26 10:17 ` Fran Garcia
2018-03-26 10:23 ` Fran Garcia
2018-03-27 5:55 ` Gang He
2018-03-27 8:32 ` Zdenek Kabelac
2018-03-28 2:09 ` Gang He
2018-03-27 9:12 ` Xen
2018-03-27 10:22 ` Zdenek Kabelac
2018-03-27 10:27 ` Xen
2018-03-27 22:17 ` Zdenek Kabelac
2018-03-28 10:08 ` Xen [this message]
2018-03-26 10:46 ` Zdenek Kabelac
2018-05-18 4:56 ` Gang He
2018-03-26 11:33 ` Xen
2018-10-16 20:59 ` [linux-lvm] [lvm-devel] " Nir Soffer
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=7ee70f0127cdc11fcee196aaf2b8c81e@xenhideout.nl \
--to=list@xenhideout.nl \
--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).