1

I've recently had to have the system disk in a remote server replaced, and the DC attached the old disk to a USB port. The problem is that CentOS was installed on both using all the defaults, and so now the output of lvscan is:

[root@IS-55825 /]# lvscan
  inactive          '/dev/vg_is55825/lv_root' [50.00 GiB] inherit
  inactive          '/dev/vg_is55825/lv_home' [53.46 GiB] inherit
  inactive          '/dev/vg_is55825/lv_swap' [7.67 GiB] inherit
  ACTIVE            '/dev/vg_is55825/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_is55825/lv_home' [53.24 GiB] inherit
  ACTIVE            '/dev/vg_is55825/lv_swap' [7.89 GiB] inherit

pvs can tell the difference, but I can't figure out how to separate them in a way that I can just mount one of the old partitions to get some config information back:

[root@IS-55825 /]# pvs -v
    Using physical volume(s) on command line.
    Wiping cache of LVM-capable devices
    Wiping internal VG cache
    Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO
    Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO
  PV         VG         Fmt  Attr PSize   PFree DevSize PV UUID
  /dev/sda2  vg_is55825 lvm2 a--u 111.13g    0  111.13g QC5BPW-VdKx-dNnw-vSNm-cH6H-fZwB-HHXwFb
  /dev/sdd2  vg_is55825 lvm2 a--u 111.13g    0  111.13g LNSYx6-8DCv-u9CG-S1zv-vI20-fNIq-7BA8Le

It's /dev/sdd2 that I'm after, but it won't mount directly:

[root@IS-55825 /]# mount /dev/sdd2 /oldsys
mount: unknown filesystem type 'LVM2_member'

I tried lvdisplay --select vg_uuid=LNSYx6-8DCv-u9CG-S1zv-vI20-fNIq-7BA8Le but it gives no output, and that's as far as I got... Is there some way to get access to it?

2

OK - I was able to fix this using vgrename. Firstly, running lvscan -v:

[root@IS-55825 ~]# lvscan -v
    Using logical volume(s) on command line.
    Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO
    Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO
    Cache: Duplicate VG name vg_is55825: Existing gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO (created here) takes precedence over KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06
  inactive          '/dev/vg_is55825/lv_root' [50.00 GiB] inherit
  inactive          '/dev/vg_is55825/lv_home' [53.46 GiB] inherit
  inactive          '/dev/vg_is55825/lv_swap' [7.67 GiB] inherit
    Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO
  ACTIVE            '/dev/vg_is55825/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_is55825/lv_home' [53.24 GiB] inherit
  ACTIVE            '/dev/vg_is55825/lv_swap' [7.89 GiB] inherit

So I guessed the UUID gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO was the old disk. So I ran vgrename:

[root@IS-55825 ~]# vgrename gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO vg_oldsys
  Processing VG vg_is55825 because of matching UUID gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO
  Volume group "gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO" successfully renamed to "vg_oldsys"

And then I was able to mount /dev/vg_oldsys/lv-root. Phew.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.