All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tod <tod@stthomasepc.org>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Renaming Loopback 'Mounted' Volume Group
Date: Mon, 26 Nov 2007 21:58:59 -0500	[thread overview]
Message-ID: <474B87F3.7000003@stthomasepc.org> (raw)
In-Reply-To: <474A83A4.30103@redhat.com>

Bryn M. Reeves wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Tod wrote:
>> Please take a look at this old thread first ...
>>
>> http://linux.derkeiler.com/Mailing-Lists/Fedora/2007-02/msg02237.html
>>
>>
>> This was back in February and I'm just now trying to get back into
>> recovery mode.  I've mounted the image like so:
>>
>> /sbin/losetup /dev/loop0 ./recover.img
>> /sbin/kpartx -lv /dev/loop0
>> /sbin/kpartx -av /dev/loop0
>>
>> This gives me /dev/mapper/loop0p1, and /dev/mapper/loop0p2 which seeoupNew
>>  be my original boot drive and VolGroup00.  When I do an lvscan I get: 
>>
>> WARNING: Duplicate VG name VolGroup00: Existing
>> Vmi02d-0hr7-7NVb-vYZi-1fbD-E9n5-ixWu0a (created here) takes precedence
>> over D7avZX-pVCb-ibTN-tyvs-7Q62-rzR9-tquBi9
> 
> See the steps I posted last Friday, with some corrections/improvements
> from Alasdair:
> 
> https://www.redhat.com/archives/linux-lvm/2007-November/msg00039.html
> https://www.redhat.com/archives/linux-lvm/2007-November/msg00040.html


Thanks Bryn.

Before I make a mess I'd like to recite my steps to see if they seem 
reasonable to you.  I've made a little progress (I think) since the post 
above that might allow me to streamline things.

Of the two 'partitions' on my disk image, only the LVM one has content 
that is important to me and I already know its offset.  Combining both 
your's and Alasdair's steps:

1.  /sbin/losetup /dev/loop0 ./recover.img
2.  /sbin/losetup -o 106928640 /dev/loop1 /dev/loop0
3.  Running pvscan shows me the loopback PV, and gives me expected 
warning regarding the duplicate VG name
4.  Setup temp LVM dir and set LVM_SYSTEM_DIR to point to it
5.  Copy lvm.conf to that dir and apply filter = [ "r|/dev/loop[01]|", 
"a|.*|" ] to it
6.  Clone the PV -> dd if=/dev/loop1 of=/dev/loop2
7.  pvchange --uuid /dev/loop2
8.  vgchange --uuid VolGroup00
9.  vgrename VolGroup00 VolGroupNew
10. Discard LVM_SYSTEM_DIR env var & directory
11. Activate new VG ->  vgchange -ay VolGroupNew

Does this look right?  The one concern I had was step 8 since both my 
currently active VG and the one from the disk image share the same name. 
  I'm guessing steps 4 and 5 will prevent that?

Thanks for all of your help.


- Tod

      reply	other threads:[~2007-11-27  2:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-23 21:35 [linux-lvm] Renaming Loopback 'Mounted' Volume Group Tod
2007-11-26  8:28 ` Bryn M. Reeves
2007-11-27  2:58   ` Tod [this message]

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=474B87F3.7000003@stthomasepc.org \
    --to=tod@stthomasepc.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.