Renaming Loopback 'Mounted' Volume Group
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 seem to
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
Presumably the latter is the UUID of the volume group on my disk image.
Is there a way that I can now rename this original volume group so it doesn't conflict with my currently mounted one so I can start the data recovery process? I tried vgrename, which I thought could use UUID's as input, but that didn't work. Any ideas?
FC6
lvm2-2.02.17-1.fc6
Thanks - Tod
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 12 lines · Tod
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
Quoted 6 lines
This gives me
/dev/mapper/loop0p1, and/dev/mapper/loop0p2which seem to
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
Regards,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFHSoOk6YSQoMYUY94RAkp1AKCixiD85e6gtb+fju0M0VJbiyrFwACg0vLQ dkdB8lPKZxzueFAutdkptP8=
=qyM4
-----END PGP SIGNATURE-----
Quoted 23 lines · Bryn M. Reeves
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 12 lines · Tod
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/loop0Quoted 6 lines
This gives me
/dev/mapper/loop0p1, and/dev/mapper/loop0p2which 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
Quoted 5 lines
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