Answer the question
In order to leave comments, you need to log in
How to mount LVM from an external drive?
So, there is a server with Linux (Ubuntu 12.04), the disk is marked with LVM.
There is a second physical disk, it also has LVM
How to mount this second disk without losing data?
Various pvs/pvscan/lvscan/lvmdiskscan/vgimport and others do not see volumes on the second disk.
In fact, before reinstalling the OS, both physical disks were in the same volume group.
Answer the question
In order to leave comments, you need to log in
Use kpartx (kpartx -a /dev/...) then vgscan.
if the VG names match, then it's better to use some livecd, rename the VG on an external drive, and then mount it to the main system.
Mounting an external drive is no different from mounting an internal drive.
Physically connect the drive.
See if it's connected:
It must be in the list
Then
# vgscan --mknodes
# vgchange -ay
# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
Found volume group "VolGroup00" using metadata type lvm2
# vgdisplay | grep -i 'name\|uuid'
VG Name VolGroup00
VG Size 148.94 GB
PE Size 32.00 MB
Total PE 4766
Alloc PE / Size 4766 / 148.94 GB
Free PE / Size 0 / 0
VG UUID pkb1cy-1JSf-n3Px-UYRi-eImv-e1Eg-t12BgY
VG Name VolGroup00
VG Size 74.41 GB
PE Size 32.00 MB
Total PE 2381
Alloc PE / Size 2381 / 74.41 GB
Free PE / Size 0 / 0
VG UUID SjBmkg-YvMz-B160-tEds-Vqrg-SFMS-mYNimL
# pvscan
PV /dev/sda2 VG vg160 lvm2 [148.94 GB / 0 free]
PV /dev/hda2 VG VolGroup00 lvm2 [74.41 GB / 0 free]
Total: 2 [223.34 GB] / in use: 2 [223.34 GB] / in no VG: 0 [0 ]
# lvscan
inactive '/dev/vg160/LogVol00' [147.00 GB] inherit
inactive '/dev/vg160/LogVol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol00' [72.47 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
# lvscan
ACTIVE '/dev/vg160/LogVol00' [147.00 GB] inherit
ACTIVE '/dev/vg160/LogVol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol00' [72.47 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
# mount -t ext3 -o ro /dev/vg160/LogVol00 /mnt/yourmountpoint
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question