Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have cloned (using dd) the hard drive in a live system onto several multiple backup hard drives. The root partition in the live system is a LVM volume. The backup copies are intended to be drop-in replacements for the original and this means they need to have the same UUID as the master.

Quick question: is it possible to mount one of the backup HDs on the live system? When I try to do so LVM is understandably confused about this due to the same UUIDs and volume group names. Following the hint found in [this answer][1] to first rename the original LVM group, I have tried:

  1. connecting the external backup HD into a USB port

  2. running (note that the string 'test' is the group name on this system)

# vgrename test test-live
Volume group "test" successfully renamed to "test-live"
vgscan --mknodes
Reading all physical volumes.  This may take a while...
Found duplicate PV qWUadGaM2MU1UAJ5Spp8upD6fbddk7Zb: using /dev/dm-3 not /dev/dm-0
Found volume group "test" using metadata type lvm2
# vgchange -ay
Found duplicate PV qWUadGaM2MU1UAJ5Spp8upD6fbddk7Zb: using /dev/dm-3 not /dev/dm-0
2 logical volume(s) in volume group "test" now active

At this point I would have expected to have been able to access the individual logical volumes under /dev/test/. Running lvdisplay produces.

Found duplicate PV qWUadGaM2MU1UAJ5Spp8upD6fbddk7Zb: using /dev/dm-3 not /dev/dm-0

  --- Logical volume ---
  LV Name                /dev/test/root
  VG Name                test
  LV UUID                UuKUH3-yzPo-CbOz-tU4B-W6om-qdMn-0XSNZU
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                126.48 GiB
  Current LE             32378
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

  --- Logical volume ---
  LV Name                /dev/test/swap_1
  VG Name                test
  LV UUID                OGJhJu-QByo-6AzG-sk1x-jh3e-dU9L-sHk91t
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                3.90 GiB
  Current LE             999
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2

However, /dev/test/ does not exist at all and therefore I cannot access the logical volumes at /dev/test/root and /dev/test/swap_1 as lvdisplay suggested.

share|improve this question
    
Opinion time: If you have disks to spare, you really should be looking at putting them in a RAID configuration (if even software RAID to save some coin) instead of shoehorning a solution such as this one. RAID1 or even RAID5 are both good options. –  Garrett Jun 17 at 3:24

2 Answers 2

up vote 2 down vote accepted

The whole point of UUIDs is to uniquely identify something, and what you're trying to do makes them non-unique. I highly doubt that this is possible. I played around with pvchange -u to change the UUID of a duplicated PV, but the operation always failed.

If you really need to mount the backups on the live host, I suggest that you backup the LVs individually (i.e. create a new PV, VG and LVs on the backup device and dd each LV separately).

share|improve this answer

I encountered this problem just yesterday. I have filesystem(LVM(MD(sda, sdb, sdc-syncing-only-weekly-basis))) configuration on Linux, and needed to access old data on sdc.

I somewhat solved the issue by attaching backup disk (sdc) to a VM. This is a safe operation as long as I attach the disk with "qemu ... -drive file=/dev/sdc,readonly" (or use a snapshot option for copy-on-write configuration).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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