So I recently had to mount and old drive on my laptop because I thought I had a drive failure (turns out it was actually the mobo). So bought a 14$ USB drive enclosure from Newegg and proceeded to try to mount the old drive on my laptop. The problem I ran into was that both the old drive and the drive in my laptop where using LVM and both Volume groups had the same name of VolGroup00. This of course meant that I couldn’t easily mount the new drive (/dev/sdb). However, we can just rename the old drives Volume group. The first step is to grab the UUID of the second group:
[root@localhost /]# vgscan
Reading all physical volumes. This may take a while…
WARNING: Duplicate VG name VolGroup00: Existing 3eRTge-6Qdv-Uc3N-n7rT-HtpD-juW5-fsVna0 (created here) takes precedence over E54jfp-1X0X-qCwZ-SrAS-VYit-bXcM-a8lmtx
Found volume group “VolGroup00″ using metadata type lvm2
Found volume group “VolGroup00″ using metadata type lvm2
The UUID in this case is E54jfp-1X0X-qCwZ-SrAS-VYit-bXcM-a8lmtx so next we rename it with vgrename:
[root@localhost /]# vgrename E54jfp-1X0X-qCwZ-SrAS-VYit-bXcM-a8lmtx Whoami00
WARNING: Duplicate VG name VolGroup00: Existing 3eRTge-6Qdv-Uc3N-n7rT-HtpD-juW5-fsVna0 (created here) takes precedence over E54jfp-1X0X-qCwZ-SrAS-VYit-bXcM-a8lmtx
Volume group “VolGroup00″ successfully renamed to “Whoami00″
After this I rebooted because Fedora 9 kept insisting that Whoami00 was actually still my primary drive. The reboot fixed that.
So after doing that we’re good to go almost, but the Volume group is still marked as unavailable:
[root@localhost ~]# lvdisplay
— Logical volume —
LV Name /dev/Whoami00/LogVol00
VG Name Whoami00
LV UUID uL2cZp-35jq-qp5H-U1In-2XgT-kYdG-274lq6
LV Write Access read/write
LV Status NOT available
LV Size 73.41 GB
Current LE 2349
Segments 1
Allocation inherit
Read ahead sectors auto
— Logical volume —
LV Name /dev/Whoami00/LogVol01
VG Name Whoami00
LV UUID BmLtSv-AYqb-Hjpn-mTc2-NoIn-4mp2-cPGsL4
LV Write Access read/write
LV Status NOT available
LV Size 1.00 GB
Current LE 32
Segments 1
Allocation inherit
Read ahead sectors auto
To fix that we simply run vgchange again to mark this volume as active:
[root@localhost ~]# vgchange -a y Whoami00
2 logical volume(s) in volume group “Whoami00″ now active
[root@localhost ~]# lvdisplay
— Logical volume —
LV Name /dev/Whoami00/LogVol00
VG Name Whoami00
LV UUID uL2cZp-35jq-qp5H-U1In-2XgT-kYdG-274lq6
LV Write Access read/write
LV Status available
# open 0
LV Size 73.41 GB
Current LE 2349
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
After that you can go ahead and mount the volume and your good to go:
[root@localhost ~]# mount /dev/Whoami00/LogVol00 /mnt/
[root@localhost ~]# cd /mnt/
[root@localhost mnt]# ls
backup dev lib misc opt proc selinux sys var
bin etc lost+found mnt opt.tar.gz root srv tmp
boot home media net poweroff sbin swapfile usr
Florian